blob: dc65cef1871d51c7815c60ae52c1c27f656b81e6 [file] [log] [blame]
toshrajbhardwaj84d73b12018-08-06 07:35:14 +00001# Copyright © 2018 Amdocs, Bell Canada, AT&T
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
kj6a8ce802018-03-19 15:07:44 +020016apiVersion: 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" . }}
Hector Anapan-Lavalle10529e62018-08-07 21:31:05 -040032 release: {{ .Release.Name }}
kj6a8ce802018-03-19 15:07:44 +020033 name: {{ .Release.Name }}
Kajur, Harish (vk250x)41a435d2018-09-06 14:44:40 -040034 annotations:
35 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
kj6a8ce802018-03-19 15:07:44 +020036 spec:
37 initContainers:
38 - command:
39 - /root/ready.py
40 args:
41 - --container-name
42 - aai-traversal
43 env:
44 - name: NAMESPACE
45 valueFrom:
46 fieldRef:
47 apiVersion: v1
48 fieldPath: metadata.namespace
49 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
50 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51 name: {{ include "common.name" . }}-readiness
52 containers:
53 - name: {{ include "common.name" . }}
54 image: "{{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}"
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 volumeMounts:
57 - mountPath: /etc/localtime
58 name: localtime
59 readOnly: true
60 - mountPath: /dev/log
61 name: aai-service-log
62 - mountPath: /usr/local/etc/haproxy/haproxy.cfg
63 subPath: haproxy.cfg
64 name: haproxy-cfg
65 ports:
66 - containerPort: {{ .Values.service.internalPort }}
67 - containerPort: {{ .Values.service.internalPort2 }}
68 # disable liveness probe when breakpoints set in debugger
69 # so K8s doesn't restart unresponsive container
70 {{- if eq .Values.liveness.enabled true }}
71 livenessProbe:
72 tcpSocket:
73 port: {{ .Values.service.internalPort2 }}
74 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.liveness.periodSeconds }}
76 {{ end -}}
77 readinessProbe:
78 tcpSocket:
79 port: {{ .Values.service.internalPort2 }}
80 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.readiness.periodSeconds }}
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
93 volumes:
94 - name: localtime
95 hostPath:
96 path: /etc/localtime
97 - name: aai-service-log
98 hostPath:
99 path: "/dev/log"
100 - name: haproxy-cfg
101 configMap:
102 name: aai-deployment-configmap
103 imagePullSecrets:
104 - name: "{{ include "common.namespace" . }}-docker-registry-key"