Jakub Latusek | 44f0fdd | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 2 | # Copyright © 2020 Nordix Foundation |
| 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. |
Jakub Latusek | 44f0fdd | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 16 | |
| 17 | apiVersion: apps/v1 |
| 18 | kind: Deployment |
| 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 20 | spec: |
| 21 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 22 | replicas: {{ index .Values.replicaCount }} |
| 23 | minReadySeconds: {{ index .Values.minReadySeconds }} |
| 24 | strategy: |
| 25 | type: {{ index .Values.updateStrategy.type }} |
| 26 | rollingUpdate: |
| 27 | maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }} |
| 28 | maxSurge: {{ index .Values.updateStrategy.maxSurge }} |
| 29 | template: |
| 30 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 31 | spec: |
Andreas Geissler | 2c1ba29 | 2024-01-10 22:20:05 +0100 | [diff] [blame] | 32 | initContainers: |
| 33 | {{ include "common.readinessCheck.waitFor" . | indent 8 | trim }} |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 34 | containers: |
| 35 | - name: {{ include "common.name" . }} |
| 36 | command: |
| 37 | - sh |
| 38 | args: |
| 39 | - -c |
| 40 | - | |
| 41 | export ETSI_NFVO_PASSWORD=`htpasswd -bnBC 10 "" $ETSI_NFVO_PASSWORD_INPUT | tr -d ':\n' | sed 's/\$2y/\$2a/'` |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 42 | ./start-app.sh |
Sylvain Desbureaux | 747982c | 2020-11-19 17:40:05 +0100 | [diff] [blame] | 43 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 44 | resources: {{ include "common.resources" . | nindent 12 }} |
| 45 | env: |
| 46 | - name: ETSI_NFVO_USERNAME |
| 47 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "login") | indent 14 }} |
| 48 | - name: ETSI_NFVO_PASSWORD_INPUT |
| 49 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "etsi-nfvo-nslcm-creds" "key" "password") | indent 14 }} |
rope252 | 4d3f368 | 2020-09-02 20:49:21 +0100 | [diff] [blame] | 50 | - name: DB_HOST |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 51 | value: {{ include "common.mariadbService" . }} |
rope252 | 4d3f368 | 2020-09-02 20:49:21 +0100 | [diff] [blame] | 52 | - name: DB_PORT |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 53 | value: {{ include "common.mariadbPort" . | quote }} |
rope252 | 4d3f368 | 2020-09-02 20:49:21 +0100 | [diff] [blame] | 54 | - name: DB_USERNAME |
| 55 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 14 }} |
| 56 | - name: DB_PASSWORD |
| 57 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 14 }} |
| 58 | - name: DB_ADMIN_USERNAME |
| 59 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 14 }} |
| 60 | - name: DB_ADMIN_PASSWORD |
| 61 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 14 }} |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 62 | envFrom: |
| 63 | - configMapRef: |
| 64 | name: {{ include "common.fullname" . }}-configmap |
| 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame] | 66 | volumeMounts: |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 67 | - name: logs |
| 68 | mountPath: /app/logs |
| 69 | - name: config |
| 70 | mountPath: /app/config |
| 71 | readOnly: true |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 72 | livenessProbe: |
| 73 | tcpSocket: |
| 74 | port: {{ index .Values.livenessProbe.port }} |
| 75 | initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}} |
| 76 | periodSeconds: {{ index .Values.livenessProbe.periodSeconds}} |
| 77 | successThreshold: {{ index .Values.livenessProbe.successThreshold}} |
| 78 | failureThreshold: {{ index .Values.livenessProbe.failureThreshold}} |
| 79 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
farida azmy | 87f4622 | 2021-04-06 15:25:15 +0200 | [diff] [blame] | 80 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Andreas Geissler | ad61ccf | 2023-02-23 09:17:36 +0100 | [diff] [blame] | 81 | volumes: |
AndrewLamb | 8e09044 | 2020-10-15 09:28:09 +0100 | [diff] [blame] | 82 | - name: logs |
| 83 | emptyDir: {} |
| 84 | - name: config |
| 85 | configMap: |
| 86 | name: {{ include "common.fullname" . }}-app-configmap |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame] | 87 | {{- include "common.imagePullSecrets" . | nindent 6 }} |