blob: c3c140a35d8bd76ea353a0a46023ad3c8d226fba [file] [log] [blame]
kj52dfb132018-03-27 15:50:39 +03001# 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
15apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
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" . }}
25spec:
26 replicas: {{ .Values.replicaCount }}
kj52dfb132018-03-27 15:50:39 +030027 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000031 release: {{ .Release.Name }}
kj52dfb132018-03-27 15:50:39 +030032 spec:
33 initContainers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000034 - name: {{ include "common.name" . }}-job-complete
35 command:
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000036 - /root/job_complete.py
37 args:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000038 - --job-name
39 - {{ .Release.Name }}-create-config
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000040 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 }}
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000048 - name: {{ include "common.name" . }}-readiness
49 command:
kj52dfb132018-03-27 15:50:39 +030050 - /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 }}
kj52dfb132018-03-27 15:50:39 +030062 containers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000063 - name: {{ include "common.name" . }}
64 command: ["/bin/bash","/opt/app/aaf/bin/service"]
Kiran Kamineni39648722018-03-21 14:58:11 -070065 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
kj52dfb132018-03-27 15:50:39 +030066 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67 volumeMounts:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000068 - mountPath: "/opt/app/osaaf"
69 name: shared-config-volume
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000070 - mountPath: /etc/localtime
71 name: localtime
72 readOnly: true
kj52dfb132018-03-27 15:50:39 +030073 {{- 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:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000086{{ include "common.resources" . | indent 12 }}
kj52dfb132018-03-27 15:50:39 +030087 {{- 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 }}
kj52dfb132018-03-27 15:50:39 +030095 volumes:
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000096 - name: localtime
97 hostPath:
98 path: /etc/localtime
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000099 - name: shared-config-volume
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +0000100 {{- if .Values.global.persistence.enabled }}
101 persistentVolumeClaim:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000102 claimName: {{ .Release.Name }}-config
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +0000103 {{- else }}
104 emptyDir: {}
105 {{- end }}
kj52dfb132018-03-27 15:50:39 +0300106 imagePullSecrets:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +0000107 - name: "{{ include "common.namespace" . }}-docker-registry-key"