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 © 2018 Amdocs, AT&T |
| 3 | # Modifications Copyright © 2018 Bell Canada |
Sylvain Desbureaux | 6212bb2 | 2021-01-18 11:43:33 +0100 | [diff] [blame] | 4 | # Modifications Copyright © 2020,2021 Orange |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +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. |
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 | selector: |
| 31 | matchLabels: |
| 32 | app: {{ include "common.name" . }} |
| 33 | replicas: {{ .Values.replicaCount }} |
| 34 | template: |
| 35 | metadata: |
| 36 | labels: |
| 37 | app: {{ include "common.name" . }} |
| 38 | release: {{ include "common.release" . }} |
| 39 | spec: |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 40 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 41 | containers: |
| 42 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 43 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 44 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 45 | {{- if .Values.global.aafEnabled }} |
| 46 | command: |
| 47 | - sh |
| 48 | args: |
| 49 | - -c |
| 50 | - | |
| 51 | echo "*** retrieve Truststore and Keystore password" |
| 52 | export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
| 53 | echo "*** actual launch of AAI Babel" |
| 54 | /bin/bash /opt/app/babel/bin/start.sh |
| 55 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 56 | ports: |
| 57 | - containerPort: {{ .Values.service.internalPort }} |
| 58 | # disable liveness probe when breakpoints set in debugger |
| 59 | # so K8s doesn't restart unresponsive container |
| 60 | {{ if .Values.liveness.enabled }} |
| 61 | livenessProbe: |
| 62 | tcpSocket: |
| 63 | port: {{ .Values.service.internalPort }} |
| 64 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 65 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 66 | {{ end }} |
| 67 | readinessProbe: |
| 68 | tcpSocket: |
| 69 | port: {{ .Values.service.internalPort }} |
| 70 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 71 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 72 | env: |
othman touijer | 5ef62c1 | 2021-12-03 09:45:37 +0100 | [diff] [blame] | 73 | {{- if not (include "common.needTLS" .) }} |
| 74 | - name: KEY_STORE_PASSWORD |
| 75 | value: NotUsed |
| 76 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 77 | - name: CONFIG_HOME |
| 78 | value: /opt/app/babel/config |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 79 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 80 | - mountPath: /etc/localtime |
| 81 | name: localtime |
| 82 | readOnly: true |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 83 | - mountPath: /opt/app/babel/config/application.properties |
| 84 | name: config |
| 85 | subPath: application.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 86 | - mountPath: /opt/app/babel/config/artifact-generator.properties |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 87 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 88 | subPath: artifact-generator.properties |
| 89 | - mountPath: /opt/app/babel/config/tosca-mappings.json |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 90 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 91 | subPath: tosca-mappings.json |
| 92 | - mountPath: /opt/app/babel/config/babel-auth.properties |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 93 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 94 | subPath: babel-auth.properties |
| 95 | - mountPath: /opt/app/babel/config/auth |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 96 | name: secrets |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 97 | - mountPath: {{ .Values.log.path }} |
| 98 | name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 99 | - mountPath: /opt/app/babel/config/logback.xml |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 100 | name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 101 | subPath: logback.xml |
| 102 | resources: |
| 103 | {{ include "common.resources" . }} |
| 104 | {{- if .Values.nodeSelector }} |
| 105 | nodeSelector: |
| 106 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 107 | {{- end -}} |
| 108 | {{- if .Values.affinity }} |
| 109 | affinity: |
| 110 | {{ toYaml .Values.affinity | indent 8 }} |
| 111 | {{- end }} |
| 112 | |
| 113 | # side car containers |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 114 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame] | 115 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 116 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 117 | - name: localtime |
| 118 | hostPath: |
| 119 | path: /etc/localtime |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 120 | - name: config |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 121 | configMap: |
| 122 | name: {{ include "common.fullname" . }}-configmap |
Sylvain Desbureaux | 1e99719 | 2021-02-28 14:59:22 +0100 | [diff] [blame] | 123 | - name: secrets |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 124 | secret: |
| 125 | secretName: {{ include "common.fullname" . }}-babel-secrets |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 126 | - name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 127 | emptyDir: {} |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 128 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 129 | |
| 130 | imagePullSecrets: |
| 131 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |