Merge "clamphealth check"
[oom.git] / kubernetes / so / charts / mariadb / templates / deployment.yaml
index 3e263ce..c85fe79 100644 (file)
@@ -31,102 +31,80 @@ spec:
         release: {{ .Release.Name }}
     spec:
       hostname: mariadb
+      initContainers:
+      - name: {{ include "common.name" . }}-inject-testlab-project
+        command:
+        - /bin/bash
+        - -c
+        - >
+          git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
+          echo "Clone complete. Copying from /tmp/gerrit/volumes/mariadb/docker-entrypoint-initdb.d to /docker-entrypoint-initdb.d";
+          cp -rf /tmp/gerrit/volumes/mariadb/docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d;
+          echo "Done.";
+        image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        volumeMounts:
+        - name: docker-entrypoint-initdb-d
+          mountPath: "/docker-entrypoint-initdb.d"
       containers:
-        - name: {{ include "common.name" . }}
-          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          ports:
-          - containerPort: {{ .Values.service.internalPort }}
-          # disable liveness probe when breakpoints set in debugger
-          # so K8s doesn't restart unresponsive container
-          {{- if eq .Values.liveness.enabled true }}
-          livenessProbe:
-            tcpSocket:
-              port: {{ .Values.service.internalPort }}
-            initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
-            periodSeconds: {{ .Values.liveness.periodSeconds }}
-          {{end -}}
-          readinessProbe:
-            tcpSocket:
-              port: {{ .Values.service.internalPort }}
-            initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
-            periodSeconds: {{ .Values.readiness.periodSeconds }}
-          env:
-            - name: MYSQL_ROOT_PASSWORD
-              valueFrom:
-                secretKeyRef:
-                  name: {{ template "common.fullname" . }}
-                  key: db-root-password
-          volumeMounts:
-          - mountPath: /var/lib/mysql
-            name: mariadb-data
-          - mountPath: /etc/localtime
-            name: localtime
-            readOnly: true
-          - mountPath: /etc/mysql/conf.d
-            name: mariadb-conf
-          - mountPath: /docker-entrypoint-initdb.d/02-load-additional-changes.sh
-            name: mariadb-docker-entrypoint-initdb
-            subPath: 02-load-additional-changes.sh
-          - mountPath: /docker-entrypoint-initdb.d/01-load-default-sql-files.sh
-            name: mariadb-docker-entrypoint-initdb
-            subPath: 01-load-default-sql-files.sh
-          - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/automated-tests
-            name: mariadb-docker-entrypoint-automated-tests
-          - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default
-            name: mariadb-docker-entrypoint-bulkload-default
-          - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-dns
-            name: mariadb-docker-entrypoint-demo-dns
-          - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-vfw
-            name: mariadb-docker-entrypoint-demo-vfw
-          - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/camunda
-            name: mariadb-docker-entrypoint-camunda
-          - mountPath: /docker-entrypoint-initdb.d/db-sql-scripts/main-schemas
-            name: mariadb-docker-entrypoint-main-schemas
-          resources:
+      - name: {{ include "common.name" . }}
+        image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        ports:
+        - containerPort: {{ .Values.service.internalPort }}
+        {{ if eq .Values.liveness.enabled true }}
+        livenessProbe:
+          tcpSocket:
+            port: {{ .Values.service.internalPort }}
+          initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
+          periodSeconds: {{ .Values.liveness.periodSeconds }}
+        {{ end }}
+        readinessProbe:
+          tcpSocket:
+            port: {{ .Values.service.internalPort }}
+          initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
+          periodSeconds: {{ .Values.readiness.periodSeconds }}
+        env:
+          - name: MYSQL_ROOT_PASSWORD
+            valueFrom:
+              secretKeyRef:
+                name: {{ template "common.fullname" . }}
+                key: db-root-password
+        volumeMounts:
+        - mountPath: /var/lib/mysql
+          name: mariadb-data
+        - mountPath: /etc/localtime
+          name: localtime
+          readOnly: true
+        - mountPath: /etc/mysql/conf.d
+          name: mariadb-conf
+        - name: docker-entrypoint-initdb-d
+          mountPath: "/docker-entrypoint-initdb.d"
+        resources:
 {{ toYaml .Values.resources | indent 12 }}
-        {{- if .Values.nodeSelector }}
-        nodeSelector:
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-        affinity:
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
 {{ toYaml .Values.affinity | indent 10 }}
-        {{- end }}
+      {{- end }}
       volumes:
+      - name: mariadb-data
       {{- if .Values.persistence.enabled }}
-        - name: mariadb-data
-          persistentVolumeClaim:
-            claimName: {{ include "common.fullname" . }}
+        persistentVolumeClaim:
+          claimName: {{ include "common.fullname" . }}
       {{- else }}
-          emptyDir: {}
+        emptyDir: {}
       {{- end }}
-        - name: mariadb-conf
-          configMap:
-            name: confd-configmap
-        - name: mariadb-docker-entrypoint-initdb
-          configMap:
-            name: docker-entry-initd-configmap
-        - name: mariadb-docker-entrypoint-automated-tests
-          configMap:
-            name: automated-tests-configmap
-        - name: mariadb-docker-entrypoint-bulkload-default
-          configMap:
-            name: bulkload-default-configmap
-        - name: mariadb-docker-entrypoint-demo-dns
-          configMap:
-            name: demo-dns-configmap
-        - name: mariadb-docker-entrypoint-demo-vfw
-          configMap:
-            name: demo-vfw-configmap
-        - name: mariadb-docker-entrypoint-camunda
-          configMap:
-            name: scripts-camunda-configmap
-        - name: mariadb-docker-entrypoint-main-schemas
-          configMap:
-            name: main-schemas-configmap
-        - name: localtime
-          hostPath:
-            path: /etc/localtime
+      - name: mariadb-conf
+        configMap:
+          name: confd-configmap
+      - name: localtime
+        hostPath:
+          path: /etc/localtime
+      - name: docker-entrypoint-initdb-d
+        emptyDir: {}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"