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 |
Grzegorz-Lis | d1c1f6a | 2020-07-29 12:22:40 +0200 | [diff] [blame] | 19 | apiVersion: apps/v1 |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 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: |
Grzegorz-Lis | d1c1f6a | 2020-07-29 12:22:40 +0200 | [diff] [blame] | 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 32 | replicas: {{ index .Values.replicaCount }} |
| 33 | minReadySeconds: {{ index .Values.minReadySeconds }} |
| 34 | strategy: |
| 35 | type: {{ index .Values.updateStrategy.type }} |
| 36 | rollingUpdate: |
| 37 | maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }} |
| 38 | maxSurge: {{ index .Values.updateStrategy.maxSurge }} |
| 39 | template: |
| 40 | metadata: |
| 41 | labels: |
| 42 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 43 | release: {{ include "common.release" . }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 44 | spec: |
Sylvain Desbureaux | aadf545 | 2020-03-18 18:13:51 +0100 | [diff] [blame] | 45 | initContainers: {{ include "so.certificate.container_importer" . | nindent 6 }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 46 | - name: so-chown |
| 47 | image: alpine:3.6 |
| 48 | volumeMounts: |
| 49 | - name: logs |
| 50 | mountPath: /app/logs |
jmac | c4f04d3 | 2018-10-12 18:24:24 +0000 | [diff] [blame] | 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 52 | command: ["/bin/sh", "-c", "chown -Rf 1000:1000 /app/logs"] |
| 53 | restartPolicy: Always |
| 54 | containers: |
| 55 | - name: {{ include "common.name" . }} |
| 56 | image: {{ include "common.repository" . }}/{{ .Values.image }} |
| 57 | resources: |
| 58 | {{ include "common.resources" . | indent 12 }} |
| 59 | env: |
| 60 | - name: DB_HOST |
| 61 | valueFrom: |
| 62 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 63 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 64 | key: mariadb.readwrite.host |
| 65 | - name: DB_PORT |
| 66 | valueFrom: |
| 67 | secretKeyRef: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 68 | name: {{ include "common.release" . }}-so-db-secrets |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 69 | key: mariadb.readwrite.port |
| 70 | - name: DB_USERNAME |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 71 | {{- 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] | 72 | - name: DB_PASSWORD |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 73 | {{- 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] | 74 | - name: DB_ADMIN_USERNAME |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 75 | {{- 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] | 76 | - name: DB_ADMIN_PASSWORD |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 77 | {{- 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] | 78 | envFrom: |
| 79 | - configMapRef: |
| 80 | name: {{ include "common.fullname" . }}-configmap |
jmac | c4f04d3 | 2018-10-12 18:24:24 +0000 | [diff] [blame] | 81 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | aadf545 | 2020-03-18 18:13:51 +0100 | [diff] [blame] | 82 | volumeMounts: {{ include "so.certificate.volume-mounts" . | nindent 8 }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 83 | - name: logs |
| 84 | mountPath: /app/logs |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 85 | - name: config |
| 86 | mountPath: /app/config |
| 87 | readOnly: true |
| 88 | readinessProbe: |
| 89 | tcpSocket: |
| 90 | port: {{ index .Values.readinessProbe.port }} |
| 91 | initialDelaySeconds: {{ index .Values.readinessProbe.initialDelaySeconds}} |
| 92 | periodSeconds: {{ index .Values.readinessProbe.periodSeconds}} |
| 93 | livenessProbe: |
| 94 | tcpSocket: |
| 95 | port: {{ index .Values.livenessProbe.port }} |
| 96 | initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}} |
| 97 | periodSeconds: {{ index .Values.livenessProbe.periodSeconds}} |
| 98 | successThreshold: {{ index .Values.livenessProbe.successThreshold}} |
| 99 | failureThreshold: {{ index .Values.livenessProbe.failureThreshold}} |
| 100 | |
| 101 | ports: |
| 102 | - containerPort: {{ index .Values.containerPort }} |
| 103 | name: {{ .Values.service.portName }} |
| 104 | protocol: TCP |
Sylvain Desbureaux | aadf545 | 2020-03-18 18:13:51 +0100 | [diff] [blame] | 105 | volumes: {{ include "so.certificate.volumes" . | nindent 6 }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 106 | - name: logs |
| 107 | emptyDir: {} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 108 | - name: config |
| 109 | configMap: |
| 110 | name: {{ include "common.fullname" . }}-app-configmap |
| 111 | imagePullSecrets: |
| 112 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |