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 © 2017 Amdocs, Bell Canada |
| 3 | # Modifications Copyright © 2018 AT&T |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 4 | # Modifications Copyright © 2020 Orange |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 5 | # Modifications Copyright © 2023 Nordix Foundation |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 18 | */}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 19 | |
| 20 | apiVersion: apps/v1 |
| 21 | kind: Deployment |
| 22 | metadata: |
| 23 | name: {{ include "common.fullname" . }} |
| 24 | namespace: {{ include "common.namespace" . }} |
| 25 | labels: |
| 26 | app: {{ include "common.name" . }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 27 | app.kubernetes.io/name: {{ include "common.name" . }} |
| 28 | {{- if .Chart.AppVersion }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame^] | 29 | version: "{{ .Chart.AppVersion | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 30 | {{- else }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame^] | 31 | version: "{{ .Chart.Version | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 32 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 33 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 34 | release: {{ include "common.release" . }} |
| 35 | heritage: {{ .Release.Service }} |
| 36 | spec: |
| 37 | replicas: {{ .Values.replicaCount }} |
Rommel Pawar | 63db716 | 2022-11-16 10:11:24 -0800 | [diff] [blame] | 38 | strategy: |
| 39 | type: {{ .Values.updateStrategy.type }} |
| 40 | {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }} |
| 41 | rollingUpdate: |
| 42 | maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }} |
| 43 | maxSurge: {{ .Values.updateStrategy.maxSurge }} |
| 44 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 45 | selector: |
| 46 | matchLabels: |
| 47 | app: {{ include "common.name" . }} |
| 48 | template: |
| 49 | metadata: |
| 50 | labels: |
| 51 | app: {{ include "common.name" . }} |
| 52 | release: {{ include "common.release" . }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 53 | app.kubernetes.io/name: {{ include "common.name" . }} |
| 54 | {{- if .Chart.AppVersion }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame^] | 55 | version: "{{ .Chart.AppVersion | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 56 | {{- else }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame^] | 57 | version: "{{ .Chart.Version | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 58 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 59 | name: {{ include "common.name" . }} |
| 60 | annotations: |
| 61 | checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
| 62 | spec: |
| 63 | containers: |
| 64 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 65 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | env: |
| 68 | - name: LOCAL_USER_ID |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 69 | value: {{ .Values.securityContext.user_id | quote }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 70 | - name: LOCAL_GROUP_ID |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 71 | value: {{ .Values.securityContext.group_id | quote }} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 72 | volumeMounts: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 73 | - mountPath: /etc/localtime |
| 74 | name: localtime |
| 75 | readOnly: true |
| 76 | - mountPath: /opt/app/aai-schema-service/resources/etc/appprops/aaiconfig.properties |
| 77 | name: aaiconfig-conf |
| 78 | subPath: aaiconfig.properties |
| 79 | - mountPath: /opt/aai/logroot/AAI-SS |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 80 | name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 81 | - mountPath: /opt/app/aai-schema-service/resources/logback.xml |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 82 | name: log-conf |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 83 | subPath: logback.xml |
| 84 | - mountPath: /opt/app/aai-schema-service/resources/localhost-access-logback.xml |
| 85 | name: localhost-access-log-conf |
| 86 | subPath: localhost-access-logback.xml |
| 87 | - mountPath: /opt/app/aai-schema-service/resources/etc/auth/realm.properties |
| 88 | name: realm-conf |
| 89 | subPath: realm.properties |
| 90 | - mountPath: /opt/app/aai-schema-service/resources/application.properties |
| 91 | name: springapp-conf |
| 92 | subPath: application.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 93 | ports: |
| 94 | - containerPort: {{ .Values.service.internalPort }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 95 | name: {{ .Values.service.portName }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 96 | - containerPort: {{ .Values.service.internalPort2 }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 97 | name: {{ .Values.service.portName2 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 98 | # disable liveness probe when breakpoints set in debugger |
| 99 | # so K8s doesn't restart unresponsive container |
| 100 | {{ if .Values.liveness.enabled }} |
| 101 | livenessProbe: |
| 102 | tcpSocket: |
| 103 | port: {{ .Values.service.internalPort }} |
| 104 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 105 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 106 | {{ end }} |
| 107 | readinessProbe: |
| 108 | tcpSocket: |
| 109 | port: {{ .Values.service.internalPort }} |
| 110 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 111 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 112 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 113 | {{- if .Values.nodeSelector }} |
| 114 | nodeSelector: |
| 115 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 116 | {{- end -}} |
| 117 | {{- if .Values.affinity }} |
| 118 | affinity: |
| 119 | {{ toYaml .Values.affinity | indent 8 }} |
| 120 | {{- end }} |
| 121 | |
| 122 | # side car containers |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 123 | {{ include "common.log.sidecar" . | nindent 6 }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame] | 124 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 125 | volumes: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 126 | - name: aai-common-aai-auth-mount |
| 127 | secret: |
| 128 | secretName: aai-common-aai-auth |
| 129 | - name: localtime |
| 130 | hostPath: |
| 131 | path: /etc/localtime |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 132 | - name: logs |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 133 | emptyDir: {} |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 134 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 135 | - name: log-conf |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 136 | configMap: |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 137 | name: {{ include "common.fullname" . }}-log |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 138 | - name: localhost-access-log-conf |
| 139 | configMap: |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 140 | name: {{ include "common.fullname" . }}-localhost-access-log |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 141 | - name: springapp-conf |
| 142 | configMap: |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 143 | name: {{ include "common.fullname" . }}-springapp |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 144 | - name: aaiconfig-conf |
| 145 | configMap: |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 146 | name: {{ include "common.fullname" . }}-aaiconfig |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 147 | - name: realm-conf |
| 148 | configMap: |
Sylvain Desbureaux | c57b58d | 2021-02-23 18:07:34 +0100 | [diff] [blame] | 149 | name: {{ include "common.fullname" . }}-realm |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 150 | restartPolicy: {{ .Values.restartPolicy }} |
| 151 | imagePullSecrets: |
| 152 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |