blob: 4e1866c8b99619b8566130bdc7c6d26c673c03c6 [file] [log] [blame]
Daniel Silverthorn48f10702018-03-08 10:02:21 -05001# Copyright © 2018 Amdocs, AT&T
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 Bell Canada
Daniel Silverthorn48f10702018-03-08 10:02:21 -05003#
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
16apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
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 }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
32 release: {{ .Release.Name }}
33 spec:
michaere1bd45e12018-10-29 14:23:55 +000034 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
Daniel Silverthorn48f10702018-03-08 10:02:21 -050049 containers:
50 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000051 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Daniel Silverthorn48f10702018-03-08 10:02:21 -050052 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
kj05b57f82018-03-28 18:10:32 +030057 {{ if .Values.liveness.enabled }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050058 livenessProbe:
59 tcpSocket:
60 port: {{ .Values.service.internalPort }}
61 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
62 periodSeconds: {{ .Values.liveness.periodSeconds }}
kj05b57f82018-03-28 18:10:32 +030063 {{ end }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -050064 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"
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +000074 - 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
Daniel Silverthorn48f10702018-03-08 10:02:21 -050084 - 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
Shwetank Daveb4333f92018-08-14 09:55:46 -040098 - mountPath: /opt/app/champ-service/bundleconfig/etc/logback.xml
99 name: {{ include "common.fullname" . }}-logback-config
100 subPath: logback.xml
Michael Arrastia1149a062018-09-17 15:12:45 +0100101 - mountPath: /var/log/onap
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500102 name: {{ include "common.fullname" . }}-logs
103 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000104{{ include "common.resources" . | indent 12 }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500105 {{- 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
Michael Arrastia1149a062018-09-17 15:12:45 +0100114 # 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
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500127 volumes:
128 - name: localtime
129 hostPath:
130 path: /etc/localtime
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500131 - name: {{ include "common.fullname" . }}-config
132 configMap:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000133 name: {{ include "common.fullname" . }}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500134 items:
135 - key: champ-api.properties
136 path: champ-api.properties
137 - name: {{ include "common.fullname" . }}-secrets
138 secret:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000139 secretName: {{ include "common.fullname" . }}-champ
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500140 - name: {{ include "common.fullname" . }}-dynamic-config
141 configMap:
Daniel Silverthorn82cee4d2018-03-28 19:18:19 +0000142 name: {{ include "common.fullname" . }}-dynamic
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500143 items:
144 - key: champ-beans.xml
145 path: champ-beans.xml
146 - name: {{ include "common.fullname" . }}-logs
147 emptyDir: {}
Shwetank Daveb4333f92018-08-14 09:55:46 -0400148 - 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
Michael Arrastia1149a062018-09-17 15:12:45 +0100154 - name: filebeat-conf
155 configMap:
156 name: aai-filebeat
157 - name: aai-filebeat
158 emptyDir: {}
Daniel Silverthorn48f10702018-03-08 10:02:21 -0500159 imagePullSecrets:
160 - name: "{{ include "common.namespace" . }}-docker-registry-key"