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 }} |
| 33 | template: |
| 34 | metadata: |
| 35 | labels: |
| 36 | app: {{ include "common.name" . }} |
| 37 | release: {{ include "common.release" . }} |
| 38 | name: {{ include "common.release" . }} |
| 39 | annotations: |
| 40 | checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
| 41 | spec: |
Sylvain Desbureaux | 87f49af | 2020-12-15 11:56:51 +0100 | [diff] [blame] | 42 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 43 | - command: |
| 44 | - /app/ready.py |
| 45 | args: |
| 46 | - --container-name |
| 47 | - aai-resources |
| 48 | - --container-name |
| 49 | - aai-traversal |
| 50 | - --container-name |
| 51 | - aai-graphadmin |
| 52 | env: |
| 53 | - name: NAMESPACE |
| 54 | valueFrom: |
| 55 | fieldRef: |
| 56 | apiVersion: v1 |
| 57 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 58 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 59 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 60 | name: {{ include "common.name" . }}-readiness |
| 61 | containers: |
| 62 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 63 | image: "{{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}" |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 64 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 65 | volumeMounts: |
| 66 | - mountPath: /etc/localtime |
| 67 | name: localtime |
| 68 | readOnly: true |
| 69 | - mountPath: /dev/log |
| 70 | name: aai-service-log |
| 71 | - mountPath: /usr/local/etc/haproxy/haproxy.cfg |
| 72 | {{ if .Values.global.installSidecarSecurity }} |
| 73 | subPath: haproxy-pluggable-security.cfg |
| 74 | {{ else }} |
| 75 | subPath: haproxy.cfg |
| 76 | {{ end }} |
| 77 | name: haproxy-cfg |
Sylvain Desbureaux | 87f49af | 2020-12-15 11:56:51 +0100 | [diff] [blame] | 78 | {{- include "common.certInitializer.volumeMount" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 79 | ports: |
| 80 | - containerPort: {{ .Values.service.internalPort }} |
| 81 | # disable liveness probe when breakpoints set in debugger |
| 82 | # so K8s doesn't restart unresponsive container |
| 83 | {{- if eq .Values.liveness.enabled true }} |
| 84 | livenessProbe: |
| 85 | tcpSocket: |
| 86 | port: {{ .Values.service.internalPort }} |
| 87 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 88 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 89 | {{ end -}} |
| 90 | readinessProbe: |
| 91 | httpGet: |
| 92 | path: /aai/util/echo |
| 93 | port: {{ .Values.service.internalPort }} |
| 94 | scheme: HTTPS |
| 95 | httpHeaders: |
| 96 | - name: X-FromAppId |
| 97 | value: OOM_ReadinessCheck |
| 98 | {{ if .Values.global.installSidecarSecurity }} |
| 99 | - name: Authorization |
| 100 | value: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== |
| 101 | {{ end }} |
| 102 | - name: X-TransactionId |
| 103 | value: OOM_ReadinessCheck_TID |
| 104 | - name: Accept |
| 105 | value: application/json |
| 106 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 107 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 108 | resources: |
| 109 | {{ include "common.resources" . }} |
| 110 | {{- if .Values.nodeSelector }} |
| 111 | nodeSelector: |
| 112 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 113 | {{- end -}} |
| 114 | {{- if .Values.affinity }} |
| 115 | affinity: |
| 116 | {{ toYaml .Values.affinity | indent 8 }} |
| 117 | {{- end }} |
farida azmy | d893733 | 2021-03-09 12:20:42 +0200 | [diff] [blame^] | 118 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 119 | volumes: |
| 120 | - name: localtime |
| 121 | hostPath: |
| 122 | path: /etc/localtime |
| 123 | - name: aai-service-log |
| 124 | hostPath: |
| 125 | path: "/dev/log" |
| 126 | - name: haproxy-cfg |
| 127 | configMap: |
| 128 | name: aai-deployment-configmap |
Sylvain Desbureaux | 87f49af | 2020-12-15 11:56:51 +0100 | [diff] [blame] | 129 | {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 130 | imagePullSecrets: |
| 131 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |