blob: 68299da43ccbde7f496a7788475ad69df23a615e [file] [log] [blame]
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00001# Copyright © 2017 Amdocs, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 AT&T, ZTE
Mandeep Khindab1f9efe2018-03-28 19:01:55 +00003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Mandeep Khindaa1047f42018-03-22 02:12:15 +000016apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
32 release: {{ .Release.Name }}
33 spec:
34 initContainers:
Mike Elliott6482f502018-04-30 15:02:43 -040035 - name: {{ include "common.name" . }}-job-completion
36 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
37 imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000038 command:
Mike Elliott6482f502018-04-30 15:02:43 -040039 - /root/job_complete.py
Mandeep Khindaa1047f42018-03-22 02:12:15 +000040 args:
Mike Elliott6482f502018-04-30 15:02:43 -040041 - --job-name
42 - {{ .Release.Name }}-sdc-es-config-elasticsearch
Mandeep Khindaa1047f42018-03-22 02:12:15 +000043 env:
44 - name: NAMESPACE
45 valueFrom:
46 fieldRef:
47 apiVersion: v1
48 fieldPath: metadata.namespace
Mandeep Khindaa1047f42018-03-22 02:12:15 +000049 containers:
50 - name: {{ include "common.name" . }}
Mandeep Khinda51a8b1b2018-04-24 20:05:32 +000051 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Mandeep Khindaa1047f42018-03-22 02:12:15 +000052 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 ports:
54 - containerPort: {{ .Values.service.internalPort }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000055 {{ if eq .Values.liveness.enabled true }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000056 livenessProbe:
57 tcpSocket:
58 port: {{ .Values.service.internalPort }}
59 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.liveness.periodSeconds }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000061 {{ end }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000062 readinessProbe:
63 tcpSocket:
64 port: {{ .Values.service.internalPort }}
65 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.readiness.periodSeconds }}
67 env:
68 - name: ENVNAME
69 value: {{ .Values.global.env.name }}
Mandeep Khinda403c1c12018-04-19 23:15:43 +000070 - name: NODE_OPTIONS
71 value: {{ .Values.config.nodeOptions }}
Mandeep Khindaa1047f42018-03-22 02:12:15 +000072 - name: HOST_IP
73 valueFrom:
74 fieldRef:
75 fieldPath: status.podIP
Mandeep Khindaa1047f42018-03-22 02:12:15 +000076 volumeMounts:
77 - name: {{ include "common.fullname" . }}-environments
78 mountPath: /root/chef-solo/environments/
79 - name: {{ include "common.fullname" . }}-localtime
80 mountPath: /etc/localtime
81 readOnly: true
82 resources:
83{{ toYaml .Values.resources | indent 12 }}
84 {{- if .Values.nodeSelector }}
85 nodeSelector:
86{{ toYaml .Values.nodeSelector | indent 10 }}
87 {{- end -}}
88 {{- if .Values.affinity }}
89 affinity:
90{{ toYaml .Values.affinity | indent 10 }}
91 {{- end }}
92 volumes:
Mandeep Khinda403c1c12018-04-19 23:15:43 +000093 - name: {{ include "common.fullname" . }}-localtime
94 hostPath:
95 path: /etc/localtime
96 - name: {{ include "common.fullname" . }}-environments
97 configMap:
98 name: {{ .Release.Name }}-sdc-environments-configmap
99 defaultMode: 0755
Mandeep Khindaa1047f42018-03-22 02:12:15 +0000100 imagePullSecrets:
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +0000101 - name: "{{ include "common.namespace" . }}-docker-registry-key"