Skip to content

Commit 7964849

Browse files
authored
Merge pull request #34038 from Sea-n/sync-config-map-en
Update link text to configure-pod-configmap.md
2 parents e8be727 + ca34038 commit 7964849

File tree

3 files changed

+38
-39
lines changed

3 files changed

+38
-39
lines changed

content/en/docs/concepts/services-networking/network-policies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ POSTing this to the API server for your cluster will have no effect unless your
5454
__Mandatory Fields__: As with all other Kubernetes config, a NetworkPolicy
5555
needs `apiVersion`, `kind`, and `metadata` fields. For general information
5656
about working with config files, see
57-
[Configure Containers Using a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/),
57+
[Configure a Pod to Use a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/),
5858
and [Object Management](/docs/concepts/overview/working-with-objects/object-management).
5959

6060
__spec__: NetworkPolicy [spec](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) has all the information needed to define a particular network policy in the given namespace.

content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ card:
1010
<!-- overview -->
1111
Many applications rely on configuration which is used during either application initialization or runtime.
1212
Most of the times there is a requirement to adjust values assigned to configuration parameters.
13-
ConfigMaps is the kubernetes way to inject application pods with configuration data.
13+
ConfigMaps is the kubernetes way to inject application pods with configuration data.
1414
ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable. This page provides a series of usage examples demonstrating how to create ConfigMaps and configure Pods using data stored in ConfigMaps.
1515

1616

@@ -461,45 +461,45 @@ configmap/special-config-2-c92b5mmcf2 created
461461

462462
### Define a container environment variable with data from a single ConfigMap
463463

464-
1. Define an environment variable as a key-value pair in a ConfigMap:
464+
1. Define an environment variable as a key-value pair in a ConfigMap:
465465

466-
```shell
467-
kubectl create configmap special-config --from-literal=special.how=very
468-
```
466+
```shell
467+
kubectl create configmap special-config --from-literal=special.how=very
468+
```
469469

470-
2. Assign the `special.how` value defined in the ConfigMap to the `SPECIAL_LEVEL_KEY` environment variable in the Pod specification.
470+
2. Assign the `special.how` value defined in the ConfigMap to the `SPECIAL_LEVEL_KEY` environment variable in the Pod specification.
471471

472472
{{< codenew file="pods/pod-single-configmap-env-variable.yaml" >}}
473473

474474
Create the Pod:
475475

476-
```shell
477-
kubectl create -f https://kubernetes.io/examples/pods/pod-single-configmap-env-variable.yaml
478-
```
476+
```shell
477+
kubectl create -f https://kubernetes.io/examples/pods/pod-single-configmap-env-variable.yaml
478+
```
479479

480480
Now, the Pod's output includes environment variable `SPECIAL_LEVEL_KEY=very`.
481481

482482
### Define container environment variables with data from multiple ConfigMaps
483483

484-
* As with the previous example, create the ConfigMaps first.
484+
* As with the previous example, create the ConfigMaps first.
485485

486-
{{< codenew file="configmap/configmaps.yaml" >}}
486+
{{< codenew file="configmap/configmaps.yaml" >}}
487487

488-
Create the ConfigMap:
488+
Create the ConfigMap:
489489

490-
```shell
491-
kubectl create -f https://kubernetes.io/examples/configmap/configmaps.yaml
492-
```
490+
```shell
491+
kubectl create -f https://kubernetes.io/examples/configmap/configmaps.yaml
492+
```
493493

494494
* Define the environment variables in the Pod specification.
495495

496496
{{< codenew file="pods/pod-multiple-configmap-env-variable.yaml" >}}
497497

498498
Create the Pod:
499499

500-
```shell
501-
kubectl create -f https://kubernetes.io/examples/pods/pod-multiple-configmap-env-variable.yaml
502-
```
500+
```shell
501+
kubectl create -f https://kubernetes.io/examples/pods/pod-multiple-configmap-env-variable.yaml
502+
```
503503

504504
Now, the Pod's output includes environment variables `SPECIAL_LEVEL_KEY=very` and `LOG_LEVEL=INFO`.
505505

@@ -515,21 +515,21 @@ This functionality is available in Kubernetes v1.6 and later.
515515

516516
Create the ConfigMap:
517517

518-
```shell
519-
kubectl create -f https://kubernetes.io/examples/configmap/configmap-multikeys.yaml
520-
```
518+
```shell
519+
kubectl create -f https://kubernetes.io/examples/configmap/configmap-multikeys.yaml
520+
```
521521

522522
* Use `envFrom` to define all of the ConfigMap's data as container environment variables. The key from the ConfigMap becomes the environment variable name in the Pod.
523523

524-
{{< codenew file="pods/pod-configmap-envFrom.yaml" >}}
524+
{{< codenew file="pods/pod-configmap-envFrom.yaml" >}}
525525

526-
Create the Pod:
526+
Create the Pod:
527527

528-
```shell
529-
kubectl create -f https://kubernetes.io/examples/pods/pod-configmap-envFrom.yaml
530-
```
528+
```shell
529+
kubectl create -f https://kubernetes.io/examples/pods/pod-configmap-envFrom.yaml
530+
```
531531

532-
Now, the Pod's output includes environment variables `SPECIAL_LEVEL=very` and `SPECIAL_TYPE=charm`.
532+
Now, the Pod's output includes environment variables `SPECIAL_LEVEL=very` and `SPECIAL_TYPE=charm`.
533533

534534

535535
## Use ConfigMap-defined environment variables in Pod commands
@@ -680,15 +680,15 @@ data:
680680

681681
- If you use `envFrom` to define environment variables from ConfigMaps, keys that are considered invalid will be skipped. The pod will be allowed to start, but the invalid names will be recorded in the event log (`InvalidVariableNames`). The log message lists each skipped key. For example:
682682

683-
```shell
684-
kubectl get events
685-
```
683+
```shell
684+
kubectl get events
685+
```
686686

687-
The output is similar to this:
688-
```
689-
LASTSEEN FIRSTSEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
690-
0s 0s 1 dapi-test-pod Pod Warning InvalidEnvironmentVariableNames {kubelet, 127.0.0.1} Keys [1badkey, 2alsobad] from the EnvFrom configMap default/myconfig were skipped since they are considered invalid environment variable names.
691-
```
687+
The output is similar to this:
688+
```
689+
LASTSEEN FIRSTSEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
690+
0s 0s 1 dapi-test-pod Pod Warning InvalidEnvironmentVariableNames {kubelet, 127.0.0.1} Keys [1badkey, 2alsobad] from the EnvFrom configMap default/myconfig were skipped since they are considered invalid environment variable names.
691+
```
692692

693693
- ConfigMaps reside in a specific {{< glossary_tooltip term_id="namespace" >}}. A ConfigMap can only be referenced by pods residing in the same namespace.
694694

@@ -699,4 +699,3 @@ data:
699699
## {{% heading "whatsnext" %}}
700700

701701
* Follow a real world example of [Configuring Redis using a ConfigMap](/docs/tutorials/configuration/configure-redis-using-configmap/).
702-

content/en/docs/tutorials/configuration/configure-redis-using-configmap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ content_type: tutorial
88

99
<!-- overview -->
1010

11-
This page provides a real world example of how to configure Redis using a ConfigMap and builds upon the [Configure Containers Using a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) task.
11+
This page provides a real world example of how to configure Redis using a ConfigMap and builds upon the [Configure a Pod to Use a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) task.
1212

1313

1414

@@ -27,7 +27,7 @@ This page provides a real world example of how to configure Redis using a Config
2727
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
2828

2929
* The example shown on this page works with `kubectl` 1.14 and above.
30-
* Understand [Configure Containers Using a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/).
30+
* Understand [Configure a Pod to Use a ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/).
3131

3232

3333

0 commit comments

Comments
 (0)