blob: 9bc055ae4c887d4475901ec8f3f26f99c9d69eda [file] [log] [blame]
kj9bf27312018-03-19 15:07:44 +02001# Copyright © 2017 Amdocs, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 AT&T
kj9bf27312018-03-19 15:07:44 +02003#
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 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
35 release: {{ .Release.Name }}
36 name: {{ include "common.name" . }}
37 spec:
Arul.Nambib8c668f2018-07-17 16:02:30 -040038 initContainers:
39 - command:
40 - /root/ready.py
41 args:
42 - --container-name
43 - aai-elasticsearch
44 - --container-name
45 - aai-search-data
46 - --container-name
47 - aai
48 env:
49 - name: NAMESPACE
50 valueFrom:
51 fieldRef:
52 apiVersion: v1
53 fieldPath: metadata.namespace
54 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 name: {{ include "common.name" . }}-readiness
kj9bf27312018-03-19 15:07:44 +020057 containers:
58 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000059 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
kj9bf27312018-03-19 15:07:44 +020060 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
61 env:
62 - name: CONFIG_HOME
Keren Joseph5689d5f2018-04-22 15:22:46 +030063 value: /opt/app/sparky/appconfig/
64 - name: KEYSTORE_ALIAS_PASSWORD
65 value: {{ .Values.config.keystoreAliasPassword }}
66 - name: KEYSTORE_PASSWORD
kj9bf27312018-03-19 15:07:44 +020067 value: {{ .Values.config.keyStorePassword }}
Keren Joseph5689d5f2018-04-22 15:22:46 +030068 - name: SPARKY_SSL_ENABLED
Arul.Nambi89c02792018-06-20 11:40:17 -040069 value: 'false'
Keren Joseph5689d5f2018-04-22 15:22:46 +030070 - name: SPARKY_PORTAL_ENABLED
71 value: 'false'
kj9bf27312018-03-19 15:07:44 +020072 volumeMounts:
73 - mountPath: /etc/localtime
74 name: localtime
75 readOnly: true
Keren Joseph5689d5f2018-04-22 15:22:46 +030076 - mountPath: /opt/app/sparky/appconfig/auth/
kj9bf27312018-03-19 15:07:44 +020077 name: {{ include "common.fullname" . }}-auth-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030078 - mountPath: /opt/app/sparky/appconfig/camel-rests/
79 name: {{ include "common.fullname" . }}-camel-rests-config
80 - mountPath: /opt/app/sparky/appconfig/descriptors/
81 name: {{ include "common.fullname" . }}-descriptors-config
82 - mountPath: /opt/app/sparky/appconfig/filters/
83 name: {{ include "common.fullname" . }}-filters-config
84 - mountPath: /opt/app/sparky/appconfig/
kj9bf27312018-03-19 15:07:44 +020085 name: {{ include "common.fullname" . }}-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030086 - mountPath: /opt/app/sparky/appconfig/portal
kj9bf27312018-03-19 15:07:44 +020087 name: {{ include "common.fullname" . }}-portal-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030088 - mountPath: /opt/app/sparky/appconfig/portal/BOOT-INF/classes
89 name: {{ include "common.fullname" . }}-portal-boot-inf-config
90 - mountPath: /opt/app/sparky/appconfig/schemas
91 name: {{ include "common.fullname" . }}-schemas-config
92 - mountPath: /opt/app/sparky/appconfig/spring-beans/
93 name: {{ include "common.fullname" . }}-spring-beans-config
kj9bf27312018-03-19 15:07:44 +020094 - mountPath: /var/log/onap
95 name: {{ include "common.fullname" . }}-logs
Keren Joseph5689d5f2018-04-22 15:22:46 +030096 - mountPath: /opt/app/sparky/appconfig/logging/
kj9bf27312018-03-19 15:07:44 +020097 name: {{ include "common.fullname" . }}-log-conf
kj9bf27312018-03-19 15:07:44 +020098 ports:
99 - containerPort: {{ .Values.service.internalPort }}
Keren Joseph5689d5f2018-04-22 15:22:46 +0300100 - containerPort: {{ .Values.service.internalPort2 }}
kj9bf27312018-03-19 15:07:44 +0200101 # disable liveness probe when breakpoints set in debugger
102 # so K8s doesn't restart unresponsive container
103 {{- if eq .Values.liveness.enabled true }}
104 livenessProbe:
105 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400106 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200107 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
108 periodSeconds: {{ .Values.liveness.periodSeconds }}
109 {{ end -}}
110 readinessProbe:
111 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400112 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200113 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
114 periodSeconds: {{ .Values.readiness.periodSeconds }}
115 resources:
116{{ toYaml .Values.resources | indent 10 }}
117 {{- if .Values.nodeSelector }}
118 nodeSelector:
119{{ toYaml .Values.nodeSelector | indent 8 }}
120 {{- end -}}
121 {{- if .Values.affinity }}
122 affinity:
123{{ toYaml .Values.affinity | indent 8 }}
124 {{- end }}
125
126 # side car containers
127 - name: filebeat-onap
128 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
129 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
130 volumeMounts:
131 - mountPath: /usr/share/filebeat/filebeat.yml
132 subPath: filebeat.yml
133 name: filebeat-conf
134 - mountPath: /var/log/onap
135 name: {{ include "common.fullname" . }}-logs
136 - mountPath: /usr/share/filebeat/data
137 name: aai-sparky-filebeat
138
139 volumes:
140 - name: localtime
141 hostPath:
142 path: /etc/localtime
143 - name: {{ include "common.fullname" . }}-config
144 configMap:
145 name: {{ include "common.fullname" . }}
kj9bf27312018-03-19 15:07:44 +0200146 - name: {{ include "common.fullname" . }}-auth-config
147 secret:
148 secretName: {{ include "common.fullname" . }}
Keren Joseph5689d5f2018-04-22 15:22:46 +0300149 - name: {{ include "common.fullname" . }}-camel-rests-config
150 configMap:
151 name: {{ include "common.fullname" . }}-camel-rests
152 - name: {{ include "common.fullname" . }}-descriptors-config
153 configMap:
154 name: {{ include "common.fullname" . }}-descriptors
155 - name: {{ include "common.fullname" . }}-filters-config
156 configMap:
157 name: {{ include "common.fullname" . }}-filters
158 - name: {{ include "common.fullname" . }}-portal-config
159 configMap:
160 name: {{ include "common.fullname" . }}-portal
161 - name: {{ include "common.fullname" . }}-portal-boot-inf-config
162 configMap:
163 name: {{ include "common.fullname" . }}-boot-inf
164 - name: {{ include "common.fullname" . }}-schemas-config
165 configMap:
166 name: {{ include "common.fullname" . }}-schemas
167 - name: {{ include "common.fullname" . }}-spring-beans-config
168 configMap:
169 name: {{ include "common.fullname" . }}-spring-beans
kj9bf27312018-03-19 15:07:44 +0200170 - name: filebeat-conf
171 configMap:
172 name: aai-filebeat
173 - name: {{ include "common.fullname" . }}-logs
174 emptyDir: {}
175 - name: aai-sparky-filebeat
176 emptyDir: {}
177 - name: {{ include "common.fullname" . }}-log-conf
178 configMap:
Keren Joseph5689d5f2018-04-22 15:22:46 +0300179 name: {{ include "common.fullname" . }}-log
kj9bf27312018-03-19 15:07:44 +0200180 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
181 imagePullSecrets:
182 - name: "{{ include "common.namespace" . }}-docker-registry-key"