-
Notifications
You must be signed in to change notification settings - Fork 0
K8s Secrets
Philip Fourie edited this page Apr 12, 2020
·
1 revision
YAML file with kind: Secret
also note stringData
section
apiVersion: v1
kind: Secret
metadata:
name: <secret-name>
stringData:
<key1>: <value1>
<key2>: <value2>
kubectl apply -f <secret.yaml>
Then to use in Pod
as an environment variable
...
spec:
...
env:
- name: MY_PASSWORD
valueFrom:
secretKeyRef: <secret-name>
key: <key1>
...