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