Merge "[SDC] Change default access mode for cert PVC"
[oom.git] / kubernetes / dmaap / components / dmaap-bc / templates / deployment.yaml
1 # Modifications Copyright © 2018 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
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: {{ include "common.release" . }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ include "common.release" . }}
32     spec:
33       initContainers:
34 {{- if .Values.global.aafEnabled }}
35       - command:
36         - /root/ready.py
37         args:
38         - --container-name
39         - aaf-locate
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" . }}-aaf-readiness
49       - name: {{ include "common.name" . }}-dbc-aaf-config
50         image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}"
51         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52         command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
53         volumeMounts:
54         - mountPath: {{ .Values.persistence.aafCredsPath }}
55           name: {{ include "common.name" . }}-aaf-config
56         env:
57         - name: APP_FQI
58           value: "{{ .Values.aafConfig.fqi }}"
59         - name: aaf_locate_url
60           value: "https://aaf-locate.{{ .Release.Namespace }}:8095"
61         - name: aaf_locator_container
62           value: "{{ .Values.global.aafLocatorContainer }}"
63         - name: aaf_locator_container_ns
64           value: "{{ .Release.Namespace }}"
65         - name: aaf_locator_fqdn
66           value: "{{ .Values.aafConfig.fqdn }}"
67         - name: aaf_locator_public_fqdn
68           value: "{{.Values.aafConfig.publicFqdn}}"
69         - name: aaf_locator_app_ns
70           value: "{{ .Values.global.aafAppNs }}"
71         - name: DEPLOY_FQI
72           value: "{{ .Values.aafConfig.aafDeployFqi }}"
73         - name: DEPLOY_PASSWORD
74           valueFrom:
75             secretKeyRef:
76               name: {{ include "common.fullname" . }}-secret
77               key: aaf-deploy-password
78         - name: cadi_longitude
79           value: "{{ .Values.aafConfig.cadiLongitude }}"
80         - name: cadi_latitude
81           value: "{{ .Values.aafConfig.cadiLatitude }}"
82 {{- end }}
83 {{- if .Values.PG.enabled }}
84       - command:
85         - /root/ready.py
86         args:
87         - --container-name
88         - {{ .Values.postgres.nameOverride }}
89         env:
90         - name: NAMESPACE
91           valueFrom:
92             fieldRef:
93               apiVersion: v1
94               fieldPath: metadata.namespace
95         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
96         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
97         name: {{ include "common.name" . }}-postgres-readiness
98 {{- end}}
99       containers:
100         - name: {{ include "common.name" . }}
101           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
102           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
103           ports:
104           - containerPort: {{ .Values.service.internalPort }}
105           - containerPort: {{ .Values.service.internalPort2 }}
106           {{ if eq .Values.liveness.enabled true -}}
107           livenessProbe:
108             httpGet:
109               port: {{ .Values.service.internalPort }}
110               path: /webapi/info
111             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
112             periodSeconds: {{ .Values.liveness.periodSeconds }}
113           readinessProbe:
114             httpGet:
115               host: {{ .Values.dmaapMessageRouterService }}
116               port: 3904
117               path: /topics
118             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
119             periodSeconds: {{ .Values.readiness.periodSeconds }}
120           {{ end -}}
121           volumeMounts:
122           - mountPath: /etc/localtime
123             name: localtime
124             readOnly: true
125 # NOTE: on the following several configMaps, careful to include / at end
126 #       since there may be more than one file in each mountPath
127           - name: {{ include "common.name" . }}-config
128             mountPath: /opt/app/config/conf/
129           - name: {{ include "common.name" . }}-aaf-config
130             mountPath: /opt/app/dmaapbc/etc/org.onap.dmaap-bc.props
131             subPath: org.onap.dmaap-bc.props
132           resources:
133 {{ include "common.resources" . }}
134         {{- if .Values.nodeSelector }}
135         nodeSelector:
136 {{ toYaml .Values.nodeSelector | indent 10 }}
137         {{- end -}}
138         {{- if .Values.affinity }}
139         affinity:
140 {{ toYaml .Values.affinity | indent 10 }}
141         {{- end }}
142       volumes:
143         - name: localtime
144           hostPath:
145             path: /etc/localtime
146         - name: {{ include "common.name" . }}-config
147           configMap:
148             name: {{ include "common.fullname" . }}-config
149         - name: {{ include "common.name" . }}-aaf-config
150           configMap:
151             name: {{ include "common.fullname" . }}-aaf-config
152       imagePullSecrets:
153       - name: "{{ include "common.namespace" . }}-docker-registry-key"