e3211e241c66bdee5ea1b6121282b4aca8b0164d
[it/dep.git] / smo-install / oran_oom / dmaapmediatorservice / templates / statefulset.yaml
1 ################################################################################
2 #   Copyright (c) 2021 Nordix Foundation.                                      #
3 #                                                                              #
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 ################################################################################
16
17 kind: StatefulSet
18 apiVersion: apps/v1
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   serviceName: {{ include "common.name" . }}
22   replicas: 1
23   selector: {{- include "common.selectors" . | nindent 4 }}
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       hostname: {{ include "common.name" . }}
28       {{- if .Values.dmaapTopicInit.enabled }}
29       initContainers: {{- include "dmaapTopic.initContainer" . | nindent 6 }}
30       {{- end }}
31       containers:
32       - name: {{ include "common.containername" . }}
33         image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }}
34         imagePullPolicy: {{ .Values.imagePullPolicy }}
35         ports: {{- include "common.containerPorts" . | nindent 8 }}
36         {{- /* Only the info producer port is active */ -}}
37         {{- include "common.tcpsocketProbes" (dict "port" ((first .Values.service.ports).internalPort_tls) "dot" .) | nindent 8 }}
38         volumeMounts:
39         - name: {{ include "common.name" . }}-dmaapmediator-data
40           mountPath: /configs/type_config.json
41           subPath: type_config.json
42         env:
43           - name: INFO_PRODUCER_HOST
44             value: "{{ default (print "https://" ( include "common.name" . )) .Values.infoProducerHost }}"
45           - name: INFO_PRODUCER_PORT
46             value: "{{ default (first .Values.service.ports).internalPort_tls .Values.infoProducerPort }}"
47           - name: INFO_COORD_ADDR
48             value: "{{ .Values.infoCoordinatorAddr }}"
49           - name: DMAAP_MR_ADDR
50             value: "{{ .Values.dmaapMrAddr }}"
51           - name: LOG_LEVEL
52             value: "{{ .Values.logLevel }}"
53       volumes:
54         - name: {{ include "common.name" . }}-dmaapmediator-data
55           configMap:
56             name: {{ include "common.name" . }}-type-configmap
57         {{- if .Values.dmaapTopicInit.enabled -}}
58         {{- include "dmaapTopic.initVolume" . | nindent 8 }}
59         {{- end }}