Fix configmap docs
This commit is contained in:
parent
4cbce7619f
commit
1775b0a809
|
@ -22,8 +22,8 @@ You can use `kubectl` to see information about the ConfigMap:
|
|||
|
||||
```shell
|
||||
$ kubectl get configmap
|
||||
NAME DATA
|
||||
test-secret 2
|
||||
NAME DATA AGE
|
||||
test-configmap 2 6s
|
||||
|
||||
$ kubectl describe configMap test-configmap
|
||||
Name: test-configmap
|
||||
|
@ -39,7 +39,7 @@ data-2: 7 bytes
|
|||
View the values of the keys with `kubectl get`:
|
||||
|
||||
```shell
|
||||
$ cluster/kubectl.sh get configmaps test-configmap -o yaml
|
||||
$ kubectl get configmaps test-configmap -o yaml
|
||||
apiVersion: v1
|
||||
data:
|
||||
data-1: value-1
|
||||
|
@ -66,23 +66,24 @@ $ kubectl create -f docs/user-guide/configmap/env-pod.yaml
|
|||
This pod runs the `env` command to display the environment of the container:
|
||||
|
||||
```shell
|
||||
$ kubectl logs secret-test-pod
|
||||
$ kubectl logs config-env-test-pod | grep KUBE_CONFIG
|
||||
KUBE_CONFIG_1=value-1
|
||||
KUBE_CONFIG_2=value-2
|
||||
```
|
||||
|
||||
## Step Three: Create a pod that sets the command line using ConfigMap
|
||||
|
||||
Use the [`command-pod.yaml`](env-pod.yaml) file to create a Pod with a container
|
||||
Use the [`command-pod.yaml`](command-pod.yaml) file to create a Pod with a container
|
||||
whose command is injected with the keys of a ConfigMap
|
||||
|
||||
```shell
|
||||
$ kubectl create -f docs/user-guide/configmap/env-pod.yaml
|
||||
$ kubectl create -f docs/user-guide/configmap/command-pod.yaml
|
||||
```
|
||||
|
||||
This pod runs an `echo` command to display the keys:
|
||||
|
||||
```shell
|
||||
$ kubectl logs config-cmd-test-pod
|
||||
value-1 value-2
|
||||
```
|
||||
|
||||
|
@ -97,5 +98,6 @@ $ kubectl create -f docs/user-guide/configmap/volume-pod.yaml
|
|||
This pod runs a `cat` command to print the value of one of the keys in the volume:
|
||||
|
||||
```shell
|
||||
$ kubectl logs config-volume-test-pod
|
||||
value-1
|
||||
```
|
||||
```
|
||||
|
|
|
@ -91,7 +91,7 @@ content of the file.
|
|||
Let's take a look at the ConfigMap that this command created:
|
||||
|
||||
```shell
|
||||
$ cluster/kubectl.sh describe configmaps game-config
|
||||
$ kubectl describe configmaps game-config
|
||||
Name: game-config
|
||||
Namespace: default
|
||||
Labels: <none>
|
||||
|
@ -147,7 +147,7 @@ following command yields equivalent results to the above example:
|
|||
```shell
|
||||
$ kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties --from-file=docs/user-guide/configmap/kubectl/ui.properties
|
||||
|
||||
$ cluster/kubectl.sh get configmaps game-config-2 -o yaml
|
||||
$ kubectl get configmaps game-config-2 -o yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
|
@ -267,13 +267,13 @@ spec:
|
|||
- name: SPECIAL_LEVEL_KEY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: special-configmap
|
||||
name: special-config
|
||||
key: special.how
|
||||
- name: SPECIAL_TYPE_KEY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: special-config
|
||||
key: data-1
|
||||
key: special.type
|
||||
restartPolicy: Never
|
||||
```
|
||||
|
||||
|
@ -318,13 +318,13 @@ spec:
|
|||
- name: SPECIAL_LEVEL_KEY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: special-configmap
|
||||
name: special-config
|
||||
key: special.how
|
||||
- name: SPECIAL_TYPE_KEY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: special-config
|
||||
key: data-1
|
||||
key: special.type
|
||||
restartPolicy: Never
|
||||
```
|
||||
|
||||
|
@ -427,25 +427,23 @@ ConfigMap instance with it:
|
|||
```shell
|
||||
$ kubectl create configmap example-redis-config --from-file=docs/user-guide/configmap/redis/redis-config
|
||||
|
||||
$ kubectl get configmap redis-config -o yaml
|
||||
$ kubectl get configmap example-redis-config -o yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
{
|
||||
"kind": "ConfigMap",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "example-redis-config",
|
||||
"namespace": "default",
|
||||
"selfLink": "/api/v1/namespaces/default/configmaps/example-redis-config",
|
||||
"uid": "07fd0419-d97b-11e5-b443-68f728db1985",
|
||||
"resourceVersion": "15",
|
||||
"creationTimestamp": "2016-02-22T15:43:34Z"
|
||||
},
|
||||
"data": {
|
||||
"redis-config": "maxmemory 2mb\nmaxmemory-policy allkeys-lru\n"
|
||||
}
|
||||
}
|
||||
apiVersion: v1
|
||||
data:
|
||||
redis-config: |
|
||||
maxmemory 2mb
|
||||
maxmemory-policy allkeys-lru
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
creationTimestamp: 2016-03-30T18:14:41Z
|
||||
name: example-redis-config
|
||||
namespace: default
|
||||
resourceVersion: "24686"
|
||||
selfLink: /api/v1/namespaces/default/configmaps/example-redis-config
|
||||
uid: 460a2b6e-f6a3-11e5-8ae5-42010af00002
|
||||
```
|
||||
|
||||
Now, let's create a pod that uses this config:
|
||||
|
|
Loading…
Reference in New Issue