Kubernetes ConfigMap volume doesn't create file in container -
k8s 1.2 deployed locally, single-node docker
am doing wrong? working else or broken in k8s deployment?
following example in configmaps guide, /etc/config/special.how should created below not:
[root@totoro brs-kubernetes]# kubectl create -f example.yaml configmap "special-config" created pod "dapi-test-pod" created [root@totoro brs-kubernetes]# kubectl exec -it dapi-test-pod -- sh / # cd /etc/config/ /etc/config # ls /etc/config # ls -alh total 4 drwxrwxrwt 2 root root 40 mar 23 18:47 . drwxr-xr-x 7 root root 4.0k mar 23 18:47 .. /etc/config #
example.yaml
apiversion: v1 kind: configmap metadata: name: special-config namespace: default data: special.how: special.type: charm --- apiversion: v1 kind: pod metadata: name: dapi-test-pod spec: containers: - name: test-container image: gcr.io/google_containers/busybox command: ["sleep", "100"] volumemounts: - name: config-volume mountpath: /etc/config volumes: - name: config-volume configmap: name: special-config items: - key: special.how path: how.file restartpolicy: never
summary of conformance test failures follows (asked run jayunit100). full run in gist.
summarizing 7 failures: [fail] configmap [it] updates should reflected in volume [conformance] /home/schou/dev/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/configmap.go:262 [fail] downward api volume [it] should provide podname [conformance] /home/schou/dev/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/util.go:1637 [fail] downward api volume [it] should update labels on modification [conformance] /home/schou/dev/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/downwardapi_volume.go:82 [fail] configmap [it] should consumable pods in volume mappings [conformance] /home/schou/dev/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/util.go:1637 [fail] networking [it] should function intra-pod communication [conformance] /home/schou/dev/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/networking.go:121 [fail] downward api volume [it] should update annotations on modification [conformance] /home/schou/dev/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/downwardapi_volume.go:119 [fail] configmap [it] should consumable pods in volume [conformance] /home/schou/dev/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/util.go:1637 ran 93 of 265 specs in 2875.468 seconds fail! -- 86 passed | 7 failed | 0 pending | 172 skipped --- fail: teste2e (2875.48s) fail
output of findmnt:
[schou@totoro single-node]$ findmnt target source fstype options / /dev/mapper/fedora-root │ ext4 rw,relatime,data=ordere ├─/sys sysfs sysfs rw,nosuid,nodev,noexec, │ ├─/sys/kernel/security securityfs securit rw,nosuid,nodev,noexec, │ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec, │ │ ├─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec, │ │ └─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec, │ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec, │ ├─/sys/firmware/efi/efivars efivarfs efivarf rw,nosuid,nodev,noexec, │ ├─/sys/kernel/debug debugfs debugfs rw,relatime │ ├─/sys/kernel/config configfs configf rw,relatime │ └─/sys/fs/fuse/connections fusectl fusectl rw,relatime ├─/proc proc proc rw,nosuid,nodev,noexec, │ ├─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=32,pgrp= │ └─/proc/fs/nfsd nfsd nfsd rw,relatime ├─/dev devtmpfs devtmpf rw,nosuid,size=8175208k │ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev │ ├─/dev/pts devpts devpts rw,nosuid,noexec,relati │ ├─/dev/mqueue mqueue mqueue rw,relatime │ └─/dev/hugepages hugetlbfs hugetlb rw,relatime ├─/run tmpfs tmpfs rw,nosuid,nodev,mode=75 │ ├─/run/user/42 tmpfs tmpfs rw,nosuid,nodev,relatim │ │ └─/run/user/42/gvfs gvfsd-fuse fuse.gv rw,nosuid,nodev,relatim │ └─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relatim │ └─/run/user/1000/gvfs gvfsd-fuse fuse.gv rw,nosuid,nodev,relatim ├─/tmp tmpfs tmpfs rw ├─/boot /dev/sda2 ext4 rw,relatime,data=ordere │ └─/boot/efi /dev/sda1 vfat rw,relatime,fmask=0077, ├─/var/lib/nfs/rpc_pipefs sunrpc rpc_pip rw,relatime ├─/var/lib/kubelet/pods/fd20f710-fb82-11e5-ab9f-0862662cf845/volumes/kubernetes.io~secret/default-token-qggyv │ tmpfs tmpfs rw,relatime ├─/var/lib/kubelet/pods/2f652e15-fb83-11e5-ab9f-0862662cf845/volumes/kubernetes.io~configmap/config-volume │ tmpfs tmpfs rw,relatime └─/var/lib/kubelet/pods/2f652e15-fb83-11e5-ab9f-0862662cf845/volumes/kubernetes.io~secret/default-token-6bzfe tmpfs tmpfs rw,relatime [schou@totoro single-node]$
thanks @paul morie helping me diagnose , fix (from github issue):
bingo, mount propagation mode of /var/lib/kubelet private. try changing mount flag kubelet dir
-v /var/lib/kubelet:/var/lib/kubelet:rw,shared
i had change mountflags=slave
mountflags=shared
in docker systemd file.
Comments
Post a Comment