Move config files out of old user-guide directory. (#7398)
* Move config files out of old user-guide directory. * Update file paths.
This commit is contained in:
committed by
k8s-ci-robot
parent
f51d11f614
commit
eb469c5475
@@ -31,8 +31,8 @@ The data source corresponds to a key-value pair in the ConfigMap, where
|
|||||||
* key = the file name or the key you provided on the command line, and
|
* key = the file name or the key you provided on the command line, and
|
||||||
* value = the file contents or the literal value you provided on the command line.
|
* value = the file contents or the literal value you provided on the command line.
|
||||||
|
|
||||||
You can use [`kubectl describe`](/docs/user-guide/kubectl/{{page.version}}/#describe) or
|
You can use [`kubectl describe`](/docs/reference/generated/kubectl/kubectl-commands/#describe) or
|
||||||
[`kubectl get`](/docs/user-guide/kubectl/{{page.version}}/#get) to retrieve information
|
[`kubectl get`](/docs/reference/generated/kubectl/kubectl-commands/#get) to retrieve information
|
||||||
about a ConfigMap.
|
about a ConfigMap.
|
||||||
|
|
||||||
### Create ConfigMaps from directories
|
### Create ConfigMaps from directories
|
||||||
@@ -42,13 +42,13 @@ You can use `kubectl create configmap` to create a ConfigMap from multiple files
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl create configmap game-config --from-file=docs/user-guide/configmap/kubectl
|
kubectl create configmap game-config --from-file=https://k8s.io/docs/tasks/configure-pod-container/configmap/kubectl
|
||||||
```
|
```
|
||||||
|
|
||||||
combines the contents of the `docs/user-guide/configmap/kubectl/` directory
|
combines the contents of the `docs/tasks/configure-pod-container/configmap/kubectl/` directory
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ls docs/user-guide/configmap/kubectl/
|
ls docs/tasks/configure-pod-container/configmap/kubectl/
|
||||||
game.properties
|
game.properties
|
||||||
ui.properties
|
ui.properties
|
||||||
```
|
```
|
||||||
@@ -68,7 +68,7 @@ game.properties: 158 bytes
|
|||||||
ui.properties: 83 bytes
|
ui.properties: 83 bytes
|
||||||
```
|
```
|
||||||
|
|
||||||
The `game.properties` and `ui.properties` files in the `docs/user-guide/configmap/kubectl/` directory are represented in the `data` section of the ConfigMap.
|
The `game.properties` and `ui.properties` files in the `docs/tasks/configure-pod-container/configmap/kubectl/` directory are represented in the `data` section of the ConfigMap.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl get configmaps game-config -o yaml
|
kubectl get configmaps game-config -o yaml
|
||||||
@@ -107,7 +107,7 @@ You can use `kubectl create configmap` to create a ConfigMap from an individual
|
|||||||
For example,
|
For example,
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl create configmap game-config-2 --from-file=docs/user-guide/configmap/kubectl/game.properties
|
kubectl create configmap game-config-2 --from-file=https://k8s.io/docs/tasks/configure-pod-container/configmap/kubectl/game.properties
|
||||||
```
|
```
|
||||||
|
|
||||||
would produce the following ConfigMap:
|
would produce the following ConfigMap:
|
||||||
@@ -127,7 +127,7 @@ game.properties: 158 bytes
|
|||||||
You can pass in the `--from-file` argument multiple times to create a ConfigMap from multiple data sources.
|
You can pass in the `--from-file` argument multiple times to create a ConfigMap from multiple data sources.
|
||||||
|
|
||||||
```shell
|
```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
|
kubectl create configmap game-config-2 --from-file=https://k8s.io/docs/tasks/configure-pod-container/configmap/kubectl/game.properties --from-file=https://k8s.io/docs/tasks/configure-pod-container/configmap/kubectl/ui.properties
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -156,7 +156,7 @@ where `<my-key-name>` is the key you want to use in the ConfigMap and `<path-to-
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl create configmap game-config-3 --from-file=game-special-key=docs/user-guide/configmap/kubectl/game.properties
|
kubectl create configmap game-config-3 --from-file=game-special-key=https://k8s.io/docs/tasks/configure-pod-container/configmap/kubectl/game.properties
|
||||||
|
|
||||||
kubectl get configmaps game-config-3 -o yaml
|
kubectl get configmaps game-config-3 -o yaml
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: config-cmd-test-pod
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: test-container
|
|
||||||
image: k8s.gcr.io/busybox
|
|
||||||
command: [ "/bin/sh", "-c", "echo $(KUBE_CONFIG_1) $(KUBE_CONFIG_2)" ]
|
|
||||||
env:
|
|
||||||
- name: KUBE_CONFIG_1
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: test-configmap
|
|
||||||
key: data-1
|
|
||||||
- name: KUBE_CONFIG_2
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: test-configmap
|
|
||||||
key: data-2
|
|
||||||
restartPolicy: Never
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: test-configmap
|
|
||||||
data:
|
|
||||||
data-1: value-1
|
|
||||||
data-2: value-2
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: config-env-test-pod
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: test-container
|
|
||||||
image: k8s.gcr.io/busybox
|
|
||||||
command: [ "/bin/sh", "-c", "env" ]
|
|
||||||
env:
|
|
||||||
- name: KUBE_CONFIG_1
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: test-configmap
|
|
||||||
key: data-1
|
|
||||||
- name: KUBE_CONFIG_2
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: test-configmap
|
|
||||||
key: data-2
|
|
||||||
restartPolicy: Never
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: config-single-file-volume-pod
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: test-container
|
|
||||||
image: k8s.gcr.io/busybox
|
|
||||||
command: [ "/bin/sh", "-c", "cat /etc/special-key" ]
|
|
||||||
volumeMounts:
|
|
||||||
- name: config-volume
|
|
||||||
mountPath: /etc/special-key
|
|
||||||
subPath: path/to/special-key
|
|
||||||
volumes:
|
|
||||||
- name: config-volume
|
|
||||||
configMap:
|
|
||||||
name: test-configmap
|
|
||||||
items:
|
|
||||||
- key: data-1
|
|
||||||
path: path/to/special-key
|
|
||||||
restartPolicy: Never
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: config-volume-test-pod
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: test-container
|
|
||||||
image: k8s.gcr.io/busybox
|
|
||||||
command: [ "/bin/sh", "-c", "cat /etc/config/path/to/special-key" ]
|
|
||||||
volumeMounts:
|
|
||||||
- name: config-volume
|
|
||||||
mountPath: /etc/config
|
|
||||||
volumes:
|
|
||||||
- name: config-volume
|
|
||||||
configMap:
|
|
||||||
name: test-configmap
|
|
||||||
items:
|
|
||||||
- key: data-1
|
|
||||||
path: path/to/special-key
|
|
||||||
restartPolicy: Never
|
|
||||||
Reference in New Issue
Block a user