UNCLASSIFIED - NO CUI

Skip to content

values: allow varlog to be more easily disabled

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

Loading