cfc4db0327e200331b17adc0f53f31f9e5399617
[oom.git] / kubernetes / dmaap / 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.name" . }}-{{ .Values.buscontroller.service }}
19   namespace: {{ .Values.global.nsPrefix }}
20   labels:
21     app: {{ include "common.name" . }}-{{ .Values.buscontroller.service }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ .Release.Name }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.buscontroller.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}-{{ .Values.buscontroller.service }}
31         release: {{ .Release.Name }}
32     spec:
33       initContainers:
34 #Example init container for dependency checking
35 #      - command:
36 #        - /root/ready.py
37 #        args:
38 #        - --container-name
39 #        - mariadb
40 #        env:
41 #        - name: NAMESPACE
42 #          valueFrom:
43 #            fieldRef:
44 #              apiVersion: v1
45 #              fieldPath: metadata.namespace
46 #        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
47 #        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48 #        name: {{ include "common.name" . }}-readiness
49       containers:
50         - name: {{ include "common.name" . }}-{{ .Values.buscontroller.service }}
51           image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image.buscontrollerImage }}:{{ .Values.image.buscontrollerVersion }}"
52           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53           ports:
54           - containerPort: {{ .Values.buscontroller.httpExternalPort }}
55 # wait till we get SSL certs before enabling this port
56 #          - containerPort: {{ .Values.buscontroller.httpsPort }}
57           # disable liveness probe when breakpoints set in debugger
58           # so K8s doesn't restart unresponsive container
59           {{- if eq .Values.liveness.enabled true }}
60           livenessProbe:
61             httpGet:
62               port: {{ .Values.buscontroller.httpExternalPort }}
63               path: /webapi/info
64             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
65             periodSeconds: {{ .Values.liveness.periodSeconds }}
66           {{ end -}}
67           readinessProbe:
68             httpGet:
69               port: {{ .Values.buscontroller.httpExternalPort }}
70               path: /webapi/info
71             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
72             periodSeconds: {{ .Values.readiness.periodSeconds }}
73           env:
74 #Example environment variable passed to container
75 #            - name: DEBUG_FLAG
76 #              value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }}
77           volumeMounts:
78           - mountPath: /etc/localtime
79             name: localtime
80             readOnly: true
81           - mountPath: /opt/app/config
82             name: {{ include "common.name" . }}-config
83           resources:
84 {{ toYaml .Values.resources | indent 12 }}
85         {{- if .Values.nodeSelector }}
86         nodeSelector:
87 {{ toYaml .Values.nodeSelector | indent 10 }}
88         {{- end -}}
89         {{- if .Values.affinity }}
90         affinity:
91 {{ toYaml .Values.affinity | indent 10 }}
92         {{- end }}
93
94       volumes:
95         - name: localtime
96           hostPath:
97             path: /etc/localtime
98         - name: {{ include "common.name" . }}-config
99           configMap:
100             name: {{ include "common.fullname" . }}-configmap
101             items:
102             - key: buscontroller.env
103               path: conf
104 #Example config file mount into container
105 #        - name: {{ include "common.fullname" . }}-config
106 #          configMap:
107 #            name: {{ include "common.fullname" . }}-configmap
108 #            items:
109 #            - key: application.properties
110 #              path: application.properties
111       imagePullSecrets:
112       - name: "{{ .Values.global.nsPrefix }}-docker-registry-key"