You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To generate a ConfigMap from an env file, add an entry to the `envs` list in `configMapGenerator`. This can also be used to set values from local environment variables by omitting the `=` and the value.
It's recommended to use the local environment variable population functionality sparingly - an overlay with a patch is often more maintainable. Setting values from the environment may be useful when they cannot easily be predicted, such as a git SHA.
143
-
-->
144
-
建议谨慎使用本地环境变量填充功能 —— 用补丁覆盖通常更易于维护。
145
-
当无法轻松预测变量的值时,从环境中设置值可能很有用,例如 git SHA。
146
-
147
-
<!--
133
+
To generate a ConfigMap from an env file, add an entry to the `envs` list in `configMapGenerator`.
148
134
Here is an example of generating a ConfigMap with a data item from a `.env` file:
@@ -171,7 +156,7 @@ The generated ConfigMap can be examined with the following command:
171
156
可以使用以下命令检查生成的 ConfigMap:
172
157
173
158
```shell
174
-
BAZ=Qux kubectl kustomize ./
159
+
kubectl kustomize ./
175
160
```
176
161
177
162
<!--
@@ -182,11 +167,10 @@ The generated ConfigMap is:
182
167
```yaml
183
168
apiVersion: v1
184
169
data:
185
-
BAZ: Qux
186
170
FOO: Bar
187
171
kind: ConfigMap
188
172
metadata:
189
-
name: example-configmap-1-892ghb99c8
173
+
name: example-configmap-1-42cfbf598f
190
174
```
191
175
192
176
<!--
@@ -201,8 +185,8 @@ Each variable in the `.env` file becomes a separate key in the ConfigMap that yo
201
185
ConfigMaps can also be generated from literal key-value pairs. To generate a ConfigMap from a literal key-value pair, add an entry to the `literals` list in configMapGenerator. Here is an example of generating a ConfigMap with a data item from a key-value pair:
In addition to patches, Kustomize also offers customizing container images or injecting field values from other objects into containers
872
853
without creating patches. For example, you can change the image used inside containers by specifying the new image in `images` field in `kustomization.yaml`.
0 commit comments