blob: 6216758749ac0f615bf602520d02396688885e5e [file] [log] [blame]
kj6a8ce802018-03-19 15:07:44 +02001apiVersion: extensions/v1beta1
2kind: Deployment
3metadata:
4 name: {{ include "common.fullname" . }}
5 namespace: {{ include "common.namespace" . }}
6 labels:
7 app: {{ include "common.name" . }}
8 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9 release: {{ .Release.Name }}
10 heritage: {{ .Release.Service }}
11spec:
12 replicas: {{ .Values.replicaCount }}
13 template:
14 metadata:
15 labels:
16 app: {{ include "common.name" . }}
17 name: {{ .Release.Name }}
18 spec:
19 initContainers:
20 - command:
21 - /root/ready.py
22 args:
23 - --container-name
24 - aai-traversal
25 env:
26 - name: NAMESPACE
27 valueFrom:
28 fieldRef:
29 apiVersion: v1
30 fieldPath: metadata.namespace
31 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
32 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33 name: {{ include "common.name" . }}-readiness
34 containers:
35 - name: {{ include "common.name" . }}
36 image: "{{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}"
37 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 volumeMounts:
39 - mountPath: /etc/localtime
40 name: localtime
41 readOnly: true
42 - mountPath: /dev/log
43 name: aai-service-log
44 - mountPath: /usr/local/etc/haproxy/haproxy.cfg
45 subPath: haproxy.cfg
46 name: haproxy-cfg
47 ports:
48 - containerPort: {{ .Values.service.internalPort }}
49 - containerPort: {{ .Values.service.internalPort2 }}
50 # disable liveness probe when breakpoints set in debugger
51 # so K8s doesn't restart unresponsive container
52 {{- if eq .Values.liveness.enabled true }}
53 livenessProbe:
54 tcpSocket:
55 port: {{ .Values.service.internalPort2 }}
56 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
57 periodSeconds: {{ .Values.liveness.periodSeconds }}
58 {{ end -}}
59 readinessProbe:
60 tcpSocket:
61 port: {{ .Values.service.internalPort2 }}
62 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
63 periodSeconds: {{ .Values.readiness.periodSeconds }}
64 resources:
65{{ toYaml .Values.resources | indent 12 }}
66 {{- if .Values.nodeSelector }}
67 nodeSelector:
68{{ toYaml .Values.nodeSelector | indent 10 }}
69 {{- end -}}
70 {{- if .Values.affinity }}
71 affinity:
72{{ toYaml .Values.affinity | indent 10 }}
73 {{- end }}
74
75 volumes:
76 - name: localtime
77 hostPath:
78 path: /etc/localtime
79 - name: aai-service-log
80 hostPath:
81 path: "/dev/log"
82 - name: haproxy-cfg
83 configMap:
84 name: aai-deployment-configmap
85 imagePullSecrets:
86 - name: "{{ include "common.namespace" . }}-docker-registry-key"