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