Skip to content

Commit 3bc1fee

Browse files
Bharath KaimalBharath Kaimal
authored andcommitted
update to kubernetes-configuration-secrets
1 parent 1a37b28 commit 3bc1fee

File tree

1 file changed

+43
-52
lines changed
  • docs/openshift/configuration/secrets

1 file changed

+43
-52
lines changed

docs/openshift/configuration/secrets/index.md

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ Kubernetes secret objects let you store and manage sensitive information, such a
44

55
A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Such information might otherwise be put in a Pod specification or in an image; putting it in a Secret object allows for more control over how it is used, and reduces the risk of accidental exposure.
66

7-
87
## Resources
98

109
=== "OpenShift"
1110

12-
[Image Pull Secrets :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/openshift_images/managing_images/using-image-pull-secrets.html){ .md-button target="_blank"}
11+
[Image Pull Secrets :fontawesome-solid-key:](https://docs.openshift.com/container-platform/4.13/openshift_images/managing_images/using-image-pull-secrets.html){ .md-button target="_blank"}
1312

14-
[Secret Commands :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/developer-cli-commands.html#oc-create-secret-generic){ .md-button target="_blank"}
13+
[Secret Commands :fontawesome-solid-key:](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/developer-cli-commands.html#oc-create-secret-generic){ .md-button target="_blank"}
1514

1615
=== "Kubernetes"
1716

18-
[Secrets :fontawesome-solid-globe:](https://kubernetes.io/docs/concepts/configuration/secret/){ .md-button target="_blank"}
17+
[Secrets :fontawesome-solid-key:](https://kubernetes.io/docs/concepts/configuration/secret/){ .md-button target="_blank"}
1918

20-
[Secret Distribution :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/){ .md-button target="_blank"}
19+
[Secret Distribution :fontawesome-solid-key:](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/){ .md-button target="_blank"}
2120

2221
## References
2322

@@ -53,62 +52,54 @@ metadata:
5352
name: my-pod
5453
spec:
5554
containers:
56-
- name: my-app
57-
image: bitnami/nginx
58-
ports:
59-
- containerPort: 8080
60-
env:
61-
- name: SECRET_USERNAME
62-
valueFrom:
63-
secretKeyRef:
55+
- name: my-app
56+
image: bitnami/nginx
57+
ports:
58+
- containerPort: 8080
59+
env:
60+
- name: SECRET_USERNAME
61+
valueFrom:
62+
secretKeyRef:
63+
name: mysecret
64+
key: username
65+
envFrom:
66+
- secretRef:
6467
name: mysecret
65-
key: username
66-
envFrom:
67-
- secretRef:
68-
name: mysecret
69-
volumeMounts:
70-
- name: config
71-
mountPath: "/etc/secrets"
68+
volumeMounts:
69+
- name: config
70+
mountPath: "/etc/secrets"
7271
volumes:
7372
- name: config
7473
secret:
7574
secretName: mysecret-config
7675
```
7776
7877
=== "OpenShift"
79-
**Create files needed for rest of example.**
80-
```
81-
echo -n 'admin' > ./username.txt
78+
**Create files needed for rest of example.**
79+
` echo -n 'admin' > ./username.txt
8280
echo -n '1f2d1e2e67df' > ./password.txt
83-
```
84-
**Creating Secret from files.**
85-
```
86-
oc create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
87-
```
88-
**Getting Secret**
89-
```
90-
oc get secrets
91-
```
92-
**Gets the Secret's Description.**
93-
```
94-
oc describe secrets/db-user-pass
95-
```
81+
`
82+
**Creating Secret from files.**
83+
` oc create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
84+
`
85+
**Getting Secret**
86+
` oc get secrets
87+
`
88+
**Gets the Secret's Description.**
89+
` oc describe secrets/db-user-pass
90+
`
9691
9792
=== "Kubernetes"
98-
**Create files needed for rest of example.**
99-
```
100-
echo -n 'admin' > ./username.txt
93+
**Create files needed for rest of example**
94+
` echo -n 'admin' > ./username.txt
10195
echo -n '1f2d1e2e67df' > ./password.txt
102-
```
103-
** Creates the Secret from the files**
104-
```
105-
kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
106-
```
107-
**Gets the Secret**
108-
```
109-
kubectl get secrets
110-
```
111-
**Gets the Secret's Description.**
112-
```
113-
kubectl describe secrets/db-user-pass
114-
```
96+
`
97+
**Creates the Secret from the files**
98+
` kubectl create secret generic db-user-pass --from-file=./username.txt --from-file=./password.txt
99+
`
100+
**Gets the Secret**
101+
` kubectl get secrets
102+
`
103+
**Gets the Secret's Description**
104+
` kubectl describe secrets/db-user-pass
105+
`

0 commit comments

Comments
 (0)