Skip to content

Commit 11f48b6

Browse files
authored
Merge pull request #47202 from windsonsea/kustomi
[zh] Sync managing-secret-using-kustomize.md
2 parents ddfefc5 + 4aa3fc4 commit 11f48b6

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

content/zh-cn/docs/tasks/configmap-secret/managing-secret-using-kustomize.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ secretGenerator:
9393
- password.txt
9494
```
9595
96-
{{% /tab %}}}
96+
{{% /tab %}}
9797
{{% tab name=".env 文件" %}}
9898
<!--
9999
You can also define the secretGenerator in the `kustomization.yaml` file by
@@ -146,15 +146,19 @@ When a Secret is generated, the Secret name is created by hashing
146146
the Secret data and appending the hash value to the name. This ensures that
147147
a new Secret is generated each time the data is modified.
148148
149-
To verify that the Secret was created and to decode the Secret data,
149+
To verify that the Secret was created and to decode the Secret data,
150+
151+
```shell
152+
kubectl get -k <directory-path> -o jsonpath='{.data}'
153+
```
150154
-->
151155
生成 Secret 时,Secret 的名称最终是由 `name` 字段和数据的哈希值拼接而成。
152156
这将保证每次修改数据时生成一个新的 Secret。
153157

154158
要验证 Secret 是否已创建并解码 Secret 数据,
155159

156160
```shell
157-
kubectl get -k <directory-path> -o jsonpath='{.data}'
161+
kubectl get -k <目录路径> -o jsonpath='{.data}'
158162
```
159163

160164
<!--
@@ -163,11 +167,11 @@ The output is similar to:
163167
输出类似于:
164168

165169
```
166-
{ "password": "UyFCXCpkJHpEc2I9", "username": "YWRtaW4=" }
167-
````
170+
{ "password": "MWYyZDFlMmU2N2Rm", "username": "YWRtaW4=" }
171+
```
168172

169173
```
170-
echo 'UyFCXCpkJHpEc2I9' | base64 --decode
174+
echo 'MWYyZDFlMmU2N2Rm' | base64 --decode
171175
```
172176

173177
<!--
@@ -176,7 +180,7 @@ The output is similar to:
176180
输出类似于:
177181

178182
```
179-
S!B\*d$zDsb=
183+
1f2d1e2e67df
180184
```
181185

182186
<!--
@@ -193,6 +197,10 @@ For more information, refer to
193197
194198
1. In your `kustomization.yaml` file, modify the data, such as the `password`.
195199
1. Apply the directory that contains the kustomization file:
200+
201+
```shell
202+
kubectl apply -k <directory-path>
203+
```
196204
-->
197205
## 编辑 Secret {#edit-secret}
198206

0 commit comments

Comments
 (0)