Last active
November 12, 2019 15:11
-
-
Save rockon1985/da2676f5a0d50e085666a5c6d657ff1d to your computer and use it in GitHub Desktop.
Kubernetes Pod using secret for mounting env variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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