k8tz icon indicating copy to clipboard operation
k8tz copied to clipboard

Getting 2 volume mount inside POD with same name "k8tz"

Open hari14singh opened this issue 2 years ago • 3 comments

volumeMounts: - mountPath: /etc/localtime name: k8tz readOnly: true subPath: Asia/Kolkata - mountPath: /usr/share/zoneinfo name: k8tz readOnly: true

volumes:

  • hostPath: path: /usr/share/zoneinfo type: "" name: k8tz

Getting 2 volume mount inside POD with same name "k8tz" . This is causing problem. Second 1 is not needed.

test.txt

hari14singh avatar Sep 07 '23 11:09 hari14singh

Hi @hari14singh, can you show me the deployment and/or the full pod yaml? I need more information to reproduce the problem

yonatankahana avatar Sep 07 '23 14:09 yonatankahana

Same here with current k8tz 0.15.0 Sample pod (trimmed):

apiVersion: v1
kind: Pod
metadata:
  annotations:
    k8tz.io/injected: "true"
    k8tz.io/timezone: Europe/Berlin
  name: test-nginx-5988dbd68f-s9mqc
  namespace: test
spec:
  containers:
  - env:
    - name: TZ
      value: Europe/Berlin
    image: nginx:1.25.2
    name: nginx
    volumeMounts:
    - mountPath: /etc/localtime
      name: k8tz
      readOnly: true
      subPath: Europe/Berlin
    - mountPath: /usr/share/zoneinfo
      name: k8tz
      readOnly: true
  volumes:
  - hostPath:
      path: /usr/share/zoneinfo
      type: ""
    name: k8tz

brightdroid avatar Jan 08 '24 17:01 brightdroid

To clarify the issue, the mounted /etc/localtime is not a symlink to /usr/share/zoneinfo/Europe/Berlin

# realpath /etc/localtime 
/usr/share/zoneinfo/Etc/UTC

brightdroid avatar Jan 10 '24 13:01 brightdroid

I will need to see the applied pod and or deployment that creates it. It seems like you are using pods that was already injected but not annotated.

If it happen to someone, please open new issue and also provide logs from the admission controller with verbose: true (helm ... --set verbose=true).

yonatankahana avatar Jun 13 '24 16:06 yonatankahana