a4ed2ec14359c6e29c6cc107fc36fc08352e8169
[osm/devops.git] / installers / helm / osm / templates / zookeeper / zookeeper-statefulset.yaml
1 {{- if .Values.zookeeper.enabled -}}
2 #######################################################################################
3 # Copyright ETSI Contributors and Others.
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
14 # implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #######################################################################################
18 apiVersion: apps/v1
19 kind: StatefulSet
20 metadata:
21   name: zookeeper
22   labels:
23     {{- include "osm.labels" . | nindent 4 }}
24 spec:
25   replicas: {{ .Values.zookeeper.replicaCount | default .Values.global.replicaCount }}
26   serviceName: zookeeper
27   selector:
28     matchLabels:
29       app.kubernetes.io/component: zookeeper
30       {{- include "osm.selectorLabels" . | nindent 6 }}
31   template:
32     metadata:
33       {{- with .Values.global.podAnnotations }}
34       annotations:
35         {{- toYaml . | nindent 8 }}
36       {{- end }}
37       labels:
38         app.kubernetes.io/component: zookeeper
39         {{- include "osm.selectorLabels" . | nindent 8 }}
40     spec:
41       {{- with .Values.global.imagePullSecrets }}
42       imagePullSecrets:
43         {{- toYaml . | nindent 8 }}
44       {{- end }}
45       serviceAccountName: {{ include "osm.serviceAccountName" . }}
46       containers:
47         - name: zookeeper
48           securityContext:
49             # readOnlyRootFilesystem: true
50             allowPrivilegeEscalation: false
51             # runAsNonRoot: true
52           image: wurstmeister/zookeeper:latest
53           imagePullPolicy: {{ .Values.global.image.pullPolicy }}
54           ports:
55             - containerPort: 2181
56               protocol: TCP
57           resources:
58             limits:
59               memory: 1024Mi
60             requests:
61               memory: 128Mi
62       {{- with .Values.global.nodeSelector }}
63       nodeSelector:
64         {{- toYaml . | nindent 8 }}
65       {{- end }}
66       {{- with .Values.global.affinity }}
67       affinity:
68         {{- toYaml . | nindent 8 }}
69       {{- end }}
70       {{- with .Values.global.tolerations }}
71       tolerations:
72         {{- toYaml . | nindent 8 }}
73       {{- end }}
74 {{- end }}