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. |
Krzysztof Gajewski | cd2e66f | 2020-10-15 20:33:34 +0200 | [diff] [blame] | 4 | # Modifications Copyright © 2020 Nokia |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 5 | # ================================================================================ |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ============LICENSE_END========================================================= |
| 20 | # @author: gareth.roper@ericsson.com |
Jakub Latusek | 44f0fdd | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 21 | */}} |
Grzegorz-Lis | d1c1f6a | 2020-07-29 12:22:40 +0200 | [diff] [blame] | 22 | apiVersion: apps/v1 |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 23 | kind: Deployment |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame^] | 24 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 25 | spec: |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame^] | 26 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 27 | replicas: {{ .Values.replicaCount }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 28 | minReadySeconds: {{ index .Values.minReadySeconds }} |
| 29 | strategy: |
| 30 | type: {{ index .Values.updateStrategy.type }} |
| 31 | rollingUpdate: |
| 32 | maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }} |
| 33 | maxSurge: {{ index .Values.updateStrategy.maxSurge }} |
| 34 | template: |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame^] | 35 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 36 | spec: |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame^] | 37 | initContainers: |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 38 | - name: so-chown |
Sylvain Desbureaux | 747982c | 2020-11-19 17:40:05 +0100 | [diff] [blame] | 39 | image: {{ include "repositoryGenerator.image.busybox" . }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 40 | volumeMounts: |
| 41 | - name: logs |
| 42 | mountPath: /app/logs |
jmac | c4f04d3 | 2018-10-12 18:24:24 +0000 | [diff] [blame] | 43 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 44 | command: ["/bin/sh", "-c", "chown -Rf 1000:1000 /app/logs"] |
| 45 | restartPolicy: Always |
| 46 | containers: |
| 47 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 747982c | 2020-11-19 17:40:05 +0100 | [diff] [blame] | 48 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 49 | resources: {{ include "common.resources" . | nindent 10 }} |
Krzysztof Gajewski | cd2e66f | 2020-10-15 20:33:34 +0200 | [diff] [blame] | 50 | command: |
| 51 | - /bin/sh |
| 52 | args: |
| 53 | - -c |
| 54 | - | |
Sylvain Desbureaux | 1eff56b | 2021-02-25 14:13:01 +0100 | [diff] [blame] | 55 | export SO_COCKPIT_PASSWORD=`htpasswd -bnBC 10 "" $SO_COCKPIT_PASS | tr -d ':\n' | sed 's/\$2y/\$2a/'` |
Krzysztof Gajewski | cd2e66f | 2020-10-15 20:33:34 +0200 | [diff] [blame] | 56 | /app/start-app.sh |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 57 | env: |
| 58 | - name: DB_HOST |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 59 | value: {{ include "common.mariadbService" . }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 60 | - name: DB_PORT |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 61 | value: {{ include "common.mariadbPort" . | quote }} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 62 | - name: DB_USERNAME |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 63 | {{- 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] | 64 | - name: DB_PASSWORD |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 65 | {{- 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] | 66 | - name: DB_ADMIN_USERNAME |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 67 | {{- 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] | 68 | - name: DB_ADMIN_PASSWORD |
Krzysztof Opasiak | 0be83cb | 2020-03-24 21:44:00 +0100 | [diff] [blame] | 69 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 10 }} |
Sylvain Desbureaux | 1eff56b | 2021-02-25 14:13:01 +0100 | [diff] [blame] | 70 | - name: SO_COCKPIT_USERNAME |
Krzysztof Gajewski | cd2e66f | 2020-10-15 20:33:34 +0200 | [diff] [blame] | 71 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "login") | indent 10 }} |
Sylvain Desbureaux | 1eff56b | 2021-02-25 14:13:01 +0100 | [diff] [blame] | 72 | - name: SO_COCKPIT_PASS |
Krzysztof Gajewski | cd2e66f | 2020-10-15 20:33:34 +0200 | [diff] [blame] | 73 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "password") | indent 10 }} |
| 74 | |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 75 | envFrom: |
| 76 | - configMapRef: |
Sylvain Desbureaux | 1eff56b | 2021-02-25 14:13:01 +0100 | [diff] [blame] | 77 | name: {{ include "common.fullname" . }} |
jmac | c4f04d3 | 2018-10-12 18:24:24 +0000 | [diff] [blame] | 78 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame^] | 79 | volumeMounts: |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 80 | - name: logs |
| 81 | mountPath: /app/logs |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 82 | - name: config |
| 83 | mountPath: /app/config |
| 84 | readOnly: true |
| 85 | readinessProbe: |
| 86 | tcpSocket: |
| 87 | port: {{ index .Values.readinessProbe.port }} |
| 88 | initialDelaySeconds: {{ index .Values.readinessProbe.initialDelaySeconds}} |
| 89 | periodSeconds: {{ index .Values.readinessProbe.periodSeconds}} |
| 90 | livenessProbe: |
| 91 | tcpSocket: |
| 92 | port: {{ index .Values.livenessProbe.port }} |
| 93 | initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}} |
| 94 | periodSeconds: {{ index .Values.livenessProbe.periodSeconds}} |
| 95 | successThreshold: {{ index .Values.livenessProbe.successThreshold}} |
| 96 | failureThreshold: {{ index .Values.livenessProbe.failureThreshold}} |
| 97 | |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame^] | 98 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
farida azmy | 87f4622 | 2021-04-06 15:25:15 +0200 | [diff] [blame] | 99 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame^] | 100 | volumes: |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 101 | - name: logs |
| 102 | emptyDir: {} |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 103 | - name: config |
| 104 | configMap: |
Sylvain Desbureaux | 1eff56b | 2021-02-25 14:13:01 +0100 | [diff] [blame] | 105 | name: {{ include "common.fullname" . }}-app |
rope252 | cd2142c | 2018-09-17 12:35:36 +0100 | [diff] [blame] | 106 | imagePullSecrets: |
| 107 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |