Merge pull request #17866 from ygalblum/doc-kube-secret

[CI:DOCS] Kube Play Doc: Document the support for K8S Secret
This commit is contained in:
OpenShift Merge Robot 2023-04-01 09:24:06 -04:00 committed by GitHub
commit 9144b75090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 0 deletions

View File

@ -22,6 +22,7 @@ Currently, the supported Kubernetes kinds are:
- Deployment
- PersistentVolumeClaim
- ConfigMap
- Secret
`Kubernetes Pods or Deployments`
@ -122,6 +123,40 @@ spec:
and as a result environment variable `FOO` will be set to `bar` for container `container-1`.
`Kubernetes Secret`
Kubernetes Secret represents a Podman named secret. The Kubernetes Secret is saved as a whole and may be referred to as a source of environment variables or volumes in Pods or Deployments.
For example, the following YAML document defines a Secret and then uses it in a Pod:
```
kind: Secret
apiVersion: v1
metadata:
name: foo
data:
foo: YmFy # base64 for bar
---
apiVersion: v1
kind: Pod
metadata:
name: foobar
spec:
containers:
- command:
- top
name: container-1
image: foobar
env:
- name: FOO
valueFrom:
secretKeyRef:
name: foo
key: foo
```
and as a result environment variable `FOO` will be set to `bar` for container `container-1`.
## OPTIONS
@@option annotation.container