У меня в таблице Хелма есть хук перед обновлением, который выглядит следующим образом:
apiVersion: batch/v1
kind: Job
metadata:
name: "{{.Release.Name}}-preupgrade"
labels:
heritage: {{.Release.Service | quote }}
release: {{.Release.Name | quote }}
chart: "{{.Chart.Name}}-{{.Chart.Version}}"
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": hook-succeeded
spec:
template:
metadata:
name: "{{.Release.Name}}"
labels:
heritage: {{.Release.Service | quote }}
release: {{.Release.Name | quote }}
chart: "{{.Chart.Name}}-{{.Chart.Version}}"
spec:
restartPolicy: Never
securityContext:
# Because we are running as non root user and group id/User id of the flink user is 1000/1000.
fsGroup: {{ .Values.spec.securityContext.fsGroup }}
runAsNonRoot: {{ .Values.spec.securityContext.runAsNonRootFlag }}
runAsUser: {{ .Values.spec.securityContext.runAsUser }}
containers:
- name: pre-upgrade-job
image: {{ .Values.registry }}/{{ .Values.imageRepo }}:{{ .Values.imageTag }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
# Got error /bin/sleep: invalid time interval 'lcm_hook'
args:
- lcm_hook
env:
# Need to add this env variable so that the custom flink conf values will be written to $FLINK_HOME/conf.
# This is needed for the hook scripts to connect to the Flink JobManager
- name: FLINK_KUBE_CONFIGMAP_PATH
value: {{ .Values.spec.config.mountPath }}
volumeMounts:
- name: {{ template "fullname" . }}-flink-config
mountPath: {{ .Values.spec.config.mountPath }}
- mountPath: {{ .Values.pvc.shared_storage_path }}/{{ template "fullname" . }}
name: shared-pvc
command: ["/bin/sh", "-c", "scripts/preUpgradeScript.sh","{{ .Values.pvc.shared_storage_path }}/{{ template "fullname" . }}"]
command: ["/bin/sleep","10"]
volumes:
- name: {{ template "fullname" . }}-flink-config
configMap:
name: {{ template "fullname" . }}-flink-config
- name: shared-pvc
persistentVolumeClaim:
claimName: {{ template "fullname" . }}-shared-pv-claim
Здесь мне нужно передать аргумент под названием "lcm_hooks" в мой контейнер докеров. Но когда я делаю это, кажется, что этот аргумент переопределяет аргумент для моей второй команды ["/ bin / sleep", "10"], и я получаю ошибку
/ bin / sleep: недопустимый интервал времени 'lcm_hook'
на этапе обновления. Как правильно сделать так, чтобы я мог передать один аргумент моему контейнеру и совершенно другой - моей команде bash в хуке helm?