Integration w common/postgres
[oom.git] / kubernetes / dmaap / charts / dmaap-bus-controller / templates / deployment.yaml
1 # Copyright © 2018  AT&T Intellectual Property.  All rights reserved.
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 apiVersion: extensions/v1beta1
16 kind: Deployment
17 metadata:
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 }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ .Release.Name }}
32     spec:
33       initContainers:
34       - command:
35         - /root/ready.py
36         args:
37         - --container-name
38         - {{ .Values.postgres.nameOverride }}
39         env:
40         - name: NAMESPACE
41           valueFrom:
42             fieldRef:
43               apiVersion: v1
44               fieldPath: metadata.namespace
45         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
46         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47         name: {{ include "common.name" . }}-readiness
48       containers:
49         - name: {{ include "common.name" . }}
50           image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image.buscontrollerImage }}:{{ .Values.image.buscontrollerVersion }}"
51           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52           ports:
53           - containerPort: {{ .Values.service.internalPort }}
54           - containerPort: {{ .Values.service.internalPort2 }}
55           {{if eq .Values.liveness.enabled true }}
56           livenessProbe:
57             httpGet:
58               port: {{ .Values.service.internalPort }}
59               path: /webapi/info
60             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
61             periodSeconds: {{ .Values.liveness.periodSeconds }}          
62           readinessProbe:
63             httpGet:
64               port: {{ .Values.service.internalPort }}
65               path: /webapi/info
66             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
67             periodSeconds: {{ .Values.readiness.periodSeconds }}
68           {{ end -}}
69           volumeMounts:
70           - mountPath: /etc/localtime
71             name: localtime
72             readOnly: true
73           - name: {{ include "common.name" . }}-config
74             mountPath: /opt/app/config/conf
75             subPath: buscontroller.env
76           resources:
77 {{ toYaml .Values.resources | indent 12 }}
78         {{- if .Values.nodeSelector }}
79         nodeSelector:
80 {{ toYaml .Values.nodeSelector | indent 10 }}
81         {{- end -}}
82         {{- if .Values.affinity }}
83         affinity:
84 {{ toYaml .Values.affinity | indent 10 }}
85         {{- end }}
86       volumes:
87         - name: localtime
88           hostPath:
89             path: /etc/localtime
90         - name: {{ include "common.name" . }}-config
91           configMap:
92             name: {{ include "common.fullname" . }}-config
93       imagePullSecrets:
94       - name: "{{ include "common.namespace" . }}-docker-registry-key"