blob: 9e3109877bfd861a088da7e1f2292b645326a55d [file] [log] [blame]
Jennie Jia20bb5cd2018-08-16 15:50:33 +00001# Copyright © 2018 Amdocs
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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
Jennie Jia20bb5cd2018-08-16 15:50:33 +000024 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" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010034 release: {{ include "common.release" . }}
Jennie Jia20bb5cd2018-08-16 15:50:33 +000035 name: {{ include "common.name" . }}
36 spec:
37 initContainers:
38 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020039 - /app/ready.py
jmacaf645b52018-10-11 12:21:54 +000040 args:
41 - --container-name
42 - pomba-search-data
43 env:
44 - name: NAMESPACE
45 valueFrom:
46 fieldRef:
47 apiVersion: v1
48 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020049 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
jmacaf645b52018-10-11 12:21:54 +000050 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51 name: {{ include "common.name" . }}-readiness
52 - command:
Jennie Jia20bb5cd2018-08-16 15:50:33 +000053 - /bin/sh
54 - -c
55 - |
56 mkdir -p /logroot/data-router/logs
57 chmod -R 777 /logroot/data-router/logs
58 chown -R root:root /logroot
59 env:
60 - name: NAMESPACE
61 valueFrom:
62 fieldRef:
63 apiVersion: v1
64 fieldPath: metadata.namespace
65 securityContext:
66 privileged: true
67 image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
68 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69 name: init-sysctl
70 volumeMounts:
71 - name: {{ include "common.fullname" . }}-logs
72 mountPath: /logroot/
73 containers:
74 - name: {{ include "common.name" . }}
75 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
76 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77 env:
78 - name: SERVICE_BEANS
79 value: /opt/app/data-router/dynamic/conf
80 - name: CONFIG_HOME
81 value: /opt/app/data-router/config/
82 - name: KEY_STORE_PASSWORD
83 value: {{ .Values.config.keyStorePassword }}
84 - name: DYNAMIC_ROUTES
85 value: /opt/app/data-router/dynamic/routes
86 - name: KEY_MANAGER_PASSWORD
87 value: {{ .Values.config.keyManagerPassword }}
88 volumeMounts:
89 - mountPath: /etc/localtime
90 name: localtime
91 readOnly: true
92 - mountPath: /opt/app/data-router/config/auth
93 name: {{ include "common.fullname" . }}-auth
94 - mountPath: /opt/app/data-router/config/data-router.properties
95 subPath: data-router.properties
96 name: {{ include "common.fullname" . }}-properties
97 - mountPath: /opt/app/data-router/config/schemaIngest.properties
98 subPath: schemaIngest.properties
99 name: {{ include "common.fullname" . }}-properties
100 - mountPath: /opt/app/data-router/dynamic/routes/audit.route
101 subPath: audit.route
102 name: {{ include "common.fullname" . }}-dynamic-route
103 - mountPath: /opt/app/data-router/dynamic/routes/poaValidation.route
104 subPath: poaValidation.route
105 name: {{ include "common.fullname" . }}-dynamic-route
106 - mountPath: /opt/app/data-router/dynamic/conf/audit-bean.xml
107 subPath: audit-bean.xml
108 name: {{ include "common.fullname" . }}-dynamic-policy
109 - mountPath: /opt/app/data-router/dynamic/conf/poa-validation-bean.xml
110 subPath: poa-validation-bean.xml
111 name: {{ include "common.fullname" . }}-dynamic-policy
112 - mountPath: /logs/
113 name: {{ include "common.fullname" . }}-logs
Sylvain Desbureauxbbf5ace2018-11-23 16:45:04 +0100114 resources:
115{{ include "common.resources" . | indent 10 }}
Jennie Jia20bb5cd2018-08-16 15:50:33 +0000116 ports:
117 - containerPort: {{ .Values.service.internalPort }}
118 {{- if eq .Values.liveness.enabled true }}
119 livenessProbe:
120 tcpSocket:
121 port: {{ .Values.service.internalPort }}
122 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
123 periodSeconds: {{ .Values.liveness.periodSeconds }}
124 {{ end -}}
125 readinessProbe:
126 tcpSocket:
127 port: {{ .Values.service.internalPort }}
128 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
129 periodSeconds: {{ .Values.readiness.periodSeconds }}
jmac76d4a8a2019-02-21 20:03:49 +0000130
131 # Filebeat sidecar container
132 - name: {{ include "common.name" . }}-filebeat-onap
133 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
134 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
135 volumeMounts:
136 - name: {{ include "common.fullname" . }}-filebeat-conf
137 mountPath: /usr/share/filebeat/filebeat.yml
138 subPath: filebeat.yml
139 - name: {{ include "common.fullname" . }}-data-filebeat
140 mountPath: /usr/share/filebeat/data
141 - name: {{ include "common.fullname" . }}-logs
142 mountPath: /opt/app/logs
143
Jennie Jia20bb5cd2018-08-16 15:50:33 +0000144 volumes:
145 - name: localtime
146 hostPath:
147 path: /etc/localtime
148 - name: {{ include "common.fullname" . }}-auth
149 secret:
150 secretName: {{ include "common.fullname" . }}
151 - name: {{ include "common.fullname" . }}-properties
152 configMap:
153 name: {{ include "common.fullname" . }}-prop
154 items:
155 - key: data-router.properties
156 path: data-router.properties
157 - key: schemaIngest.properties
158 path: schemaIngest.properties
jmac76d4a8a2019-02-21 20:03:49 +0000159 - name: {{ include "common.fullname" . }}-filebeat-conf
160 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100161 name: {{ include "common.release" . }}-pomba-filebeat-configmap
jmac76d4a8a2019-02-21 20:03:49 +0000162 - name: {{ include "common.fullname" . }}-data-filebeat
163 emptyDir: {}
Jennie Jia20bb5cd2018-08-16 15:50:33 +0000164 - name: {{ include "common.fullname" . }}-dynamic-route
165 configMap:
166 name: {{ include "common.fullname" . }}-dynamic
167 - name: {{ include "common.fullname" . }}-dynamic-policy
168 configMap:
169 name: {{ include "common.fullname" . }}-dynamic
170 - name: {{ include "common.fullname" . }}-logs
171 persistentVolumeClaim:
172 claimName: {{ include "common.fullname" . }}
173 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
174 imagePullSecrets:
175 - name: "{{ include "common.namespace" . }}-docker-registry-key"