Answer the question
In order to leave comments, you need to log in
How to correctly run the script through the chart Job?
You need to create a resource when the service starts. The script does everything necessary (collects data and creates the necessary yaml file in the cluster)
I need the job to run this script, I try to insert it into command and args - I get errors. In the first case "/bin/sh": stat no such file or directory,
In the second case: problems converting yaml to json: or did not find expected key, or did not find expected '-' indicator.
What could be the problem? What did I spell wrong? Completely stuck.
apiVersion: batch/v1
kind: Job
.....
1.
containers:
- name: create-webhook-configuration
image: {{ .Values.image.repository }}{{ .Values.image.name }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- /bin/sh
- -c
- >
{{ .Files.Get "scripts/run.sh" }}
restartPolicy: OnFailure
containers:
- name: create-webhook-configuration
image: {{ .Values.image.repository }}{{ .Values.image.name }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh", "-c", {{ .Files.Get "scripts/run.sh" }}]
restartPolicy: OnFailure
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question