blob: b9de92bb28c07bf6246b8a3fd3b857173e28d47e [file] [log] [blame]
kj9bf27312018-03-19 15:07:44 +02001# 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
15apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
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: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 selector:
28 matchLabels:
29 app: {{ include "common.name" . }}
30 template:
31 metadata:
32 labels:
33 app: {{ include "common.name" . }}
34 release: {{ .Release.Name }}
35 name: {{ include "common.name" . }}
36 spec:
Arul.Nambib8c668f2018-07-17 16:02:30 -040037 initContainers:
38 - command:
39 - /root/ready.py
40 args:
41 - --container-name
42 - aai-elasticsearch
43 - --container-name
44 - aai-search-data
45 - --container-name
46 - aai
47 env:
48 - name: NAMESPACE
49 valueFrom:
50 fieldRef:
51 apiVersion: v1
52 fieldPath: metadata.namespace
53 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 name: {{ include "common.name" . }}-readiness
kj9bf27312018-03-19 15:07:44 +020056 containers:
57 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000058 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
kj9bf27312018-03-19 15:07:44 +020059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 env:
61 - name: CONFIG_HOME
Keren Joseph5689d5f2018-04-22 15:22:46 +030062 value: /opt/app/sparky/appconfig/
63 - name: KEYSTORE_ALIAS_PASSWORD
64 value: {{ .Values.config.keystoreAliasPassword }}
65 - name: KEYSTORE_PASSWORD
kj9bf27312018-03-19 15:07:44 +020066 value: {{ .Values.config.keyStorePassword }}
Keren Joseph5689d5f2018-04-22 15:22:46 +030067 - name: SPARKY_SSL_ENABLED
Arul.Nambi89c02792018-06-20 11:40:17 -040068 value: 'false'
Keren Joseph5689d5f2018-04-22 15:22:46 +030069 - name: SPARKY_PORTAL_ENABLED
70 value: 'false'
kj9bf27312018-03-19 15:07:44 +020071 volumeMounts:
72 - mountPath: /etc/localtime
73 name: localtime
74 readOnly: true
Keren Joseph5689d5f2018-04-22 15:22:46 +030075 - mountPath: /opt/app/sparky/appconfig/auth/
kj9bf27312018-03-19 15:07:44 +020076 name: {{ include "common.fullname" . }}-auth-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030077 - mountPath: /opt/app/sparky/appconfig/camel-rests/
78 name: {{ include "common.fullname" . }}-camel-rests-config
79 - mountPath: /opt/app/sparky/appconfig/descriptors/
80 name: {{ include "common.fullname" . }}-descriptors-config
81 - mountPath: /opt/app/sparky/appconfig/filters/
82 name: {{ include "common.fullname" . }}-filters-config
83 - mountPath: /opt/app/sparky/appconfig/
kj9bf27312018-03-19 15:07:44 +020084 name: {{ include "common.fullname" . }}-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030085 - mountPath: /opt/app/sparky/appconfig/portal
kj9bf27312018-03-19 15:07:44 +020086 name: {{ include "common.fullname" . }}-portal-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030087 - mountPath: /opt/app/sparky/appconfig/portal/BOOT-INF/classes
88 name: {{ include "common.fullname" . }}-portal-boot-inf-config
89 - mountPath: /opt/app/sparky/appconfig/schemas
90 name: {{ include "common.fullname" . }}-schemas-config
91 - mountPath: /opt/app/sparky/appconfig/spring-beans/
92 name: {{ include "common.fullname" . }}-spring-beans-config
kj9bf27312018-03-19 15:07:44 +020093 - mountPath: /var/log/onap
94 name: {{ include "common.fullname" . }}-logs
Keren Joseph5689d5f2018-04-22 15:22:46 +030095 - mountPath: /opt/app/sparky/appconfig/logging/
kj9bf27312018-03-19 15:07:44 +020096 name: {{ include "common.fullname" . }}-log-conf
kj9bf27312018-03-19 15:07:44 +020097 ports:
98 - containerPort: {{ .Values.service.internalPort }}
Keren Joseph5689d5f2018-04-22 15:22:46 +030099 - containerPort: {{ .Values.service.internalPort2 }}
kj9bf27312018-03-19 15:07:44 +0200100 # disable liveness probe when breakpoints set in debugger
101 # so K8s doesn't restart unresponsive container
102 {{- if eq .Values.liveness.enabled true }}
103 livenessProbe:
104 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400105 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200106 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
107 periodSeconds: {{ .Values.liveness.periodSeconds }}
108 {{ end -}}
109 readinessProbe:
110 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400111 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200112 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
113 periodSeconds: {{ .Values.readiness.periodSeconds }}
114 resources:
115{{ toYaml .Values.resources | indent 10 }}
116 {{- if .Values.nodeSelector }}
117 nodeSelector:
118{{ toYaml .Values.nodeSelector | indent 8 }}
119 {{- end -}}
120 {{- if .Values.affinity }}
121 affinity:
122{{ toYaml .Values.affinity | indent 8 }}
123 {{- end }}
124
125 # side car containers
126 - name: filebeat-onap
127 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
128 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
129 volumeMounts:
130 - mountPath: /usr/share/filebeat/filebeat.yml
131 subPath: filebeat.yml
132 name: filebeat-conf
133 - mountPath: /var/log/onap
134 name: {{ include "common.fullname" . }}-logs
135 - mountPath: /usr/share/filebeat/data
136 name: aai-sparky-filebeat
137
138 volumes:
139 - name: localtime
140 hostPath:
141 path: /etc/localtime
142 - name: {{ include "common.fullname" . }}-config
143 configMap:
144 name: {{ include "common.fullname" . }}
kj9bf27312018-03-19 15:07:44 +0200145 - name: {{ include "common.fullname" . }}-auth-config
146 secret:
147 secretName: {{ include "common.fullname" . }}
Keren Joseph5689d5f2018-04-22 15:22:46 +0300148 - name: {{ include "common.fullname" . }}-camel-rests-config
149 configMap:
150 name: {{ include "common.fullname" . }}-camel-rests
151 - name: {{ include "common.fullname" . }}-descriptors-config
152 configMap:
153 name: {{ include "common.fullname" . }}-descriptors
154 - name: {{ include "common.fullname" . }}-filters-config
155 configMap:
156 name: {{ include "common.fullname" . }}-filters
157 - name: {{ include "common.fullname" . }}-portal-config
158 configMap:
159 name: {{ include "common.fullname" . }}-portal
160 - name: {{ include "common.fullname" . }}-portal-boot-inf-config
161 configMap:
162 name: {{ include "common.fullname" . }}-boot-inf
163 - name: {{ include "common.fullname" . }}-schemas-config
164 configMap:
165 name: {{ include "common.fullname" . }}-schemas
166 - name: {{ include "common.fullname" . }}-spring-beans-config
167 configMap:
168 name: {{ include "common.fullname" . }}-spring-beans
kj9bf27312018-03-19 15:07:44 +0200169 - name: filebeat-conf
170 configMap:
171 name: aai-filebeat
172 - name: {{ include "common.fullname" . }}-logs
173 emptyDir: {}
174 - name: aai-sparky-filebeat
175 emptyDir: {}
176 - name: {{ include "common.fullname" . }}-log-conf
177 configMap:
Keren Joseph5689d5f2018-04-22 15:22:46 +0300178 name: {{ include "common.fullname" . }}-log
kj9bf27312018-03-19 15:07:44 +0200179 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
180 imagePullSecrets:
181 - name: "{{ include "common.namespace" . }}-docker-registry-key"