blob: 3f16e25ffddf8ce6af582321f1cd49df17cc6bb1 [file] [log] [blame]
toshrajbhardwajf4fc1c62018-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
kj9bf27312018-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-Lavalle3d8a6a12018-08-07 21:31:05 -040032 release: {{ .Release.Name }}
kj9bf27312018-03-19 15:07:44 +020033 name: {{ .Release.Name }}
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -040034 annotations:
35 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
kj9bf27312018-03-19 15:07:44 +020036 spec:
37 initContainers:
38 - command:
39 - /root/ready.py
40 args:
41 - --container-name
Kajur, Harish (vk250x)76987da2018-10-18 22:51:43 -040042 - aai-resources
43 - --container-name
kj9bf27312018-03-19 15:07:44 +020044 - aai-traversal
Kajur, Harish (vk250x)76987da2018-10-18 22:51:43 -040045 - --container-name
46 - aai-graphadmin
kj9bf27312018-03-19 15:07:44 +020047 env:
48 - name: NAMESPACE
49 valueFrom:
50 fieldRef:
51 apiVersion: v1
52 fieldPath: metadata.namespace
53 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 name: {{ include "common.name" . }}-readiness
56 containers:
57 - name: {{ include "common.name" . }}
58 image: "{{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}"
59 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 volumeMounts:
61 - mountPath: /etc/localtime
62 name: localtime
63 readOnly: true
64 - mountPath: /dev/log
65 name: aai-service-log
66 - mountPath: /usr/local/etc/haproxy/haproxy.cfg
67 subPath: haproxy.cfg
68 name: haproxy-cfg
69 ports:
70 - containerPort: {{ .Values.service.internalPort }}
71 - containerPort: {{ .Values.service.internalPort2 }}
72 # disable liveness probe when breakpoints set in debugger
73 # so K8s doesn't restart unresponsive container
74 {{- if eq .Values.liveness.enabled true }}
75 livenessProbe:
76 tcpSocket:
77 port: {{ .Values.service.internalPort2 }}
78 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.liveness.periodSeconds }}
80 {{ end -}}
81 readinessProbe:
Kajur, Harish (vk250x)76987da2018-10-18 22:51:43 -040082 httpGet:
83 path: /aai/util/echo
kj9bf27312018-03-19 15:07:44 +020084 port: {{ .Values.service.internalPort2 }}
Kajur, Harish (vk250x)76987da2018-10-18 22:51:43 -040085 scheme: HTTPS
86 httpHeaders:
87 - name: X-FromAppId
88 value: OOM_ReadinessCheck
89 - name: X-TransactionId
90 value: {{ uuidv4 }}
91 - name: Accept
92 value: application/json
kj9bf27312018-03-19 15:07:44 +020093 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.readiness.periodSeconds }}
95 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000096{{ include "common.resources" . | indent 12 }}
kj9bf27312018-03-19 15:07:44 +020097 {{- if .Values.nodeSelector }}
98 nodeSelector:
99{{ toYaml .Values.nodeSelector | indent 10 }}
100 {{- end -}}
101 {{- if .Values.affinity }}
102 affinity:
103{{ toYaml .Values.affinity | indent 10 }}
104 {{- end }}
105
106 volumes:
107 - name: localtime
108 hostPath:
109 path: /etc/localtime
110 - name: aai-service-log
111 hostPath:
112 path: "/dev/log"
113 - name: haproxy-cfg
114 configMap:
115 name: aai-deployment-configmap
116 imagePullSecrets:
117 - name: "{{ include "common.namespace" . }}-docker-registry-key"