Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add initcontainer for checking mysql #93

Merged
merged 5 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions diracx/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ spec:
{{- end }}
{{- end }}

initContainers:
chaen marked this conversation as resolved.
Show resolved Hide resolved
{{- if .Values.mysql.enabled }}
- name: wait-for-mysql
image: busybox:latest
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until nc -vz {{ .Release.Name }}-mysql 3306; do echo "Waiting for mysql..."; sleep 3; done;']
{{ end }}
{{- if .Values.opensearch.enabled }}
- name: wait-for-opensearch
image: busybox:latest
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until nc -vz opensearch-cluster-master 9200; do echo "Waiting for opensearch..."; sleep 3; done;']
{{ end }}
{{- if .Values.minio.enabled }}
- name: wait-for-minio
image: busybox:latest
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until echo -e "HEAD /minio/health/live HTTP/1.1\nHost: {{ .Release.Name }}-minio\nConnection: close\n" | nc {{ .Release.Name }}-minio:9000 | grep "HTTP/1.1 200 OK"; do echo "Waiting for minio..."; sleep 3; done;']
{{ end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down
7 changes: 7 additions & 0 deletions diracx/templates/init-os/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ spec:
{{- end }}
spec:
restartPolicy: Never
{{- if .Values.opensearch.enabled }}
initContainers:
- name: wait-for-opensearch
image: busybox:latest
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until nc -vz opensearch-cluster-master 9200; do echo "Waiting for opensearch..."; sleep 3; done;']
{{ end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.global.images.services }}:{{ .Values.global.images.tag | default .Chart.AppVersion }}"
Expand Down
7 changes: 7 additions & 0 deletions diracx/templates/init-sql/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ spec:
{{- end }}
spec:
restartPolicy: Never
{{- if .Values.mysql.enabled }}
initContainers:
- name: wait-for-mysql
image: busybox:latest
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until nc -vz {{ .Release.Name }}-mysql 3306; do echo "Waiting for mysql..."; sleep 3; done;']
{{ end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.global.images.services }}:{{ .Values.global.images.tag | default .Chart.AppVersion }}"
Expand Down