Merge "Add dupliate ssl.key lines to aaiclient.prop file"
[oom.git] / kubernetes / aai / charts / aai-champ / templates / deployment.yaml
1 # Copyright © 2018 Amdocs, AT&T
2 # Modifications Copyright © 2018 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         - command:
36           - /root/ready.py
37           args:
38           - --container-name
39           - aai-cassandra
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" . }}
51           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
52           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53           ports:
54           - containerPort: {{ .Values.service.internalPort }}
55           # disable liveness probe when breakpoints set in debugger
56           # so K8s doesn't restart unresponsive container
57           {{ if .Values.liveness.enabled }}
58           livenessProbe:
59             tcpSocket:
60               port: {{ .Values.service.internalPort }}
61             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
62             periodSeconds: {{ .Values.liveness.periodSeconds }}
63           {{ end }}
64           readinessProbe:
65             tcpSocket:
66               port: {{ .Values.service.internalPort }}
67             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
68             periodSeconds: {{ .Values.readiness.periodSeconds }}
69           env:
70             - name: CONFIG_HOME
71               value: "/opt/app/champ-service/appconfig"
72             - name: GRAPHIMPL
73               value: "janus-deps"
74             - name: KEY_STORE_PASSWORD
75               valueFrom:
76                 secretKeyRef:
77                   name: {{ template "common.fullname" . }}-pass
78                   key: KEY_STORE_PASSWORD
79             - name: KEY_MANAGER_PASSWORD
80               valueFrom:
81                 secretKeyRef:
82                   name: {{ template "common.fullname" . }}-pass
83                   key: KEY_MANAGER_PASSWORD
84             - name: SERVICE_BEANS
85               value: "/opt/app/champ-service/dynamic/conf"
86           volumeMounts:
87           - mountPath: /etc/localtime
88             name: localtime
89             readOnly: true
90           - mountPath: /opt/app/champ-service/appconfig/champ-api.properties
91             name: {{ include "common.fullname" . }}-config
92             subPath: champ-api.properties
93           - mountPath: /opt/app/champ-service/appconfig/auth
94             name: {{ include "common.fullname" . }}-secrets
95           - mountPath: /opt/app/champ-service/dynamic/conf/champ-beans.xml
96             name: {{ include "common.fullname" . }}-dynamic-config
97             subPath: champ-beans.xml
98           - mountPath: /opt/app/champ-service/bundleconfig/etc/logback.xml
99             name: {{ include "common.fullname" . }}-logback-config
100             subPath: logback.xml
101           - mountPath: /var/log/onap
102             name: {{ include "common.fullname" . }}-logs
103           resources:
104 {{ include "common.resources" . | indent 12 }}
105         {{- if .Values.nodeSelector }}
106         nodeSelector:
107 {{ toYaml .Values.nodeSelector | indent 10 }}
108         {{- end -}}
109         {{- if .Values.affinity }}
110         affinity:
111 {{ toYaml .Values.affinity | indent 10 }}
112         {{- end }}
113
114         # side car containers
115         - name: filebeat-onap
116           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
117           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
118           volumeMounts:
119           - mountPath: /usr/share/filebeat/filebeat.yml
120             subPath: filebeat.yml
121             name: filebeat-conf
122           - mountPath: /var/log/onap
123             name: {{ include "common.fullname" . }}-logs
124           - mountPath: /usr/share/filebeat/data
125             name: aai-filebeat
126
127       volumes:
128         - name: localtime
129           hostPath:
130             path: /etc/localtime
131         - name: {{ include "common.fullname" . }}-config
132           configMap:
133             name: {{ include "common.fullname" . }}
134             items:
135             - key: champ-api.properties
136               path: champ-api.properties
137         - name: {{ include "common.fullname" . }}-secrets
138           secret:
139             secretName: {{ include "common.fullname" . }}-champ
140         - name: {{ include "common.fullname" . }}-dynamic-config
141           configMap:
142             name: {{ include "common.fullname" . }}-dynamic
143             items:
144             - key: champ-beans.xml
145               path: champ-beans.xml
146         - name: {{ include "common.fullname" . }}-logs
147           emptyDir: {}
148         - name: {{ include "common.fullname" . }}-logback-config
149           configMap:
150             name: {{ include "common.fullname" . }}-log-configmap
151             items:
152             - key: logback.xml
153               path: logback.xml
154         - name: filebeat-conf
155           configMap:
156             name: aai-filebeat
157         - name: aai-filebeat
158           emptyDir: {}
159       imagePullSecrets:
160       - name: "{{ include "common.namespace" . }}-docker-registry-key"