Skip to content

Commit

Permalink
Add example mounting ConfigMap as a single file into /etc dir
Browse files Browse the repository at this point in the history
  • Loading branch information
dshulyak committed Jul 20, 2016
1 parent b7458ac commit d58ba7b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/user-guide/configmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ This pod runs a `cat` command to print the value of one of the keys in the volum
$ kubectl logs config-volume-test-pod
value-1
```

Alternatively you can use [`mount-file-pod.yaml`](mount-file-pod.yaml) file to mount
only a file from ConfigMap, preserving original content of /etc directory.
21 changes: 21 additions & 0 deletions docs/user-guide/configmap/mount-file-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Pod
metadata:
name: config-single-file-volume-pod
spec:
containers:
- name: test-container
image: gcr.io/google_containers/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

0 comments on commit d58ba7b

Please sign in to comment.