Skip to content

Instantly share code, notes, and snippets.

@limscoder
Last active January 12, 2018 18:25
Show Gist options
  • Save limscoder/5980a3f85fea8c3efb71af1f1c9bb172 to your computer and use it in GitHub Desktop.
Save limscoder/5980a3f85fea8c3efb71af1f1c9bb172 to your computer and use it in GitHub Desktop.
secret initialization via init-container
initContainers:
- name: init-config
image: quay.io/prometheus/alertmanager:v0.12.0
env:
- name: SMTP_AUTH_USERNAME
valueFrom:
secretKeyRef:
name: alert-email-secret
key: username
- name: SMTP_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: alert-email-secret
key: password
command:
- sh
- -c
- sed -i -e "s/{{SMTP_AUTH_USERNAME}}/$(SMTP_AUTH_USERNAME)/g" /etc/alertmanager/alertmanager.yml && sed -i -e "s/{{SMTP_AUTH_PASSWORD}}/$(SMTP_AUTH_PASSWORD)/g" /etc/alertmanager/alertmanager.yml
volumeMounts:
- name: config-volume
mountPath: /etc/alertmanager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment