@@ -93,7 +93,7 @@ secretGenerator:
93
93
- password.txt
94
94
` ` `
95
95
96
- {{% /tab %}}}
96
+ {{% /tab %}}
97
97
{{% tab name=".env 文件" %}}
98
98
<!--
99
99
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
146
146
the Secret data and appending the hash value to the name. This ensures that
147
147
a new Secret is generated each time the data is modified.
148
148
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
+ ```
150
154
-->
151
155
生成 Secret 时,Secret 的名称最终是由 ` name ` 字段和数据的哈希值拼接而成。
152
156
这将保证每次修改数据时生成一个新的 Secret。
153
157
154
158
要验证 Secret 是否已创建并解码 Secret 数据,
155
159
156
160
``` shell
157
- kubectl get -k <directory-path > -o jsonpath='{.data}'
161
+ kubectl get -k < 目录路径 > -o jsonpath=' {.data}'
158
162
```
159
163
160
164
<!--
@@ -163,11 +167,11 @@ The output is similar to:
163
167
输出类似于:
164
168
165
169
```
166
- { "password": "UyFCXCpkJHpEc2I9 ", "username": "YWRtaW4=" }
167
- ````
170
+ { "password": "MWYyZDFlMmU2N2Rm ", "username": "YWRtaW4=" }
171
+ ```
168
172
169
173
```
170
- echo 'UyFCXCpkJHpEc2I9 ' | base64 --decode
174
+ echo 'MWYyZDFlMmU2N2Rm ' | base64 --decode
171
175
```
172
176
173
177
<!--
@@ -176,7 +180,7 @@ The output is similar to:
176
180
输出类似于:
177
181
178
182
```
179
- S!B \* d$zDsb=
183
+ 1f2d1e2e67df
180
184
```
181
185
182
186
<!--
@@ -193,6 +197,10 @@ For more information, refer to
193
197
194
198
1. In your `kustomization.yaml` file, modify the data, such as the `password`.
195
199
1. Apply the directory that contains the kustomization file:
200
+
201
+ ```shell
202
+ kubectl apply -k <directory-path>
203
+ ```
196
204
-->
197
205
## 编辑 Secret {#edit-secret}
198
206
0 commit comments