Updating charts to use common resource template
[oom.git] / kubernetes / dmaap / charts / dmaap-data-router / charts / dmaap-dr-node / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
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 apiVersion: extensions/v1beta1
15 kind: Deployment
16 metadata:
17   name: {{ include "common.fullname" . }}
18   namespace: {{ include "common.namespace" . }}
19   labels:
20     app: {{ include "common.name" . }}
21     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
22     release: {{ .Release.Name }}
23     heritage: {{ .Release.Service }}
24 spec:
25   replicas: {{ .Values.replicaCount }}
26   template:
27     metadata:
28       labels:
29         app: {{ include "common.name" . }}
30         release: {{ .Release.Name }}
31     spec:
32       hostname: {{.Values.global.config.dmaapDrNode.name}}
33       initContainers:
34         - name: {{ include "common.name" . }}-readiness
35           image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37           command:
38           - /root/ready.py
39           args:
40           - --container-name
41           - {{.Values.global.config.dmaapDrProv.name}}
42           env:
43           - name: NAMESPACE
44             valueFrom:
45               fieldRef:
46                 apiVersion: v1
47                 fieldPath: metadata.namespace
48       containers:
49         - name: {{ include "common.name" . }}
50           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52           ports:
53           - containerPort: {{.Values.global.config.dmaapDrNode.externalPort}}
54           - containerPort: {{.Values.global.config.dmaapDrNode.externalPort2}}
55           {{- if eq .Values.liveness.enabled true }}
56           livenessProbe:
57             tcpSocket:
58               port: {{.Values.global.config.dmaapDrNode.internalPort}}
59             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.liveness.periodSeconds }}
61           {{ end -}}
62           readinessProbe:
63             tcpSocket:
64               port: {{.Values.global.config.dmaapDrNode.internalPort}}
65             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66             periodSeconds: {{ .Values.readiness.periodSeconds }}
67           volumeMounts:
68           - mountPath: /etc/localtime
69             name: localtime
70             readOnly: false
71           - mountPath: /opt/app/datartr/etc/dedicatedFeed.json
72             subPath: dedicatedFeed.json
73             name: create-feed
74           - mountPath: /opt/app/datartr/etc/createFeed.sh
75             subPath: createFeed.sh
76             name: create-feed
77           - mountPath: /opt/app/datartr/etc/node.properties
78             subPath: node.properties
79             name: node-props
80           lifecycle:
81             postStart:
82               exec:
83                 command:
84                 - /opt/app/datartr/etc/createFeed.sh
85           resources:
86 {{ include "common.resources" . | indent 12 }}
87         {{- if .Values.nodeSelector }}
88         nodeSelector:
89 {{ toYaml .Values.nodeSelector | indent 10 }}
90         {{- end -}}
91         {{- if .Values.affinity }}
92         affinity:
93 {{ toYaml .Values.affinity | indent 10 }}
94         {{- end }}
95       volumes:
96       - name: localtime
97         hostPath:
98           path: /etc/localtime
99       - name: create-feed
100         configMap:
101           name: {{ include "common.fullname" . }}-create-feed-configmap
102           defaultMode: 0755
103       - name: node-props
104         configMap:
105           name: {{ include "common.fullname" . }}-node-props-configmap
106       - name: dr-node-data
107       {{- if .Values.persistence.enabled }}
108         persistentVolumeClaim:
109           claimName: {{ include "common.fullname" . }}
110       {{- else }}
111         emptyDir: {}
112       {{- end }}
113     imagePullSecrets:
114     - name: "{{ include "common.namespace" . }}-docker-registry-key"