Add graphadmin microservice to oom
[oom.git] / kubernetes / aai / templates / deployment.yaml
1 # 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
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
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 }}
26 spec:
27   replicas: {{ .Values.replicaCount }}
28   template:
29     metadata:
30       labels:
31         app: {{ include "common.name" . }}
32         release: {{ .Release.Name }}
33       name: {{ .Release.Name }}
34       annotations:
35         checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
36     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"