Reputation: 31
I have something like this
args: ["-c", "while [ $(curl -sw '%{http_code}' "http://{{ include "backend.name" . }}-{{ .Release.Namespace }}:80/actuator/health"-o /dev/null) -ne 200 ]; do sleep 30; done"
Should it run correctly? Or is there any chance I can check it without deploying it?
Upvotes: 0
Views: 580
Reputation: 2527
There are two options you can use.
As follows:
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: "test"
spec:
template:
spec:
containers:
- name: "test"
image: "test:v1.0"
{{- if .Values.args }}
args:
{{ toYaml .Values.args | nindent 12 }}
{{- end }}
values.yaml
args:
- -c
- while [ $(curl -sw 'http://xx.xx.xx.xx' "http://xx.xx.xx.xx:80/actuator/health"-o /dev/null) -ne 200 ]; do sleep 30; done
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: "test"
spec:
template:
spec:
containers:
- name: "test"
image: "test:v1.0"
{{- if .Values.args }}
args:
- {{ .Values.args.lv }}
- while [ $(curl -sw '{{ .Values.args.code }}' "http://{{ include "backend.name" . }}-{{ .Release.Namespace }}:80/actuator/health"-o /dev/null) -ne 200 ]; do sleep 30; done
{{- end }}
values.yaml
args:
lv: -c
code: http://0.0.0.0
Upvotes: 1