Skip to content

Instantly share code, notes, and snippets.

@rockon1985
Last active November 12, 2019 15:11
Show Gist options
  • Select an option

  • Save rockon1985/da2676f5a0d50e085666a5c6d657ff1d to your computer and use it in GitHub Desktop.

Select an option

Save rockon1985/da2676f5a0d50e085666a5c6d657ff1d to your computer and use it in GitHub Desktop.
Kubernetes Pod using secret for mounting env variables
apiVersion: v1
kind: Pod
metadata:
name: secret-env-pod
spec:
containers:
- name: mycontainer
image: redis
env:
- name: PORT
value: 3600
- name: MAX_THREADS
value: 5
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: database_secret
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: database_secret
key: password
restartPolicy: Never
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment