Skip to content

Commit 72b8238

Browse files
K8s: Simplify the update REC credential step (#1147)
* Simplify the update REC credential step * review feedback changes
1 parent 9f6cc44 commit 72b8238

File tree

1 file changed

+8
-33
lines changed

1 file changed

+8
-33
lines changed

content/operate/kubernetes/security/manage-rec-credentials.md

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,14 @@ curl -k --request POST \
6464

6565
3. From outside the pod, update the REC credential secret.
6666

67-
3a. Save the existing username to a text file.
68-
69-
```sh
70-
echo -n "<current_username>" > username
71-
```
72-
73-
3b. Save the new password to a text file.
74-
75-
```sh
76-
echo -n "<new_password>" > password
77-
```
78-
79-
3c. Update the REC credential secret.
80-
8167
```sh
8268
kubectl create secret generic <cluster_secret_name> \
83-
--from-file=./username \
84-
--from-file=./password --dry-run \
69+
--save-config \
70+
--dry-run=client \
71+
--from-literal=username=<current-username> \
72+
--from-literal=password=<new-password> \
8573
-o yaml | \
86-
kubectl apply -f
74+
kubectl apply -f -
8775
```
8876

8977
4. Wait five minutes for all the components to read the new password from the updated secret. If you proceed to the next step too soon, the account could get locked.
@@ -119,27 +107,14 @@ curl -k --request DELETE \
119107

120108
4. Update the REC credential secret:
121109

122-
4a. Save the new username to a text file.
123-
124-
```sh
125-
echo -n "<new_username>" > username
126-
```
127-
128-
4b. Save the new password to a text file.
129-
130-
```sh
131-
echo -n "<new_password>" > password
132-
```
133-
134-
4c. Update the REC credential secret.
135-
136110
```sh
137111
kubectl create secret generic <cluster_secret_name> \
138112
--save-config \
139113
--dry-run=client \
140-
--from-file=./username --from-file=./password \
114+
--from-literal=username=<new-username> \
115+
--from-literal=password=<new-password> \
141116
-o yaml | \
142-
kubectl apply -f
117+
kubectl apply -f -
143118
```
144119

145120
5. Wait five minutes for all the components to read the new password from the updated secret. If you proceed to the next step too soon, the account could get locked.

0 commit comments

Comments
 (0)