Skip to content

Commit

Permalink
Revert "Document the environment variable substitution feature of con…
Browse files Browse the repository at this point in the history
…figMapGenerator"

This reverts commit b9da040.
  • Loading branch information
KnVerey committed Aug 3, 2022
1 parent 3eced5d commit 39fb094
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions content/en/docs/tasks/manage-kubernetes-objects/kustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,12 @@ metadata:
name: example-configmap-1-8mbdf7882g
```
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.

{{< note >}}
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.
{{< /note >}}

Here is an example of generating a ConfigMap with a data item from a `.env` file:
To generate a ConfigMap from an env file, add an entry to the `envs` list in `configMapGenerator`. Here is an example of generating a ConfigMap with a data item from a `.env` file:

```shell
# Create a .env file
# BAZ will be populated from the local environment variable $BAZ
cat <<EOF >.env
FOO=Bar
BAZ
EOF
cat <<EOF >./kustomization.yaml
Expand All @@ -113,19 +105,18 @@ EOF
The generated ConfigMap can be examined with the following command:

```shell
BAZ=Qux kubectl kustomize ./
kubectl kustomize ./
```

The generated ConfigMap is:

```yaml
apiVersion: v1
data:
BAZ: Qux
FOO: Bar
kind: ConfigMap
metadata:
name: example-configmap-1-892ghb99c8
name: example-configmap-1-42cfbf598f
```

{{< note >}}
Expand Down

0 comments on commit 39fb094

Please sign in to comment.