blob: 1518c5f1e8471afc0e58572e8ad95c6c56a86428 [file] [log] [blame]
vaibhav_16dece04b2fe2018-03-22 09:07:12 +00001# 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
Mike Elliott282a3872018-02-28 09:55:14 -050015apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
31 release: {{ .Release.Name }}
32 spec:
33 initContainers:
34#Example init container for dependency checking
35# - command:
36# - /root/ready.py
37# args:
38# - --container-name
39# - mariadb
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 containers:
50 - name: {{ include "common.name" . }}
Mike Elliott3b6f9802018-04-03 10:23:32 -040051 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Mike Elliott282a3872018-02-28 09:55:14 -050052 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 ports:
54 - containerPort: {{ .Values.service.internalPort }}
55 # disable liveness probe when breakpoints set in debugger
56 # so K8s doesn't restart unresponsive container
Mike Elliott14d6eae2018-04-15 10:39:41 -040057 {{ if .Values.liveness.enabled }}
Mike Elliott282a3872018-02-28 09:55:14 -050058 livenessProbe:
59 tcpSocket:
60 port: {{ .Values.service.internalPort }}
61 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
62 periodSeconds: {{ .Values.liveness.periodSeconds }}
Mike Elliott14d6eae2018-04-15 10:39:41 -040063 {{ end }}
Mike Elliott282a3872018-02-28 09:55:14 -050064 readinessProbe:
65 tcpSocket:
66 port: {{ .Values.service.internalPort }}
67 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
68 periodSeconds: {{ .Values.readiness.periodSeconds }}
69 env:
70#Example environment variable passed to container
71# - name: DEBUG_FLAG
72# value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }}
73 volumeMounts:
74 - mountPath: /etc/localtime
75 name: localtime
76 readOnly: true
77#Example config file mount into container
78# - mountPath: /opt/app/application.properties
79# name: {{ include "common.name" . }}-config
80# subPath: application.properties
81 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000082{{ include "common.resources" . | indent 12 }}
Mike Elliott282a3872018-02-28 09:55:14 -050083 {{- if .Values.nodeSelector }}
84 nodeSelector:
85{{ toYaml .Values.nodeSelector | indent 10 }}
86 {{- end -}}
87 {{- if .Values.affinity }}
88 affinity:
89{{ toYaml .Values.affinity | indent 10 }}
90 {{- end }}
91
92 volumes:
93 - name: localtime
94 hostPath:
95 path: /etc/localtime
96#Example config file mount into container
97# - name: {{ include "common.fullname" . }}-config
98# configMap:
99# name: {{ include "common.fullname" . }}-configmap
100# items:
101# - key: application.properties
102# path: application.properties
103 imagePullSecrets:
kj52dfb132018-03-27 15:50:39 +0300104 - name: "{{ include "common.namespace" . }}-docker-registry-key"