UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

values: allow varlog to be more easily disabled

Merged Daniel Dides requested to merge dd/24-promtail-defaults into main

General MR

Summary

Changes the defaults slightly to allow /var/log logging to be more easily disabled by simply removing the extra volumes and extra volume mounts.

This does not change the default configuration however.

Relevant logs/screenshots

Render template from branch with defaults

danieldides@BPH-MAC14 ~/P/b/p/promtail (dd/24-promtail-defaults)> helm template chart > new.yaml

Render template from main with defaults

danieldides@BPH-MAC14 ~/P/b/p/promtail (dd/24-promtail-defaults)> git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
danieldides@BPH-MAC14 ~/P/b/p/promtail (main)> helm template chart > old.yaml

Compare (the order gets changed so I can't just straight diff them). Note /var/log is in both.

danieldides@BPH-MAC14 ~/P/b/p/promtail (main)> yq '. | select(.kind == "DaemonSet").spec.template.spec.containers[0].volumeMounts' old.yaml
- name: config
  mountPath: /etc/promtail
- mountPath: /run/promtail
  name: run
- mountPath: /var/lib/docker/containers
  name: containers
  readOnly: true
- mountPath: /var/log/pods
  name: pods
  readOnly: true
- mountPath: /var/log # <- /var/log
  name: varlog
  readOnly: true
- mountPath: /etc/machine-id # <- /etc/machine-id
  name: machine-id
  readOnly: true
danieldides@BPH-MAC14 ~/P/b/p/promtail (main)> yq '. | select(.kind == "DaemonSet").spec.template.spec.containers[0].volumeMounts' new.yaml
- name: config
  mountPath: /etc/promtail
- mountPath: /run/promtail
  name: run
- mountPath: /var/lib/docker/containers
  name: containers
  readOnly: true
- mountPath: /var/log/pods
  name: pods
  readOnly: true
- mountPath: /etc/machine-id # <- /etc/machine-id
  name: machine-id
  readOnly: true
- mountPath: /var/log # <- /var/log
  name: varlog
  readOnly: true

Regenerate with /var/log disabled

danieldides@BPH-MAC14 ~/P/b/p/promtail (dd/24-promtail-defaults)> helm template chart -f override.yaml > disabled.yaml
danieldides@BPH-MAC14 ~/P/b/p/promtail (dd/24-promtail-defaults)> cat override.yaml 
extraVolumes: []
extraVolumeMounts: []

Note that /var/log is no longer present but machine-id still is.

danieldides@BPH-MAC14 ~/P/b/p/promtail (dd/24-promtail-defaults)> yq '. | select(.kind == "DaemonSet").spec.template.spec.containers[0].volumeMounts' disabled.yaml
- name: config
  mountPath: /etc/promtail
- mountPath: /run/promtail
  name: run
- mountPath: /var/lib/docker/containers
  name: containers
  readOnly: true
- mountPath: /var/log/pods
  name: pods
  readOnly: true
- mountPath: /etc/machine-id  # <- /etc/machine-id
  name: machine-id
  readOnly: true```

Linked Issue

Relates #24 (closed)

Upgrade Notices

N/A

Edited by Ryan Garcia

Merge request reports

Merge request pipeline #2948996 passed

Merge request pipeline passed for 9531eaad

Approved by

Merged by Ryan GarciaRyan Garcia 1 year ago (Mar 6, 2024 7:04pm UTC)

Merge details

  • Changes merged into main with d86fed83 (commits were squashed).
  • Deleted the source branch.

Pipeline #2949937 passed

Pipeline passed for d86fed83 on main

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading