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