vvp -- VNF Validation Platform
[oom.git] / kubernetes / aaf / charts / aaf-service / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 apiVersion: extensions/v1beta1
16 kind: Deployment
17 metadata:
18   labels:
19     app: {{ include "common.name" . }}
20     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
21     release: {{ .Release.Name }}
22     heritage: {{ .Release.Service }}
23   name: {{ include "common.fullname" . }}
24   namespace: {{ include "common.namespace" . }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ .Release.Name }}
32     spec:
33       initContainers:
34       - name: {{ include "common.name" . }}-job-complete
35         command:
36         - /root/job_complete.py
37         args:
38         - --job-name
39         - {{ .Release.Name }}-create-config
40         env:
41         - name: NAMESPACE
42           valueFrom:
43             fieldRef:
44               apiVersion: v1
45               fieldPath: metadata.namespace
46         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
47         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48       - name: {{ include "common.name" . }}-readiness
49         command:
50         - /root/ready.py
51         args:
52         - --container-name
53         - aaf-cs
54         env:
55         - name: NAMESPACE
56           valueFrom:
57             fieldRef:
58               apiVersion: v1
59               fieldPath: metadata.namespace
60         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
61         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62       containers:
63       - name: {{ include "common.name" . }}
64         command: ["/bin/bash","/opt/app/aaf/bin/service"]
65         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
66         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67         volumeMounts:
68         - mountPath: "/opt/app/osaaf"
69           name: shared-config-volume
70         - mountPath: /etc/localtime
71           name: localtime
72           readOnly: true
73         {{- if eq .Values.liveness.enabled true }}
74         livenessProbe:
75           tcpSocket:
76             port: {{ .Values.service.internalPort }}
77           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
78           periodSeconds: {{ .Values.liveness.periodSeconds }}
79         {{ end -}}
80         readinessProbe:
81           tcpSocket:
82             port: {{ .Values.service.internalPort }}
83           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
84           periodSeconds: {{ .Values.readiness.periodSeconds }}
85         resources:
86 {{ include "common.resources" . | indent 12 }}
87       {{- if .Values.nodeSelector }}
88       nodeSelector:
89 {{ toYaml .Values.nodeSelector | indent 10 }}
90       {{- end -}}
91       {{- if .Values.affinity }}
92       affinity:
93 {{ toYaml .Values.affinity | indent 10 }}
94       {{- end }}
95       volumes:
96       - name: localtime
97         hostPath:
98           path: /etc/localtime
99       - name: shared-config-volume
100       {{- if .Values.global.persistence.enabled }}
101         persistentVolumeClaim:
102           claimName: {{ .Release.Name }}-config
103       {{- else }}
104         emptyDir: {}
105       {{- end }}
106       imagePullSecrets:
107       - name: "{{ include "common.namespace" . }}-docker-registry-key"