Difference between revisions of "SecretKeyRef"
Jump to navigation
Jump to search
(Created page with " <pre> apiVersion: v1 kind: Pod metadata: name: secret-env-pod spec: containers: - name: mycontainer image: redis env: - name: SECRET_USERNAME val...") |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{lc}} | ||
+ | == Official example == | ||
+ | https://kubernetes.io/docs/concepts/configuration/secret/ | ||
− | + | {{K8s secret official example}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | == Related == | ||
+ | * [[Use ConfigMaps and Secrets to configure applications]], [[CKA v1.24]] (2022), [[CKA v1.23]] (2021) | ||
+ | == See also == | ||
+ | * {{K8s secrets}} | ||
− | + | [[Category:K8s]] |
Latest revision as of 09:46, 12 October 2022
Official example[edit]
https://kubernetes.io/docs/concepts/configuration/secret/
apiVersion: v1 kind: Pod metadata: name: secret-env-pod spec: containers: - name: mycontainer image: redis env: - name: SECRET_USERNAME valueFrom: secretKeyRef: name: mysecret key: username optional: false # same as default; "mysecret" must exist # and include a key named "username" - name: SECRET_PASSWORD valueFrom: secretKeyRef: name: mysecret key: password optional: false # same as default; "mysecret" must exist # and include a key named "password" restartPolicy: Never
Related[edit]
- Use ConfigMaps and Secrets to configure applications, CKA v1.24 (2022), CKA v1.23 (2021)
See also[edit]
- Kubernetes secrets:
kubectl [ get | create | describe | delete | secret ] secrets
,secret.yml, kind: Secret, secretKeyRef, default-token, imagePullSecrets:, kubernetes.io/dockerconfigjson
Advertising: