diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2019-11-14 09:28:12 +0100 |
---|---|---|
committer | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2019-11-18 17:04:02 +0100 |
commit | 6383c4401160839e206b62f7cdba85f1c08cf7e2 (patch) | |
tree | bef1ab1995765a42f637d18c4e2ae5442de6d4e5 /kubernetes/vid/templates | |
parent | 0b844c9a74e29e2046c96f4635c429eb4dc8d677 (diff) |
[VID] Use mariadb galera common chart
Instead of using "own" galera chart, reuse chart placed in common part
of OOM installation.
Will ease move to common galera cluster (which is not done by this
commit).
Change-Id: I843c89ed4899055e9502268089d0e01f28fe37ae
Issue-ID: VID-704
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Diffstat (limited to 'kubernetes/vid/templates')
-rw-r--r-- | kubernetes/vid/templates/deployment.yaml | 14 | ||||
-rw-r--r-- | kubernetes/vid/templates/job.yaml | 17 | ||||
-rw-r--r-- | kubernetes/vid/templates/secrets.yaml | 15 |
3 files changed, 31 insertions, 15 deletions
diff --git a/kubernetes/vid/templates/deployment.yaml b/kubernetes/vid/templates/deployment.yaml index 9221af7dcf..2c6c5facdc 100644 --- a/kubernetes/vid/templates/deployment.yaml +++ b/kubernetes/vid/templates/deployment.yaml @@ -101,15 +101,18 @@ spec: - name: VID_UEB_URL_LIST value: message-router.{{ include "common.namespace" . }} - name: VID_MYSQL_HOST - value: "{{ .Values.config.vidmysqlhost }}" + value: {{ index .Values "mariadb-galera" "service" "name" }} - name: VID_MYSQL_PORT - value: "{{ .Values.config.vidmysqlport }}" + value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}" - name: VID_MYSQL_DBNAME - value: "{{ .Values.config.vidmysqldbname }}" + value: {{ index .Values "mariadb-galera" "config" "mysqlDatabase" }} - name: VID_MYSQL_USER - value: "{{ .Values.config.vidmysqluser }}" + value: {{ index .Values "mariadb-galera" "config" "userName" }} - name: VID_MYSQL_PASS - value: "{{ .Values.config.vidmysqlpassword }}" + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-db + key: db-user-password #valueFrom: # secretKeyRef: {name: {{ include "common.fullname" . }}, key: vid-password} - name: VID_MYSQL_MAXCONNECTIONS @@ -166,4 +169,3 @@ spec: name: {{ include "common.fullname" . }}-log-configmap imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" - diff --git a/kubernetes/vid/templates/job.yaml b/kubernetes/vid/templates/job.yaml index 5214e71130..c2a1858d0c 100644 --- a/kubernetes/vid/templates/job.yaml +++ b/kubernetes/vid/templates/job.yaml @@ -34,11 +34,8 @@ spec: imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} command: - /root/ready.py -{{- $fullname := include "common.fullname" . -}} -{{- range $i,$t := until (int .Values.vid_mariadb_galera.replicaCount)}} - --container-name - - {{ $fullname }}-mariadb-galera-{{$i}} -{{- end }} + - {{ index .Values "mariadb-galera" "service" "name" }} env: - name: NAMESPACE valueFrom: @@ -63,13 +60,16 @@ spec: - /dbcmd-config/db_cmd.sh env: - name: MYSQL_PASSWORD - value: "{{ .Values.config.vidmysqlpassword }}" + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-db + key: db-user-password - name: MYSQL_HOST - value: "{{ .Values.config.vidmysqlhost }}" + value: {{ index .Values "mariadb-galera" "service" "name" }} - name: MYSQL_USER - value: "{{ .Values.config.vidmysqluser }}" + value: {{ index .Values "mariadb-galera" "config" "userName" }} - name: MYSQL_PORT - value: "{{ .Values.config.vidmysqlport }}" + value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}" restartPolicy: Never volumes: - name: {{ include "common.fullname" . }}-config @@ -80,4 +80,3 @@ spec: path: db_cmd.sh - key: vid-pre-init.sql path: vid-pre-init.sql - diff --git a/kubernetes/vid/templates/secrets.yaml b/kubernetes/vid/templates/secrets.yaml index 222a3d582a..e0c1992d93 100644 --- a/kubernetes/vid/templates/secrets.yaml +++ b/kubernetes/vid/templates/secrets.yaml @@ -39,3 +39,18 @@ metadata: type: Opaque data: {{ tpl (.Files.Glob "resources/certs/*").AsSecrets . | indent 2 }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }}-db + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + db-user-password: {{ index .Values "mariadb-galera" "config" "userPassword" | b64enc | quote }} + db-root-password: {{ index .Values "mariadb-galera" "config" "mariadbRootPassword" | b64enc | quote }} |