You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/concepts/configuration/secret.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -854,6 +854,43 @@ start until all the Pod's volumes are mounted.
854
854
855
855
## Use cases
856
856
857
+
### Use-Case: As container environment variables
858
+
859
+
Create a secret
860
+
```yaml
861
+
apiVersion: v1
862
+
kind: Secret
863
+
metadata:
864
+
name: mysecret
865
+
type: Opaque
866
+
data:
867
+
USER_NAME: YWRtaW4=
868
+
PASSWORD: MWYyZDFlMmU2N2Rm
869
+
```
870
+
871
+
Create the Secret:
872
+
```shell
873
+
kubectl apply -f mysecret.yaml
874
+
```
875
+
876
+
Use `envFrom` to define all of the Secret’s data as container environment variables. The key from the Secret becomes the environment variable name in the Pod.
0 commit comments