summaryrefslogtreecommitdiffstats
path: root/kubernetes/so/components/so-mariadb
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/so/components/so-mariadb')
-rwxr-xr-xkubernetes/so/components/so-mariadb/requirements.yaml3
-rw-r--r--kubernetes/so/components/so-mariadb/templates/job.yaml28
-rwxr-xr-xkubernetes/so/components/so-mariadb/values.yaml7
3 files changed, 13 insertions, 25 deletions
diff --git a/kubernetes/so/components/so-mariadb/requirements.yaml b/kubernetes/so/components/so-mariadb/requirements.yaml
index 2eb32d00ed..22d6333253 100755
--- a/kubernetes/so/components/so-mariadb/requirements.yaml
+++ b/kubernetes/so/components/so-mariadb/requirements.yaml
@@ -18,3 +18,6 @@ dependencies:
# a part of this chart's package and will not
# be published independently to a repo (at this point)
repository: '@local'
+ - name: readinessCheck
+ version: ~6.x-0
+ repository: '@local'
diff --git a/kubernetes/so/components/so-mariadb/templates/job.yaml b/kubernetes/so/components/so-mariadb/templates/job.yaml
index 36481d461f..b3bacc1ed4 100644
--- a/kubernetes/so/components/so-mariadb/templates/job.yaml
+++ b/kubernetes/so/components/so-mariadb/templates/job.yaml
@@ -95,23 +95,9 @@ spec:
release: {{ include "common.release" . }}
name: {{ include "common.name" . }}
spec:
- initContainers:
- - name: {{ include "common.name" . }}-readiness
- command:
- - /app/ready.py
- args:
- - --container-name
- - {{ .Values.global.mariadbGalera.nameOverride }}
- env:
- - name: NAMESPACE
- valueFrom:
- fieldRef:
- apiVersion: v1
- fieldPath: metadata.namespace
- image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
- imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+ initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
containers:
- - name: {{ include "common.name" . }}
+ - name: {{ include "common.name" . }}-config
image: "{{ include "common.repository" . }}/{{ .Values.image }}"
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
command:
@@ -127,15 +113,9 @@ spec:
{{- end }}
env:
- name: DB_HOST
- valueFrom:
- secretKeyRef:
- name: {{ include "common.release" . }}-so-db-secrets
- key: mariadb.readwrite.host
+ value: {{ include "common.mariadbService" . }}
- name: DB_PORT
- valueFrom:
- secretKeyRef:
- name: {{ include "common.release" . }}-so-db-secrets
- key: mariadb.readwrite.port
+ value: {{ include "common.mariadbPort" . | quote }}
- name: MYSQL_ROOT_PASSWORD
{{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-pass" "key" "password") | indent 10 }}
- name: DB_USER
diff --git a/kubernetes/so/components/so-mariadb/values.yaml b/kubernetes/so/components/so-mariadb/values.yaml
index 9ecf3b0ca6..809dff77a7 100755
--- a/kubernetes/so/components/so-mariadb/values.yaml
+++ b/kubernetes/so/components/so-mariadb/values.yaml
@@ -24,7 +24,7 @@ global:
readinessImage: onap/oom/readiness:3.0.1
ubuntuInitRepository: registry.hub.docker.com
mariadbGalera:
- nameOverride: mariadb-galera
+ nameOverride: &mariadbName mariadb-galera
serviceName: mariadb-galera
servicePort: "3306"
migration:
@@ -33,6 +33,11 @@ global:
dbPort: 3306
dbUser: root
dbPassword: secretpassword
+
+readinessCheck:
+ wait_for:
+ - *mariadbName
+
#################################################################
# Secrets metaconfig
#################################################################