I am working on a use case where sidecar container runs a shell script continuously on changes directory permission of main container. I want to Start side container only after Main Container in pod is ready .
I was looking at Init Containers and what I could see is init containers are good candidate when we have inter-pod dependency (pod A starts only after Pod B has started/healthy).
In my case I need container B to start only after Container A is started in the same Pod.
Deployment.yaml for refrence
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
- name: container2
image: some-repo
imagePullPolicy: {{ .Values.image.pullPolicy }}