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 |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 4 | # Modifications Copyright © 2023 Nordix Foundation |
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" . }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 26 | app.kubernetes.io/name: {{ include "common.name" . }} |
| 27 | {{- if .Chart.AppVersion }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame] | 28 | version: "{{ .Chart.AppVersion | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 29 | {{- else }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame] | 30 | version: "{{ .Chart.Version | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 31 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 32 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 33 | release: {{ include "common.release" . }} |
| 34 | heritage: {{ .Release.Service }} |
| 35 | spec: |
| 36 | selector: |
| 37 | matchLabels: |
| 38 | app: {{ include "common.name" . }} |
| 39 | replicas: {{ .Values.replicaCount }} |
Rommel Pawar | 63db716 | 2022-11-16 10:11:24 -0800 | [diff] [blame] | 40 | strategy: |
| 41 | type: {{ .Values.updateStrategy.type }} |
| 42 | {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }} |
| 43 | rollingUpdate: |
| 44 | maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }} |
| 45 | maxSurge: {{ .Values.updateStrategy.maxSurge }} |
| 46 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 47 | template: |
| 48 | metadata: |
| 49 | labels: |
| 50 | app: {{ include "common.name" . }} |
| 51 | release: {{ include "common.release" . }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 52 | app.kubernetes.io/name: {{ include "common.name" . }} |
| 53 | {{- if .Chart.AppVersion }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame] | 54 | version: "{{ .Chart.AppVersion | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 55 | {{- else }} |
Andreas Geissler | 85a5a34 | 2023-07-19 14:05:20 +0200 | [diff] [blame] | 56 | version: "{{ .Chart.Version | replace "+" "_" }}" |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 57 | {{- end }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 58 | name: {{ include "common.release" . }} |
| 59 | annotations: |
| 60 | checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
| 61 | spec: |
Rommel Pawar | 63db716 | 2022-11-16 10:11:24 -0800 | [diff] [blame] | 62 | terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 63 | initContainers: |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 64 | - command: |
| 65 | - /app/ready.py |
| 66 | args: |
| 67 | - --container-name |
| 68 | - aai-resources |
| 69 | - --container-name |
| 70 | - aai-traversal |
| 71 | - --container-name |
| 72 | - aai-graphadmin |
| 73 | env: |
| 74 | - name: NAMESPACE |
| 75 | valueFrom: |
| 76 | fieldRef: |
| 77 | apiVersion: v1 |
| 78 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 79 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 80 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 81 | name: {{ include "common.name" . }}-readiness |
leila | 8bd5bf3 | 2022-11-16 19:42:09 -0500 | [diff] [blame] | 82 | resources: |
| 83 | requests: |
| 84 | memory: {{ .Values.haproxy.initContainers.resources.memory }} |
| 85 | cpu: {{ .Values.haproxy.initContainers.resources.cpu }} |
| 86 | limits: |
| 87 | memory: {{ .Values.haproxy.initContainers.resources.memory }} |
| 88 | cpu: {{ .Values.haproxy.initContainers.resources.cpu }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 89 | containers: |
| 90 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 91 | image: "{{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}" |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 92 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 93 | volumeMounts: |
| 94 | - mountPath: /etc/localtime |
| 95 | name: localtime |
| 96 | readOnly: true |
| 97 | - mountPath: /dev/log |
| 98 | name: aai-service-log |
| 99 | - mountPath: /usr/local/etc/haproxy/haproxy.cfg |
| 100 | {{ if .Values.global.installSidecarSecurity }} |
| 101 | subPath: haproxy-pluggable-security.cfg |
| 102 | {{ else }} |
| 103 | subPath: haproxy.cfg |
| 104 | {{ end }} |
| 105 | name: haproxy-cfg |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 106 | ports: |
| 107 | - containerPort: {{ .Values.service.internalPort }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 108 | name: {{ .Values.service.portName }} |
leila | 8bd5bf3 | 2022-11-16 19:42:09 -0500 | [diff] [blame] | 109 | - containerPort: {{ .Values.metricsService.internalPort }} |
Andreas Geissler | ceac260 | 2023-07-17 18:55:54 +0200 | [diff] [blame] | 110 | name: {{ .Values.metricsService.portName }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 111 | # disable liveness probe when breakpoints set in debugger |
| 112 | # so K8s doesn't restart unresponsive container |
| 113 | {{- if eq .Values.liveness.enabled true }} |
| 114 | livenessProbe: |
| 115 | tcpSocket: |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 116 | port: {{ .Values.service.internalPort }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 117 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 118 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 119 | {{ end -}} |
| 120 | readinessProbe: |
| 121 | httpGet: |
| 122 | path: /aai/util/echo |
Andreas Geissler | 5846a6e | 2023-03-30 17:26:14 +0200 | [diff] [blame] | 123 | port: {{ .Values.service.internalPort }} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame] | 124 | scheme: HTTP |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 125 | httpHeaders: |
| 126 | - name: X-FromAppId |
| 127 | value: OOM_ReadinessCheck |
| 128 | {{ if .Values.global.installSidecarSecurity }} |
| 129 | - name: Authorization |
| 130 | value: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== |
| 131 | {{ end }} |
| 132 | - name: X-TransactionId |
| 133 | value: OOM_ReadinessCheck_TID |
| 134 | - name: Accept |
| 135 | value: application/json |
| 136 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 137 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 138 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 139 | {{- if .Values.nodeSelector }} |
| 140 | nodeSelector: |
| 141 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 142 | {{- end -}} |
| 143 | {{- if .Values.affinity }} |
| 144 | affinity: |
| 145 | {{ toYaml .Values.affinity | indent 8 }} |
| 146 | {{- end }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame] | 147 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 148 | volumes: |
| 149 | - name: localtime |
| 150 | hostPath: |
| 151 | path: /etc/localtime |
| 152 | - name: aai-service-log |
| 153 | hostPath: |
| 154 | path: "/dev/log" |
| 155 | - name: haproxy-cfg |
| 156 | configMap: |
| 157 | name: aai-deployment-configmap |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 158 | imagePullSecrets: |
| 159 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |