Skip to content

Commit a3dc78a

Browse files
committed
Remove the Check the secret section and merge into the existing sections
1 parent 0b9899c commit a3dc78a

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,7 @@ stringData:
108108
When you retrieve the Secret data, the command returns the encoded values,
109109
and not the plaintext values you provided in `stringData`.
110110

111-
Create the Secret using [`kubectl apply`](/docs/reference/generated/kubectl/kubectl-commands#apply):
112-
113-
```shell
114-
kubectl apply -f ./secret.yaml
115-
```
116-
117-
The output is similar to:
118-
119-
```
120-
secret/mysecret created
121-
```
122-
123-
## Check the Secret
124-
125-
The `stringData` field is a write-only convenience field. It is never output when
126-
retrieving Secrets. For example, if you run the following command:
111+
For example, if you run the following command:
127112

128113
```shell
129114
kubectl get secret mysecret -o yaml
@@ -145,14 +130,9 @@ metadata:
145130
type: Opaque
146131
```
147132

148-
The commands `kubectl get` and `kubectl describe` avoid showing the contents of a `Secret` by
149-
default. This is to protect the `Secret` from being exposed accidentally to an onlooker,
150-
or from being stored in a terminal log.
151-
To check the actual content of the encoded data, please refer to
152-
[decoding secret](/docs/tasks/configmap-secret/managing-secret-using-kubectl/#decoding-secret).
133+
### Specifying both `data` and `stringData`
153134

154-
If a field, such as `username`, is specified in both `data` and `stringData`,
155-
the value from `stringData` is used. For example, the following Secret definition:
135+
If you specify a field in both `data` and `stringData`, the value from `stringData` is used. For example, if you define the following Secret:
156136

157137
```yaml
158138
apiVersion: v1
@@ -166,7 +146,7 @@ stringData:
166146
username: administrator
167147
```
168148

169-
Results in the following Secret:
149+
The `Secret` object is created as follows:
170150

171151
```yaml
172152
apiVersion: v1
@@ -182,7 +162,7 @@ metadata:
182162
type: Opaque
183163
```
184164

185-
Where `YWRtaW5pc3RyYXRvcg==` decodes to `administrator`.
165+
`YWRtaW5pc3RyYXRvcg==` decodes to `administrator`.
186166

187167
## Clean Up
188168

0 commit comments

Comments
 (0)