Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 2 | # Copyright (c) 2017 Amdocs, Bell Canada |
| 3 | # Modifications Copyright (c) 2018 AT&T |
| 4 | # Modifications Copyright (c) 2020 Nokia |
| 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. |
Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 17 | */}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 18 | |
| 19 | apiVersion: apps/v1 |
| 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: {{ include "common.fullname" . }} |
| 23 | namespace: {{ include "common.namespace" . }} |
| 24 | labels: |
| 25 | app: {{ include "common.name" . }} |
| 26 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 27 | release: {{ include "common.release" . }} |
| 28 | heritage: {{ .Release.Service }} |
| 29 | spec: |
| 30 | replicas: {{ .Values.replicaCount }} |
Rommel Pawar | 63db716 | 2022-11-16 10:11:24 -0800 | [diff] [blame] | 31 | strategy: |
| 32 | type: {{ .Values.updateStrategy.type }} |
| 33 | {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }} |
| 34 | rollingUpdate: |
| 35 | maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }} |
| 36 | maxSurge: {{ .Values.updateStrategy.maxSurge }} |
| 37 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 38 | selector: |
| 39 | matchLabels: |
| 40 | app: {{ include "common.name" . }} |
| 41 | template: |
| 42 | metadata: |
Andreas Geissler | 8624d22 | 2022-05-13 17:16:41 +0200 | [diff] [blame] | 43 | annotations: |
| 44 | sidecar.istio.io/rewriteAppHTTPProbers: "false" |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 45 | labels: |
| 46 | app: {{ include "common.name" . }} |
| 47 | release: {{ include "common.release" . }} |
| 48 | name: {{ include "common.name" . }} |
| 49 | spec: |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 50 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 51 | {{- if ( include "common.needTLS" .) }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 52 | - command: |
| 53 | - sh |
| 54 | args: |
| 55 | - -c |
| 56 | - | |
| 57 | echo "*** retrieve Truststore and Keystore password" |
| 58 | export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop \ |
| 59 | | xargs -0) |
| 60 | if [ -z "$KEYSTORE_PASSWORD" ] |
| 61 | then |
| 62 | echo " /!\ certificates retrieval failed" |
| 63 | exit 1 |
| 64 | fi |
| 65 | echo "*** write them in portal part" |
| 66 | cd /config-input |
| 67 | for PFILE in `ls -1 .` |
| 68 | do |
| 69 | envsubst <${PFILE} >/config/${PFILE} |
| 70 | done |
| 71 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} |
| 72 | - mountPath: /config-input |
| 73 | name: portal-config-input |
| 74 | - mountPath: /config |
| 75 | name: portal-config |
| 76 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
| 77 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 78 | name: {{ include "common.name" . }}-update-config |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 79 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 80 | - command: |
| 81 | - /app/ready.py |
| 82 | args: |
| 83 | - --container-name |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 84 | - aai |
| 85 | env: |
| 86 | - name: NAMESPACE |
| 87 | valueFrom: |
| 88 | fieldRef: |
| 89 | apiVersion: v1 |
| 90 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 91 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 92 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 93 | name: {{ include "common.name" . }}-readiness |
| 94 | containers: |
| 95 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 96 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 97 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 98 | command: |
| 99 | - sh |
| 100 | args: |
| 101 | - -c |
| 102 | - | |
| 103 | echo "*** retrieve Truststore and Keystore password" |
| 104 | export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop \ |
| 105 | | xargs -0) |
| 106 | echo "*** actual launch of AAI Sparky BE" |
| 107 | /opt/app/sparky/bin/start.sh |
| 108 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 109 | - mountPath: /etc/localtime |
| 110 | name: localtime |
| 111 | readOnly: true |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 112 | - mountPath: /opt/app/sparky/config/auth/csp-cookie-filter.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 113 | name: auth-config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 114 | subPath: csp-cookie-filter.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 115 | - mountPath: /opt/app/sparky/config/portal/ |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 116 | name: portal-config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 117 | - mountPath: /opt/app/sparky/config/portal/BOOT-INF/classes/ |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 118 | name: portal-config-props |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 119 | - mountPath: {{ .Values.log.path }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 120 | name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 121 | - mountPath: /opt/app/sparky/config/application.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 122 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 123 | subPath: application.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 124 | - mountPath: /opt/app/sparky/config/application-resources.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 125 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 126 | subPath: application-resources.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 127 | - mountPath: /opt/app/sparky/config/application-ssl.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 128 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 129 | subPath: application-ssl.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 130 | - mountPath: /opt/app/sparky/config/application-oxm-default.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 131 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 132 | subPath: application-oxm-default.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 133 | - mountPath: /opt/app/sparky/config/application-oxm-override.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 134 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 135 | subPath: application-oxm-override.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 136 | - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 137 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 138 | subPath: application-oxm-schema-prod.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 139 | - mountPath: /opt/app/sparky/config/roles.config |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 140 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 141 | subPath: roles.config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 142 | - mountPath: /opt/app/sparky/config/users.config |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 143 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 144 | subPath: users.config |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 145 | - mountPath: /opt/app/sparky/config/logging/logback.xml |
| 146 | name: config |
| 147 | subPath: logback.xml |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 148 | ports: |
| 149 | - containerPort: {{ .Values.service.internalPort }} |
Andreas Geissler | 46067c7 | 2022-11-14 19:58:53 +0100 | [diff] [blame] | 150 | - containerPort: {{ .Values.service.internalPlainPort }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 151 | # disable liveness probe when breakpoints set in debugger |
| 152 | # so K8s doesn't restart unresponsive container |
| 153 | {{- if eq .Values.liveness.enabled true }} |
| 154 | livenessProbe: |
| 155 | tcpSocket: |
Andreas Geissler | 46067c7 | 2022-11-14 19:58:53 +0100 | [diff] [blame] | 156 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 157 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 158 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 159 | {{ end -}} |
| 160 | readinessProbe: |
| 161 | tcpSocket: |
Andreas Geissler | 46067c7 | 2022-11-14 19:58:53 +0100 | [diff] [blame] | 162 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 163 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 164 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 165 | resources: |
| 166 | {{ include "common.resources" . }} |
| 167 | {{- if .Values.nodeSelector }} |
| 168 | nodeSelector: |
| 169 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 170 | {{- end -}} |
| 171 | {{- if .Values.affinity }} |
| 172 | affinity: |
| 173 | {{ toYaml .Values.affinity | indent 8 }} |
| 174 | {{- end }} |
| 175 | |
| 176 | # side car containers |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 177 | {{ include "common.log.sidecar" . | nindent 6 }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame] | 178 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 179 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 180 | - name: localtime |
| 181 | hostPath: |
| 182 | path: /etc/localtime |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 183 | - name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 184 | configMap: |
| 185 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 186 | - name: portal-config |
othman touijer | 5117667 | 2021-12-01 16:21:18 +0100 | [diff] [blame] | 187 | {{- if .Values.global.aafEnabled }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 188 | emptyDir: |
| 189 | medium: Memory |
| 190 | - name: portal-config-input |
othman touijer | 5117667 | 2021-12-01 16:21:18 +0100 | [diff] [blame] | 191 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 192 | configMap: |
| 193 | name: {{ include "common.fullname" . }}-portal |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 194 | - name: portal-config-props |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 195 | configMap: |
| 196 | name: {{ include "common.fullname" . }}-portal-props |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 197 | - name: auth-config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 198 | secret: |
| 199 | secretName: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 375d0ea | 2021-03-08 16:52:20 +0000 | [diff] [blame] | 200 | - name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 201 | emptyDir: {} |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 202 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 203 | - name: modeldir |
| 204 | emptyDir: {} |
| 205 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 206 | imagePullSecrets: |
| 207 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |