Using configmap make container keep creating directories

2/15/2017

I am using configmaps to populate configuration of few services. One container though is having a weird behavior. Several directories are created upon instanciation and then new ones every 2 minutes:

 0 drwxr-xr-x    4 root     root            90 Feb 15 14:45 ..2982_15_02_14_45_49.335148891
 0 drwxr-xr-x    4 root     root            90 Feb 15 14:45 ..2982_15_02_14_45_52.091968736
 0 drwxr-xr-x    4 root     root            90 Feb 15 14:45 ..2982_15_02_14_45_53.797898431
 0 drwxr-xr-x    4 root     root            90 Feb 15 14:45 ..2982_15_02_14_45_54.421758226
 0 drwxr-xr-x    4 root     root            90 Feb 15 14:45 ..2982_15_02_14_45_56.209637705
 0 drwxr-xr-x    4 root     root            90 Feb 15 14:46 ..2982_15_02_14_46_00.970889748
 0 drwxr-xr-x    4 root     root            90 Feb 15 14:46 ..2982_15_02_14_46_08.301261923

[..]

 0 drwxr-xr-x    4 root     root            90 Feb 15 15:22 ..2982_15_02_15_22_01.877596759
 0 drwxr-xr-x    4 root     root            90 Feb 15 15:24 ..2982_15_02_15_24_01.626300874
 0 drwxr-xr-x    4 root     root            90 Feb 15 15:26 ..2982_15_02_15_26_01.042779297
 0 drwxr-xr-x    4 root     root            90 Feb 15 15:28 ..2982_15_02_15_28_01.708510604
 0 drwxr-xr-x    4 root     root            90 Feb 15 15:30 ..2982_15_02_15_30_01.032055163
 0 drwxr-xr-x    4 root     root            90 Feb 15 15:32 ..2982_15_02_15_32_01.089879198
 0 drwxr-xr-x    4 root     root            90 Feb 15 15:34 ..2982_15_02_15_34_02.798668133
 0 lrwxrwxrwx    1 root     root            31 Feb 15 15:34 ..data -> ..2982_15_02_15_34_02.798668133
 4 drwxr-xr-x    2 root     root          4096 Feb 15 14:45 apps.d
 4 drwxr-xr-x    2 root     root          4096 Feb 15 14:45 conf.d
 0 lrwxrwxrwx    1 root     root            21 Feb 15 14:45 fastcgi-params -> ..data/fastcgi-params
 0 lrwxrwxrwx    1 root     root            20 Feb 15 14:45 frontend.conf -> ..data/frontend.conf
 0 lrwxrwxrwx    1 root     root            17 Feb 15 14:45 nginx.conf -> ..data/nginx.conf
 0 drwxrwxrwt    3 root     root           120 Feb 15 14:45 ssl

YAML looks like this:

volumeMounts:
[..]  
- name: default-nginx-config
  mountPath: /etc/nginx
- name: default-nginx-slash-srv
  mountPath: /srv

volumes:
[..]
- name: default-nginx-config
  configMap:
    name: web-frontend-default
    items:
    - key: fastcgi-params
      path: fastcgi-params
    - key: frontend.conf
      path: frontend.conf
    - key: nginx.conf
      path: nginx.conf
    - key: internal.conf
      path: conf.d/internal.conf
    - key: common-static-app.conf
      path: conf.d/common-static-app.conf
    - key: common-backends.conf
      path: conf.d/common-backends.conf
    - key: common-dynamic-app.conf
      path: conf.d/common-dynamic-app.conf
    - key: 00-generic.conf
      path: apps.d/00-generic.conf
    - key: default.conf
      path: apps.d/default.conf
- name: default-nginx-slash-srv
  configMap:
    name: web-frontend-default
    items:
    - key: probe.html
      path: probe.html

Any hint will be, of course, much appreciated :-)

Thank you

-- dynek
kubernetes

1 Answer

2/16/2017

Well fixed :-)
Problem was two volumes mounted in the same target directory. k8s doesn't seem to like it.

Thank you Eric!

-- dynek
Source: StackOverflow