[COMMON][MARIADB] Uses new tpls for repos / images 20/115120/4
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 19 Nov 2020 16:12:46 +0000 (17:12 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Sat, 21 Nov 2020 08:12:12 +0000 (08:12 +0000)
This commit makes mariadb galera template to use the new generator for
repositories and images.

As mariadb are coming from dockerhub, we're using directly this
repository.

Issue-ID: OOM-2364
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I7010ea3214c34fbee1ee697a127a1e43bfd16aed

kubernetes/common/mariadb-galera/requirements.yaml
kubernetes/common/mariadb-galera/resources/create-deployment.yml
kubernetes/common/mariadb-galera/templates/backup/cronjob.yaml
kubernetes/common/mariadb-galera/templates/job.yaml
kubernetes/common/mariadb-galera/templates/statefulset.yaml
kubernetes/common/mariadb-galera/values.yaml

index 4fbecbf..2509f7f 100644 (file)
@@ -15,4 +15,7 @@
 dependencies:
   - name: common
     version: ~6.x-0
-    repository: 'file://../common'
\ No newline at end of file
+    repository: 'file://../common'
+  - name: repositoryGenerator
+    version: ~6.x-0
+    repository: 'file://../repositoryGenerator'
\ No newline at end of file
index d81d640..0f6bb59 100644 (file)
@@ -13,7 +13,7 @@ spec:
     spec:
       containers:
       - name: {{ include "common.name" . }}
-        image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+        image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
         ports:
         - containerPort: {{ .Values.service.internalPort }}
           name: {{ .Values.service.portName }}
index bce0eb9..1c78017 100644 (file)
@@ -45,11 +45,11 @@ spec:
                 fieldRef:
                   apiVersion: v1
                   fieldPath: metadata.namespace
-            image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+            image: {{ include "repositoryGenerator.image.readiness" . }}
             imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
             name: {{ include "common.name" . }}-readiness
           - name: mariadb-galera-backup-init
-            image: "{{ include "common.repository" . }}/{{ .Values.backupImage }}"
+            image: {{ include "repositoryGenerator.image.mariadb" . }}
             imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
             command:
             - /bin/bash
@@ -94,7 +94,7 @@ spec:
               mountPath: /var/lib/mysql
           containers:
           - name: mariadb-backup-validate
-            image: "{{ include "common.repository" . }}/{{ .Values.backupImage }}"
+            image: {{ include "repositoryGenerator.image.mariadb" . }}
             imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
             env:
             - name: MYSQL_ROOT_PASSWORD
index 5dc822a..250279a 100644 (file)
@@ -14,7 +14,7 @@ spec:
         runAsUser: 1001
       containers:
       - name: mariadb-job-pre-upgrade
-        image: {{ .Values.global.kubectlImage}}
+        image: {{ include "repositoryGenerator.image.kubectl" . }}
         imagePullPolicy: IfNotPresent
         env:
           - name: NAMESPACE_ENV
@@ -49,7 +49,7 @@ spec:
         fsGroup: 1001
         runAsUser: 0
       initContainers:
-      - image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+      - image: {{ include "repositoryGenerator.image.readiness" . }}
         name: mariadb-galera-upgrade-readiness
         env:
         - name: NAMESPACE
@@ -64,7 +64,7 @@ spec:
         - mariadb-galera
       containers:
       - name: mariadb-job-post-upgrade
-        image: {{ .Values.global.kubectlImage}}
+        image: {{ include "repositoryGenerator.image.kubectl" . }}
         imagePullPolicy: IfNotPresent
         env:
         - name: NAMESPACE_ENV
@@ -99,7 +99,7 @@ spec:
     spec:
       containers:
       - name: mariadb-job-post-delete
-        image: {{ .Values.global.kubectlImage}}
+        image: {{ include "repositoryGenerator.image.kubectl" . }}
         imagePullPolicy: IfNotPresent
         command: ["/bin/bash", "-c", "--"]
         args:
index 47d1e0e..eb21fe3 100644 (file)
@@ -61,7 +61,7 @@ spec:
       - name: {{ include "common.namespace" . }}-docker-registry-key
       containers:
         - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
           env:
             - name: POD_NAMESPACE
@@ -119,7 +119,7 @@ spec:
             name: {{ include "common.fullname" . }}-data
       initContainers:
         - name: {{ include "common.name" . }}-prepare
-          image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
+          image: {{ include "repositoryGenerator.image.busybox" . }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
           command: ["sh", "-c", "chown -R 27:27 /var/lib/mysql"]
           volumeMounts:
index 55606ea..6b1676f 100644 (file)
@@ -38,23 +38,12 @@ global:
     backup:
       mountPath: /dockerdata-nfs/backup
 
-  repository: nexus3.onap.org:10001
-
-  readinessImage: onap/oom/readiness:3.0.1
-  busyboxImage: busybox:1.30
-  busyboxRepository: docker.io
-  # kubeclt image
-  kubectlImage: "bitnami/kubectl:1.15"
-
 #################################################################
 # Application configuration defaults.
 #################################################################
 
 #repository: mysql
-repository: nexus3.onap.org:10001
 image: adfinissygroup/k8s-mariadb-galera-centos:v002
-backupImage: library/mariadb:10.1.38
-imageInit: busybox
 pullPolicy: IfNotPresent
 
 # application configuration