Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volumeMounts not found with helm deployment. #101

Open
zalseryani opened this issue Apr 22, 2024 · 0 comments
Open

volumeMounts not found with helm deployment. #101

zalseryani opened this issue Apr 22, 2024 · 0 comments

Comments

@zalseryani
Copy link

zalseryani commented Apr 22, 2024

Deployment Steps

helm upgrade --install k8tz k8tz/k8tz \
    --set timezone="Asia/Amman" \
    --set verbose="false" \
    --set injectionStrategy="initContainer" \
    --set injectedInitContainerName="init-k8tz" \
    --set labels.TimeZone="k8tz-managed" \
    --set injectAll="false" \
    --set createNamespace="false" \
    --namespace k8tz

Creating Pod

apiVersion: v1
kind: Pod
metadata:
  annotations: 
    k8tz.io/inject: "true"
    k8tz.io/timezone: "Asia/Amman"
    k8tz.io/strategy: "initContainer"
  labels:
    run: ubuntu-test
  name: ubuntu-test
  namespace: test-namespace
spec:
  containers:
  - image: ubuntu:latest
    name: ubuntu-test
    command: 
    - /bin/bash
    - -c
    - sleep infinity
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}
  • When applying this yaml file using kubectl, I get the following error
The Pod "ubuntu-test" is invalid: 
* spec.containers[0].volumeMounts[1].name: Not found: "k8tz"
* spec.containers[0].volumeMounts[2].name: Not found: "k8tz"
* spec.initContainers[0].volumeMounts[0].name: Not found: "k8tz"
  • Log of k8tz pod
INFO: 2024/04/23 09:59:04 admission.go:221: explicit timezone requested on pod's (namespace=test-namespace, name=ubuntu-test) annotation: Asia/Amman
INFO: 2024/04/23 09:59:04 admission.go:230: explicit injection strategy requested on pod's (namespace=test-namespace, name=ubuntu-test) annotation: initContainer
INFO: 2024/04/23 09:59:04 admission.go:313: 9 patches generated for pod (namespace=test-namespace, name=ubuntu-test), timezone=Asia/Amman, strategy=initContainer
  • Kindly any suggestions ?

  • I tested the cli on the same pod yaml file and tried to apply it on the cluster, it worked fine, but I am not sure if the admission controller is injecting the mutation correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant