blob: 5b10c434645c3050c12afeac5486d4ee3e28ccf0 [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002# Copyright (c) 2018 Amdocs, Bell Canada, AT&T
Sylvain Desbureaux5b651322020-12-07 15:34:15 +01003# Modifications Copyright (c) 2020 Nokia, Orange
efiacord12c1672023-03-23 12:10:50 +00004# Modifications Copyright © 2023 Nordix Foundation
Sylvain Desbureaux70070412020-11-09 21:58:48 +01005#
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 Desbureaux47eb4d22020-12-10 12:15:27 +010017*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010018
19apiVersion: apps/v1
20kind: Deployment
21metadata:
22 name: {{ include "common.fullname" . }}
23 namespace: {{ include "common.namespace" . }}
24 labels:
25 app: {{ include "common.name" . }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020026 app.kubernetes.io/name: {{ include "common.name" . }}
27 {{- if .Chart.AppVersion }}
Andreas Geissler85a5a342023-07-19 14:05:20 +020028 version: "{{ .Chart.AppVersion | replace "+" "_" }}"
Andreas Geisslerceac2602023-07-17 18:55:54 +020029 {{- else }}
Andreas Geissler85a5a342023-07-19 14:05:20 +020030 version: "{{ .Chart.Version | replace "+" "_" }}"
Andreas Geisslerceac2602023-07-17 18:55:54 +020031 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010032 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
33 release: {{ include "common.release" . }}
34 heritage: {{ .Release.Service }}
35spec:
36 selector:
37 matchLabels:
38 app: {{ include "common.name" . }}
39 replicas: {{ .Values.replicaCount }}
Rommel Pawar63db7162022-11-16 10:11:24 -080040 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 Desbureaux70070412020-11-09 21:58:48 +010047 template:
48 metadata:
49 labels:
50 app: {{ include "common.name" . }}
51 release: {{ include "common.release" . }}
Andreas Geisslerceac2602023-07-17 18:55:54 +020052 app.kubernetes.io/name: {{ include "common.name" . }}
53 {{- if .Chart.AppVersion }}
Andreas Geissler85a5a342023-07-19 14:05:20 +020054 version: "{{ .Chart.AppVersion | replace "+" "_" }}"
Andreas Geisslerceac2602023-07-17 18:55:54 +020055 {{- else }}
Andreas Geissler85a5a342023-07-19 14:05:20 +020056 version: "{{ .Chart.Version | replace "+" "_" }}"
Andreas Geisslerceac2602023-07-17 18:55:54 +020057 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010058 name: {{ include "common.release" . }}
59 annotations:
60 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
61 spec:
Rommel Pawar63db7162022-11-16 10:11:24 -080062 terminationGracePeriodSeconds: {{ .Values.service.terminationGracePeriodSeconds }}
efiacord12c1672023-03-23 12:10:50 +000063 initContainers:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010064 - 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 Desbureaux5b651322020-12-07 15:34:15 +010079 image: {{ include "repositoryGenerator.image.readiness" . }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010080 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 name: {{ include "common.name" . }}-readiness
leila8bd5bf32022-11-16 19:42:09 -050082 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 Desbureaux70070412020-11-09 21:58:48 +010089 containers:
90 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010091 image: "{{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}"
Sylvain Desbureaux70070412020-11-09 21:58:48 +010092 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 volumeMounts:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010094 - mountPath: /dev/log
95 name: aai-service-log
96 - mountPath: /usr/local/etc/haproxy/haproxy.cfg
97 {{ if .Values.global.installSidecarSecurity }}
98 subPath: haproxy-pluggable-security.cfg
99 {{ else }}
100 subPath: haproxy.cfg
101 {{ end }}
102 name: haproxy-cfg
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100103 ports:
104 - containerPort: {{ .Values.service.internalPort }}
Andreas Geisslerceac2602023-07-17 18:55:54 +0200105 name: {{ .Values.service.portName }}
leila8bd5bf32022-11-16 19:42:09 -0500106 - containerPort: {{ .Values.metricsService.internalPort }}
Andreas Geisslerceac2602023-07-17 18:55:54 +0200107 name: {{ .Values.metricsService.portName }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100108 # disable liveness probe when breakpoints set in debugger
109 # so K8s doesn't restart unresponsive container
110 {{- if eq .Values.liveness.enabled true }}
111 livenessProbe:
112 tcpSocket:
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200113 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100114 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
115 periodSeconds: {{ .Values.liveness.periodSeconds }}
116 {{ end -}}
117 readinessProbe:
118 httpGet:
119 path: /aai/util/echo
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200120 port: {{ .Values.service.internalPort }}
efiacord12c1672023-03-23 12:10:50 +0000121 scheme: HTTP
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100122 httpHeaders:
123 - name: X-FromAppId
124 value: OOM_ReadinessCheck
125 {{ if .Values.global.installSidecarSecurity }}
126 - name: Authorization
127 value: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ==
128 {{ end }}
129 - name: X-TransactionId
130 value: OOM_ReadinessCheck_TID
131 - name: Accept
132 value: application/json
133 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
134 periodSeconds: {{ .Values.readiness.periodSeconds }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100135 resources: {{ include "common.resources" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100136 {{- if .Values.nodeSelector }}
137 nodeSelector:
138{{ toYaml .Values.nodeSelector | indent 8 }}
139 {{- end -}}
140 {{- if .Values.affinity }}
141 affinity:
142{{ toYaml .Values.affinity | indent 8 }}
143 {{- end }}
farida azmyd8937332021-03-09 12:20:42 +0200144 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100145 volumes:
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100146 - name: aai-service-log
147 hostPath:
148 path: "/dev/log"
149 - name: haproxy-cfg
150 configMap:
151 name: aai-deployment-configmap
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100152 {{- include "common.imagePullSecrets" . | nindent 6 }}