Merge "Remove controller blueprint chart"
[oom.git] / kubernetes / dmaap / components / dmaap-bc / templates / deployment.yaml
1
2 # Modifications Copyright © 2018 Amdocs,Bell Canada
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
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     spec:
34       initContainers:
35 {{- if .Values.global.aafEnabled }}
36       - command:
37         - /root/ready.py
38         args:
39         - --container-name
40         - aaf-locate
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" . }}-aaf-readiness
50 {{- end }}
51 {{- if .Values.PG.enabled }}
52       - command:
53         - /root/ready.py
54         args:
55         - --container-name
56         - {{ .Values.postgres.nameOverride }}
57         env:
58         - name: NAMESPACE
59           valueFrom:
60             fieldRef:
61               apiVersion: v1
62               fieldPath: metadata.namespace
63         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
64         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65         name: {{ include "common.name" . }}-postgres-readiness
66 {{- end}}
67       containers:
68         - name: {{ include "common.name" . }}
69           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
70           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71           ports:
72           - containerPort: {{ .Values.service.internalPort }}
73           - containerPort: {{ .Values.service.internalPort2 }}
74           {{ if eq .Values.liveness.enabled true -}}
75           livenessProbe:
76             httpGet:
77               port: {{ .Values.service.internalPort }}
78               path: /webapi/info
79             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
80             periodSeconds: {{ .Values.liveness.periodSeconds }}
81           readinessProbe:
82             httpGet:
83               host: {{ .Values.dmaapMessageRouterService }}
84               port: 3904
85               path: /topics
86             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
87             periodSeconds: {{ .Values.readiness.periodSeconds }}
88           {{ end -}}
89           volumeMounts:
90           - mountPath: /etc/localtime
91             name: localtime
92             readOnly: true
93 # NOTE: on the following several configMaps, careful to include / at end
94 #       since there may be more than one file in each mountPath
95           - name: {{ include "common.name" . }}-config
96             mountPath: /opt/app/config/conf/
97           - name: {{ include "common.name" . }}-aaf-config
98             mountPath: /opt/app/dmaapbc/etc/org.onap.dmaap-bc.props
99             subPath: org.onap.dmaap-bc.props
100           resources:
101 {{ include "common.resources" . }}
102         {{- if .Values.nodeSelector }}
103         nodeSelector:
104 {{ toYaml .Values.nodeSelector | indent 10 }}
105         {{- end -}}
106         {{- if .Values.affinity }}
107         affinity:
108 {{ toYaml .Values.affinity | indent 10 }}
109         {{- end }}
110       volumes:
111         - name: localtime
112           hostPath:
113             path: /etc/localtime
114         - name: {{ include "common.name" . }}-config
115           configMap:
116             name: {{ include "common.fullname" . }}-config
117         - name: {{ include "common.name" . }}-aaf-config
118           configMap:
119             name: {{ include "common.fullname" . }}-aaf-config
120       imagePullSecrets:
121       - name: "{{ include "common.namespace" . }}-docker-registry-key"