rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 1 | # ============LICENSE_START======================================================= |
| 2 | # Copyright (C) 2018 Ericsson. All rights reserved. |
| 3 | # ================================================================================ |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | # SPDX-License-Identifier: Apache-2.0 |
| 17 | # ============LICENSE_END========================================================= |
| 18 | # @author: gareth.roper@ericsson.com |
| 19 | apiVersion: extensions/v1beta1 |
| 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: {{ include "common.fullname" . }} |
| 23 | namespace: {{ include "common.namespace" . }} |
| 24 | labels: |
| 25 | app: {{ include "common.fullname" . }} |
| 26 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 28 | spec: |
| 29 | replicas: {{ index .Values.replicaCount }} |
| 30 | minReadySeconds: {{ index .Values.minReadySeconds }} |
| 31 | strategy: |
| 32 | type: {{ index .Values.updateStrategy.type }} |
| 33 | rollingUpdate: |
| 34 | maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }} |
| 35 | maxSurge: {{ index .Values.updateStrategy.maxSurge }} |
| 36 | template: |
| 37 | metadata: |
| 38 | labels: |
| 39 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 40 | release: {{ include "common.release" . }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 41 | spec: |
| 42 | initContainers: |
| 43 | - name: so-chown |
| 44 | image: alpine:3.6 |
| 45 | volumeMounts: |
| 46 | - name: logs |
| 47 | mountPath: /app/logs |
jmac | c4f04d3 | 2018-10-12 18:24:24 +0000 | [diff] [blame] | 48 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 49 | command: ["/bin/sh", "-c", "chown -Rf 1000:1000 /app/logs"] |
| 50 | restartPolicy: Always |
| 51 | containers: |
| 52 | - name: {{ include "common.name" . }} |
| 53 | image: {{ include "common.repository" . }}/{{ .Values.image }} |
| 54 | resources: |
| 55 | {{ include "common.resources" . | indent 12 }} |
| 56 | env: |
| 57 | - name: DB_HOST |
| 58 | valueFrom: |
| 59 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 60 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 61 | key: mariadb.readwrite.host |
| 62 | - name: DB_PORT |
| 63 | valueFrom: |
| 64 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 65 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 66 | key: mariadb.readwrite.port |
| 67 | - name: DB_USERNAME |
| 68 | valueFrom: |
| 69 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 70 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 71 | key: mariadb.readwrite.rolename |
| 72 | - name: DB_PASSWORD |
| 73 | valueFrom: |
Gareth Roper | 5726461 | 2018-10-10 16:46:42 +0100 | [diff] [blame] | 74 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 75 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 76 | key: mariadb.readwrite.password |
| 77 | - name: DB_ADMIN_USERNAME |
| 78 | valueFrom: |
| 79 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 80 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 81 | key: mariadb.admin.rolename |
| 82 | - name: DB_ADMIN_PASSWORD |
| 83 | valueFrom: |
| 84 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 85 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 86 | key: mariadb.admin.password |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 87 | envFrom: |
| 88 | - configMapRef: |
| 89 | name: {{ include "common.fullname" . }}-configmap |
jmac | c4f04d3 | 2018-10-12 18:24:24 +0000 | [diff] [blame] | 90 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 91 | volumeMounts: |
| 92 | - name: logs |
| 93 | mountPath: /app/logs |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 94 | - name: config |
| 95 | mountPath: /app/config |
| 96 | readOnly: true |
| 97 | readinessProbe: |
| 98 | tcpSocket: |
| 99 | port: {{ index .Values.readinessProbe.port }} |
| 100 | initialDelaySeconds: {{ index .Values.readinessProbe.initialDelaySeconds}} |
| 101 | periodSeconds: {{ index .Values.readinessProbe.periodSeconds}} |
| 102 | livenessProbe: |
| 103 | tcpSocket: |
| 104 | port: {{ index .Values.livenessProbe.port }} |
| 105 | initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}} |
| 106 | periodSeconds: {{ index .Values.livenessProbe.periodSeconds}} |
| 107 | successThreshold: {{ index .Values.livenessProbe.successThreshold}} |
| 108 | failureThreshold: {{ index .Values.livenessProbe.failureThreshold}} |
| 109 | |
| 110 | ports: |
| 111 | - containerPort: {{ index .Values.containerPort }} |
| 112 | name: {{ .Values.service.portName }} |
| 113 | protocol: TCP |
| 114 | volumes: |
| 115 | - name: logs |
| 116 | emptyDir: {} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 117 | - name: config |
| 118 | configMap: |
| 119 | name: {{ include "common.fullname" . }}-app-configmap |
| 120 | imagePullSecrets: |
| 121 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 122 | |
| 123 | |