blob: 58ca866fca42b2533e53a5443426652e633d1a5f [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
Konrad Bańka5ea1db32020-04-06 14:32:46 +02002# Copyright © 2020 Samsung Electronics
jmac065e2ce2018-03-29 01:18:02 +00003# Copyright © 2017 Amdocs, Bell Canada
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010016*/}}
jmac065e2ce2018-03-29 01:18:02 +000017
18apiVersion: apps/v1beta1
19kind: StatefulSet
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000027 heritage: {{ .Release.Service }}
28spec:
BorislavG1ffbd992018-04-24 07:56:27 +000029 serviceName: {{ include "common.servicename" . }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000030 replicas: {{ .Values.replicaCount }}
31 podManagementPolicy: Parallel
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000037 spec:
38 initContainers:
39 - command:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010040 - sh
41 args:
42 - -c
43 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
44 env:
45 - name: AAI_CLIENT_NAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010046 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010047 - name: AAI_CLIENT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010048 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010049 - name: MODELSERVICE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010050 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010051 - name: MODELSERVICE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010052 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010053 - name: RESTCONF_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010054 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010055 - name: RESTCONF_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010056 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010057 - name: ANSIBLE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010058 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010059 - name: ANSIBLE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010060 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010061 - name: SCALEOUT_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010062 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010063 - name: SCALEOUT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010064 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010065 - name: NETBOX_APIKEY
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010066 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010067 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010068 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010069 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010070 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010071 volumeMounts:
72 - mountPath: /config-input
73 name: config-input
74 - mountPath: /config
75 name: properties
76 image: "{{ .Values.global.envsubstImage }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 name: {{ include "common.name" . }}-update-config
79
80 - command:
jmac065e2ce2018-03-29 01:18:02 +000081 - /root/ready.py
82 args:
83 - --container-name
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010084 - {{ include "common.mariadbService" . }}
jmac065e2ce2018-03-29 01:18:02 +000085 env:
86 - name: NAMESPACE
87 valueFrom:
88 fieldRef:
89 apiVersion: v1
90 fieldPath: metadata.namespace
91 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
92 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010093 name: {{ include "common.name" . }}-readiness
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +000094 {{ if .Values.global.aafEnabled }}
Krzysztof Opasiak6bab0cc2020-04-29 00:55:47 +020095{{ include "common.aaf-config" . | indent 6 }}
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +000096 {{ end }}
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -040097 - name: {{ include "common.name" . }}-chown
98 image: "busybox"
99 command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }} ; chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certpersistence.certPath }}"]
100 volumeMounts:
101 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100102 name: {{ include "common.fullname" . }}-data
Krzysztof Opasiak6bab0cc2020-04-29 00:55:47 +0200103{{- if .Values.global.aafEnabled }}
104{{ include "common.aaf-config-volume-mountpath" . | indent 10 }}
105{{- end }}
jmac065e2ce2018-03-29 01:18:02 +0000106 containers:
107 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +0000108 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +0000109 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
110 command: ["/bin/bash"]
111 args: ["-c", "/opt/sdnc/bin/startODL.sh"]
112 ports:
113 - containerPort: {{ .Values.service.internalPort }}
114 - containerPort: {{ .Values.service.internalPort2 }}
115 - containerPort: {{ .Values.service.internalPort3 }}
116 - containerPort: {{ .Values.service.clusterPort }}
117 readinessProbe:
118 tcpSocket:
119 port: {{ .Values.service.internalPort }}
120 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
121 periodSeconds: {{ .Values.readiness.periodSeconds }}
122 env:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100123 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100124 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100125 - name: ODL_ADMIN_USERNAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100126 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100127 - name: ODL_ADMIN_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100128 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100129 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100130 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100131 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100132 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100133 - name: SDNC_CONFIG_DIR
134 value: "{{ .Values.config.configDir }}"
135 - name: ENABLE_ODL_CLUSTER
136 value: "{{ .Values.config.enableClustering }}"
137 - name: MY_ODL_CLUSTER
138 value: "{{ .Values.config.myODLCluster }}"
139 - name: PEER_ODL_CLUSTER
140 value: "{{ .Values.config.peerODLCluster }}"
141 - name: IS_PRIMARY_CLUSTER
142 value: "{{ .Values.config.isPrimaryCluster }}"
143 - name: GEO_ENABLED
144 value: "{{ .Values.config.geoEnabled}}"
145 - name: SDNC_AAF_ENABLED
146 value: "{{ .Values.global.aafEnabled}}"
147 - name: SDNC_REPLICAS
148 value: "{{ .Values.replicaCount }}"
149 - name: MYSQL_HOST
150 value: {{ include "common.mariadbService" . }}
151 - name: JAVA_HOME
152 value: "{{ .Values.config.javaHome}}"
jmac065e2ce2018-03-29 01:18:02 +0000153 volumeMounts:
Krzysztof Opasiak6bab0cc2020-04-29 00:55:47 +0200154 {{- if .Values.global.aafEnabled }}
155{{ include "common.aaf-config-volume-mountpath" . | indent 10 }}
156 {{- end }}
jmac065e2ce2018-03-29 01:18:02 +0000157 - mountPath: /etc/localtime
158 name: localtime
159 readOnly: true
160 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
161 name: sdnc-logging-cfg-config
162 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000163 - mountPath: {{ .Values.config.binDir }}/startODL.sh
164 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000165 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000166 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
167 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000168 subPath: installSdncDb.sh
Konrad Bańka5ea1db32020-04-06 14:32:46 +0200169 - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
170 name: properties
171 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000172 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
173 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000174 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000175 - mountPath: {{ .Values.config.configDir }}/dblib.properties
176 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000177 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000178 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
179 name: properties
180 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000181 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
182 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000183 subPath: svclogic.properties
184 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000185 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000186 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400187 - mountPath: {{ .Values.config.configDir }}/netbox.properties
188 name: properties
189 subPath: netbox.properties
190 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
191 name: properties
192 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000193 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100194 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000195 - mountPath: /var/log/onap
196 name: logs
Timoney, Dan (dt5972)58774772019-08-21 16:50:54 -0400197 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
198 name: properties
199 subPath: akka.conf
200 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
201 name: properties
202 subPath: org.opendaylight.controller.cluster.datastore.cfg
203 - mountPath: {{ .Values.config.odl.binDir }}/setenv
204 name: properties
205 subPath: setenv
jmac065e2ce2018-03-29 01:18:02 +0000206 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000207{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000208 {{- if .Values.nodeSelector }}
209 nodeSelector:
210{{ toYaml .Values.nodeSelector | indent 10 }}
211 {{- end -}}
212 {{- if .Values.affinity }}
213 affinity:
214{{ toYaml .Values.affinity | indent 10 }}
215 {{- end }}
216
217 # side car containers
218 - name: filebeat-onap
219 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
220 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
221 volumeMounts:
222 - mountPath: /usr/share/filebeat/filebeat.yml
223 name: filebeat-conf
224 subPath: filebeat.yml
225 - mountPath: /var/log/onap
226 name: logs
227 - mountPath: /usr/share/filebeat/data
228 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000229 imagePullSecrets:
230 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000231 volumes:
232 - name: localtime
233 hostPath:
234 path: /etc/localtime
235 - name: logs
236 emptyDir: {}
237 - name: data-filebeat
238 emptyDir: {}
239 - name: filebeat-conf
240 configMap:
241 name: {{ include "common.fullname" . }}-filebeat-configmap
242 - name: sdnc-logging-cfg-config
243 configMap:
244 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000245 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000246 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000247 name: {{ include "common.fullname" . }}-bin
248 defaultMode: 0755
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100249 - name: config-input
jmac065e2ce2018-03-29 01:18:02 +0000250 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000251 name: {{ include "common.fullname" . }}-properties
252 defaultMode: 0644
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100253 - name: properties
254 emptyDir:
255 medium: Memory
jmac8d6dc962018-04-26 14:26:55 +0000256 {{ if not .Values.persistence.enabled }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100257 - name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000258 emptyDir: {}
259 {{ else }}
Krzysztof Opasiak6bab0cc2020-04-29 00:55:47 +0200260 {{- if .Values.global.aafEnabled }}
261{{ include "common.aaf-config-volumes" . | indent 8 }}
262 {{- end }}
jmac8d6dc962018-04-26 14:26:55 +0000263 volumeClaimTemplates:
264 - metadata:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100265 name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000266 labels:
267 name: {{ include "common.fullname" . }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100268 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100269 release: "{{ include "common.release" . }}"
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100270 heritage: "{{ .Release.Service }}"
jmac8d6dc962018-04-26 14:26:55 +0000271 spec:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100272 accessModes:
273 - {{ .Values.persistence.accessMode }}
274 storageClassName: {{ include "common.storageClass" . }}
jmac8d6dc962018-04-26 14:26:55 +0000275 resources:
276 requests:
277 storage: {{ .Values.persistence.size }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100278 {{- end }}