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