blob: c1b2c3ccaea239b3be04411bc5f086408781c163 [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:
37 containers:
38 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000039 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
kj9bf27312018-03-19 15:07:44 +020040 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41 env:
42 - name: CONFIG_HOME
Keren Joseph5689d5f2018-04-22 15:22:46 +030043 value: /opt/app/sparky/appconfig/
44 - name: KEYSTORE_ALIAS_PASSWORD
45 value: {{ .Values.config.keystoreAliasPassword }}
46 - name: KEYSTORE_PASSWORD
kj9bf27312018-03-19 15:07:44 +020047 value: {{ .Values.config.keyStorePassword }}
Keren Joseph5689d5f2018-04-22 15:22:46 +030048 - name: SPARKY_SSL_ENABLED
49 value: 'true'
50 - name: SPARKY_PORTAL_ENABLED
51 value: 'false'
kj9bf27312018-03-19 15:07:44 +020052 volumeMounts:
53 - mountPath: /etc/localtime
54 name: localtime
55 readOnly: true
Keren Joseph5689d5f2018-04-22 15:22:46 +030056 - mountPath: /opt/app/sparky/appconfig/auth/
kj9bf27312018-03-19 15:07:44 +020057 name: {{ include "common.fullname" . }}-auth-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030058 - mountPath: /opt/app/sparky/appconfig/camel-rests/
59 name: {{ include "common.fullname" . }}-camel-rests-config
60 - mountPath: /opt/app/sparky/appconfig/descriptors/
61 name: {{ include "common.fullname" . }}-descriptors-config
62 - mountPath: /opt/app/sparky/appconfig/filters/
63 name: {{ include "common.fullname" . }}-filters-config
64 - mountPath: /opt/app/sparky/appconfig/
kj9bf27312018-03-19 15:07:44 +020065 name: {{ include "common.fullname" . }}-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030066 - mountPath: /opt/app/sparky/appconfig/portal
kj9bf27312018-03-19 15:07:44 +020067 name: {{ include "common.fullname" . }}-portal-config
Keren Joseph5689d5f2018-04-22 15:22:46 +030068 - mountPath: /opt/app/sparky/appconfig/portal/BOOT-INF/classes
69 name: {{ include "common.fullname" . }}-portal-boot-inf-config
70 - mountPath: /opt/app/sparky/appconfig/schemas
71 name: {{ include "common.fullname" . }}-schemas-config
72 - mountPath: /opt/app/sparky/appconfig/spring-beans/
73 name: {{ include "common.fullname" . }}-spring-beans-config
kj9bf27312018-03-19 15:07:44 +020074 - mountPath: /var/log/onap
75 name: {{ include "common.fullname" . }}-logs
Keren Joseph5689d5f2018-04-22 15:22:46 +030076 - mountPath: /opt/app/sparky/appconfig/logging/
kj9bf27312018-03-19 15:07:44 +020077 name: {{ include "common.fullname" . }}-log-conf
kj9bf27312018-03-19 15:07:44 +020078 ports:
79 - containerPort: {{ .Values.service.internalPort }}
Keren Joseph5689d5f2018-04-22 15:22:46 +030080 - containerPort: {{ .Values.service.internalPort2 }}
kj9bf27312018-03-19 15:07:44 +020081 # disable liveness probe when breakpoints set in debugger
82 # so K8s doesn't restart unresponsive container
83 {{- if eq .Values.liveness.enabled true }}
84 livenessProbe:
85 tcpSocket:
Keren Joseph5689d5f2018-04-22 15:22:46 +030086 port: {{ .Values.service.internalPort2 }}
kj9bf27312018-03-19 15:07:44 +020087 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
88 periodSeconds: {{ .Values.liveness.periodSeconds }}
89 {{ end -}}
90 readinessProbe:
91 tcpSocket:
Keren Joseph5689d5f2018-04-22 15:22:46 +030092 port: {{ .Values.service.internalPort2 }}
kj9bf27312018-03-19 15:07:44 +020093 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.readiness.periodSeconds }}
95 resources:
96{{ toYaml .Values.resources | indent 10 }}
97 {{- if .Values.nodeSelector }}
98 nodeSelector:
99{{ toYaml .Values.nodeSelector | indent 8 }}
100 {{- end -}}
101 {{- if .Values.affinity }}
102 affinity:
103{{ toYaml .Values.affinity | indent 8 }}
104 {{- end }}
105
106 # side car containers
107 - name: filebeat-onap
108 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
109 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
110 volumeMounts:
111 - mountPath: /usr/share/filebeat/filebeat.yml
112 subPath: filebeat.yml
113 name: filebeat-conf
114 - mountPath: /var/log/onap
115 name: {{ include "common.fullname" . }}-logs
116 - mountPath: /usr/share/filebeat/data
117 name: aai-sparky-filebeat
118
119 volumes:
120 - name: localtime
121 hostPath:
122 path: /etc/localtime
123 - name: {{ include "common.fullname" . }}-config
124 configMap:
125 name: {{ include "common.fullname" . }}
kj9bf27312018-03-19 15:07:44 +0200126 - name: {{ include "common.fullname" . }}-auth-config
127 secret:
128 secretName: {{ include "common.fullname" . }}
Keren Joseph5689d5f2018-04-22 15:22:46 +0300129 - name: {{ include "common.fullname" . }}-camel-rests-config
130 configMap:
131 name: {{ include "common.fullname" . }}-camel-rests
132 - name: {{ include "common.fullname" . }}-descriptors-config
133 configMap:
134 name: {{ include "common.fullname" . }}-descriptors
135 - name: {{ include "common.fullname" . }}-filters-config
136 configMap:
137 name: {{ include "common.fullname" . }}-filters
138 - name: {{ include "common.fullname" . }}-portal-config
139 configMap:
140 name: {{ include "common.fullname" . }}-portal
141 - name: {{ include "common.fullname" . }}-portal-boot-inf-config
142 configMap:
143 name: {{ include "common.fullname" . }}-boot-inf
144 - name: {{ include "common.fullname" . }}-schemas-config
145 configMap:
146 name: {{ include "common.fullname" . }}-schemas
147 - name: {{ include "common.fullname" . }}-spring-beans-config
148 configMap:
149 name: {{ include "common.fullname" . }}-spring-beans
kj9bf27312018-03-19 15:07:44 +0200150 - name: filebeat-conf
151 configMap:
152 name: aai-filebeat
153 - name: {{ include "common.fullname" . }}-logs
154 emptyDir: {}
155 - name: aai-sparky-filebeat
156 emptyDir: {}
157 - name: {{ include "common.fullname" . }}-log-conf
158 configMap:
Keren Joseph5689d5f2018-04-22 15:22:46 +0300159 name: {{ include "common.fullname" . }}-log
kj9bf27312018-03-19 15:07:44 +0200160 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
161 imagePullSecrets:
162 - name: "{{ include "common.namespace" . }}-docker-registry-key"