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