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