Merge "[UUI] Update image of components of UUI"
[oom.git] / kubernetes / aaf / components / aaf-hello / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications © 2020 Orange
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.
16 */}}
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector: {{- include "common.selectors" . | nindent 4 }}
22   replicas: {{ .Values.replicaCount }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       initContainers: {{ include "common.aaf-config" (dict "aafRoot" .Values.aaf_init "dot" .) | nindent 6 }}
27 # CONTAINER Definition
28       containers:
29       - name: {{ include "common.name" . }}
30         command: ["bash","-c","cd /opt/app/aaf && if [ ! -d /opt/app/osaaf/etc ]; then cp -Rf etc logs /opt/app/osaaf; fi && exec bin/hello"]
31         image: {{ include "repositoryGenerator.repository" . }}/{{.Values.image }}
32         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33         ports: {{ include "common.containerPorts" . | nindent 10  }}
34         volumeMounts:  {{ include "common.aaf-config-volume-mountpath" . | nindent 8 }}
35         - mountPath: /etc/localtime
36           name: localtime
37           readOnly: true
38         {{- if eq .Values.liveness.enabled true }}
39         livenessProbe:
40           tcpSocket:
41             port: {{ .Values.liveness.port }}
42           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
43           periodSeconds: {{ .Values.liveness.periodSeconds }}
44         {{- end }}
45         readinessProbe:
46           tcpSocket:
47             port: {{ .Values.readiness.port }}
48           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
49           periodSeconds: {{ .Values.readiness.periodSeconds }}
50         resources: {{ include "common.resources" . | nindent 12 }}
51       {{- if .Values.nodeSelector }}
52       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
53       {{- end -}}
54       {{- if .Values.affinity }}
55       affinity: {{ toYaml .Values.affinity | nindent 10 }}
56       {{- end }}
57       volumes: {{ include "common.aaf-config-volumes" (dict "aafRoot" .Values.aaf_init "dot" .) | nindent 6 }}
58       - name: localtime
59         hostPath:
60           path: /etc/localtime
61       imagePullSecrets:
62       - name: "{{ include "common.namespace" . }}-docker-registry-key"