[WIFI-10069] Add: helm - wait-postgres init container

Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
This commit is contained in:
Dmitry Dunaev
2022-09-02 14:51:37 +03:00
parent fb998bccc8
commit d83aa18659
4 changed files with 37 additions and 4 deletions

3
.gitignore vendored
View File

@@ -34,9 +34,6 @@
# Generated version info
src/ow_version.h
*.swp
helm/charts/*
!helm/charts/.gitkeep
test_scripts/curl/result.json
test_scripts/curl/token_sub.json
test_scripts/curl/token_sec.json

2
helm/.gitignore vendored
View File

@@ -1 +1,3 @@
*.swp
Chart.lock
charts/

View File

@@ -9,4 +9,4 @@ dependencies:
repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
version: 9.4.2
digest: sha256:e9df5a5d8a0a193bfda33ea06060203aace01f0f7df9eda662a84185322c7ab5
generated: "2022-06-03T19:37:46.744676383+03:00"
generated: "2022-09-02T14:47:01.533833207+03:00"

View File

@@ -1,4 +1,5 @@
{{- $root := . -}}
{{- $storageType := index .Values.configProperties "storage.type" -}}
---
apiVersion: apps/v1
kind: Deployment
@@ -46,6 +47,39 @@ spec:
- -timeout
- 600s
{{- if eq $storageType "postgresql" }}
- name: wait-postgres
image: "{{ .Values.images.owsub.repository }}:{{ .Values.images.owsub.tag }}"
imagePullPolicy: {{ .Values.images.owsub.pullPolicy }}
command:
- /wait-for-postgres.sh
- {{ index .Values.configProperties "storage.type.postgresql.host" }}
- echo
- "PostgreSQL is ready"
env:
- name: KUBERNETES_DEPLOYED
value: "{{ now }}"
{{- range $key, $value := .Values.public_env_variables }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- range $key, $value := .Values.secret_env_variables }}
- name: {{ $key }}
valueFrom:
secretKeyRef:
name: {{ include "owsub.fullname" $root }}-env
key: {{ $key }}
{{- end }}
volumeMounts:
{{- range .Values.volumes.owsub }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
containers:
- name: owsub