I have kubernetes deployment with init container which triggers a job through configmap mounted to it. However I have added a condition to start the init container.
initContainers:
{{ if .Values.global.test.enabled }}
- name: wait-db
image: "x"
command:
- /bin/sh
- -c
- /test.sh -n test -p /test.yaml
volumeMounts:
- mountPath: /test.yaml
name: test-configmap
subPath: test.yaml
{{ else }}
- name: wait-db-x
image: "x"
command:
- /bin/sh
- -c
- /test.sh -n test-x -p /testx.yaml
volumeMounts:
- mountPath: /testx.yaml
name: testx-configmap
subPath: testx.yaml
{{ end }}
I see that when I set global.test.enabled
to true in values file, it also triggers test-x
job though the init container wait-db-x
is not executed. When I describe the deployment, I see only one init container exists wait-db
. What am I missing?
Also, I see that this is not the issue on new install, this happens only during helm upgrade
Tried deleting the jobs before upgrade
Addy_tech is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.