Skip to content

Commit e7920ea

Browse files
authored
Merge pull request #27737 from shannonxtreme/secret-kubectl
Correct formatting and style
2 parents 30c5e76 + e084eef commit e7920ea

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Managing Secret using kubectl
2+
title: Managing Secrets using kubectl
33
content_type: task
44
weight: 10
55
description: Creating Secret objects using kubectl command line.
@@ -15,7 +15,7 @@ description: Creating Secret objects using kubectl command line.
1515

1616
## Create a Secret
1717

18-
A `Secret` can contain user credentials required by Pods to access a database.
18+
A `Secret` can contain user credentials required by pods to access a database.
1919
For example, a database connection string consists of a username and password.
2020
You can store the username in a file `./username.txt` and the password in a
2121
file `./password.txt` on your local machine.
@@ -24,11 +24,10 @@ file `./password.txt` on your local machine.
2424
echo -n 'admin' > ./username.txt
2525
echo -n '1f2d1e2e67df' > ./password.txt
2626
```
27-
28-
The `-n` flag in the above two commands ensures that the generated files will
29-
not contain an extra newline character at the end of the text. This is
30-
important because when `kubectl` reads a file and encode the content into
31-
base64 string, the extra newline character gets encoded too.
27+
In these commands, the `-n` flag ensures that the generated files do not have
28+
an extra newline character at the end of the text. This is important because
29+
when `kubectl` reads a file and encodes the content into a base64 string, the
30+
extra newline character gets encoded too.
3231

3332
The `kubectl create secret` command packages these files into a Secret and creates
3433
the object on the API server.
@@ -45,7 +44,7 @@ The output is similar to:
4544
secret/db-user-pass created
4645
```
4746

48-
Default key name is the filename. You may optionally set the key name using
47+
The default key name is the filename. You can optionally set the key name using
4948
`--from-file=[key=]source`. For example:
5049

5150
```shell
@@ -54,17 +53,18 @@ kubectl create secret generic db-user-pass \
5453
--from-file=password=./password.txt
5554
```
5655

57-
You do not need to escape special characters in passwords from files
58-
(`--from-file`).
56+
You do not need to escape special characters in password strings that you
57+
include in a file.
5958

6059
You can also provide Secret data using the `--from-literal=<key>=<value>` tag.
6160
This tag can be specified more than once to provide multiple key-value pairs.
6261
Note that special characters such as `$`, `\`, `*`, `=`, and `!` will be
6362
interpreted by your [shell](https://en.wikipedia.org/wiki/Shell_(computing))
6463
and require escaping.
64+
6565
In most shells, the easiest way to escape the password is to surround it with
66-
single quotes (`'`). For example, if your actual password is `S!B\*d$zDsb=`,
67-
you should execute the command this way:
66+
single quotes (`'`). For example, if your password is `S!B\*d$zDsb=`,
67+
run the following command:
6868

6969
```shell
7070
kubectl create secret generic dev-db-secret \
@@ -74,7 +74,7 @@ kubectl create secret generic dev-db-secret \
7474

7575
## Verify the Secret
7676

77-
You can check that the secret was created:
77+
Check that the Secret was created:
7878

7979
```shell
8080
kubectl get secrets
@@ -111,7 +111,7 @@ username: 5 bytes
111111

112112
The commands `kubectl get` and `kubectl describe` avoid showing the contents
113113
of a `Secret` by default. This is to protect the `Secret` from being exposed
114-
accidentally to an onlooker, or from being stored in a terminal log.
114+
accidentally, or from being stored in a terminal log.
115115

116116
## Decoding the Secret {#decoding-secret}
117117

@@ -141,7 +141,7 @@ The output is similar to:
141141

142142
## Clean Up
143143

144-
To delete the Secret you have created:
144+
Delete the Secret you created:
145145

146146
```shell
147147
kubectl delete secret db-user-pass
@@ -152,5 +152,5 @@ kubectl delete secret db-user-pass
152152
## {{% heading "whatsnext" %}}
153153

154154
- Read more about the [Secret concept](/docs/concepts/configuration/secret/)
155-
- Learn how to [manage Secret using config file](/docs/tasks/configmap-secret/managing-secret-using-config-file/)
156-
- Learn how to [manage Secret using kustomize](/docs/tasks/configmap-secret/managing-secret-using-kustomize/)
155+
- Learn how to [manage Secrets using config files](/docs/tasks/configmap-secret/managing-secret-using-config-file/)
156+
- Learn how to [manage Secrets using kustomize](/docs/tasks/configmap-secret/managing-secret-using-kustomize/)

0 commit comments

Comments
 (0)