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) 2018 Amdocs, Bell Canada, AT&T |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 3 | # Modifications Copyright (c) 2020 Nokia, Orange |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 16 | */}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 17 | |
| 18 | apiVersion: apps/v1 |
| 19 | kind: Deployment |
| 20 | metadata: |
| 21 | name: {{ include "common.fullname" . }} |
| 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
| 24 | app: {{ include "common.name" . }} |
| 25 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 26 | release: {{ include "common.release" . }} |
| 27 | heritage: {{ .Release.Service }} |
| 28 | spec: |
| 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
| 32 | replicas: {{ .Values.replicaCount }} |
Rommel Pawar | 63db716 | 2022-11-16 10:11:24 -0800 | [diff] [blame] | 33 | strategy: |
| 34 | type: {{ .Values.updateStrategy.type }} |
| 35 | {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }} |
| 36 | rollingUpdate: |
| 37 | maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }} |
| 38 | maxSurge: {{ .Values.updateStrategy.maxSurge }} |
| 39 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 40 | template: |
| 41 | metadata: |
| 42 | labels: |
| 43 | app: {{ include "common.name" . }} |
| 44 | release: {{ include "common.release" . }} |
| 45 | name: {{ include "common.release" . }} |
| 46 | annotations: |
| 47 | checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
| 48 | spec: |
Rommel Pawar | 63db716 | 2022-11-16 10:11:24 -0800 | [diff] [blame] | 49 | terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }} |
Sylvain Desbureaux | 87f49af | 2020-12-15 11:56:51 +0100 | [diff] [blame] | 50 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 51 | - command: |
| 52 | - /app/ready.py |
| 53 | args: |
| 54 | - --container-name |
| 55 | - aai-resources |
| 56 | - --container-name |
| 57 | - aai-traversal |
| 58 | - --container-name |
| 59 | - aai-graphadmin |
| 60 | env: |
| 61 | - name: NAMESPACE |
| 62 | valueFrom: |
| 63 | fieldRef: |
| 64 | apiVersion: v1 |
| 65 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 66 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 67 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 68 | name: {{ include "common.name" . }}-readiness |
leila | 8bd5bf3 | 2022-11-16 19:42:09 -0500 | [diff] [blame] | 69 | resources: |
| 70 | requests: |
| 71 | memory: {{ .Values.haproxy.initContainers.resources.memory }} |
| 72 | cpu: {{ .Values.haproxy.initContainers.resources.cpu }} |
| 73 | limits: |
| 74 | memory: {{ .Values.haproxy.initContainers.resources.memory }} |
| 75 | cpu: {{ .Values.haproxy.initContainers.resources.cpu }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 76 | containers: |
| 77 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 78 | image: "{{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}" |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 79 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 80 | volumeMounts: |
| 81 | - mountPath: /etc/localtime |
| 82 | name: localtime |
| 83 | readOnly: true |
| 84 | - mountPath: /dev/log |
| 85 | name: aai-service-log |
| 86 | - mountPath: /usr/local/etc/haproxy/haproxy.cfg |
| 87 | {{ if .Values.global.installSidecarSecurity }} |
| 88 | subPath: haproxy-pluggable-security.cfg |
| 89 | {{ else }} |
| 90 | subPath: haproxy.cfg |
| 91 | {{ end }} |
| 92 | name: haproxy-cfg |
Sylvain Desbureaux | 87f49af | 2020-12-15 11:56:51 +0100 | [diff] [blame] | 93 | {{- include "common.certInitializer.volumeMount" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 94 | ports: |
| 95 | - containerPort: {{ .Values.service.internalPort }} |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 96 | - containerPort: {{ .Values.service.internalPlainPort }} |
leila | 8bd5bf3 | 2022-11-16 19:42:09 -0500 | [diff] [blame] | 97 | - containerPort: {{ .Values.metricsService.internalPort }} |
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 eq .Values.liveness.enabled true }} |
| 101 | livenessProbe: |
| 102 | tcpSocket: |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 103 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 104 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 105 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 106 | {{ end -}} |
| 107 | readinessProbe: |
| 108 | httpGet: |
| 109 | path: /aai/util/echo |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 110 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
| 111 | #scheme: HTTPS |
| 112 | scheme: {{ (eq "true" (include "common.needTLS" .)) | ternary "HTTPS" "HTTP" }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 113 | httpHeaders: |
| 114 | - name: X-FromAppId |
| 115 | value: OOM_ReadinessCheck |
| 116 | {{ if .Values.global.installSidecarSecurity }} |
| 117 | - name: Authorization |
| 118 | value: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== |
| 119 | {{ end }} |
| 120 | - name: X-TransactionId |
| 121 | value: OOM_ReadinessCheck_TID |
| 122 | - name: Accept |
| 123 | value: application/json |
| 124 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 125 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 126 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 127 | {{- if .Values.nodeSelector }} |
| 128 | nodeSelector: |
| 129 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 130 | {{- end -}} |
| 131 | {{- if .Values.affinity }} |
| 132 | affinity: |
| 133 | {{ toYaml .Values.affinity | indent 8 }} |
| 134 | {{- end }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame] | 135 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 136 | volumes: |
| 137 | - name: localtime |
| 138 | hostPath: |
| 139 | path: /etc/localtime |
| 140 | - name: aai-service-log |
| 141 | hostPath: |
| 142 | path: "/dev/log" |
| 143 | - name: haproxy-cfg |
| 144 | configMap: |
| 145 | name: aai-deployment-configmap |
Sylvain Desbureaux | 87f49af | 2020-12-15 11:56:51 +0100 | [diff] [blame] | 146 | {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 147 | imagePullSecrets: |
| 148 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |