-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathstatefulset.yaml
More file actions
115 lines (115 loc) · 3.51 KB
/
Copy pathstatefulset.yaml
File metadata and controls
115 lines (115 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Name }}-{{ .OperatorName }}
namespace: {{ .Namespace }}
labels:
zookeeper: {{ .OperatorName }}
app: zookeeper
instance: {{ .Name }}
annotations:
reloader.kudo.dev/auto: "true"
spec:
selector:
matchLabels:
app: zookeeper
zookeeper: {{ .OperatorName }}
instance: {{ .Name }}
serviceName: {{ .Name }}-hs
replicas: {{ .Params.NODE_COUNT }}
updateStrategy:
type: RollingUpdate
podManagementPolicy: Parallel
template:
metadata:
labels:
app: zookeeper
zookeeper: {{ .OperatorName }}
instance: {{ .Name }}
spec:
containers:
- name: kubernetes-zookeeper
imagePullPolicy: {{ .Params.IMAGE_PULL_POLICY }}
image: "{{ .Params.IMAGE_VERSION }}"
resources:
requests:
memory: {{ .Params.MEMORY }}
cpu: {{ .Params.CPUS }}
limits:
memory: {{ .Params.MEM_LIMIT }}
cpu: {{ .Params.CPUS_LIMIT }}
ports:
- containerPort: {{ .Params.CLIENT_PORT }}
name: client
- containerPort: {{ .Params.SERVER_PORT }}
name: server
- containerPort: {{ .Params.ELECTION_PORT }}
name: leader-election
command:
- sh
- -c
- "ZOOKEEPERPATH=`pwd` /etc/zookeeper/bootstrap.sh \
--servers={{ .Params.NODE_COUNT }} \
--data_dir=/var/lib/zookeeper/data \
--data_log_dir=/logs \
--conf_dir=/conf \
--client_port={{ .Params.CLIENT_PORT }} \
--election_port={{ .Params.ELECTION_PORT }} \
--server_port={{ .Params.SERVER_PORT }} \
--tick_time=2000 \
--init_limit=10 \
--sync_limit=5 \
--heap=512M \
--max_client_cnxns=60 \
--snap_retain_count=3 \
--purge_interval=12 \
--max_session_timeout=40000 \
--min_session_timeout=4000 \
--log_level=INFO"
readinessProbe:
exec:
command:
- sh
- -c
- "/etc/healthcheck/healthcheck.sh {{ .Params.CLIENT_PORT }}"
initialDelaySeconds: 10
timeoutSeconds: 5
livenessProbe:
exec:
command:
- sh
- -c
- "/etc/healthcheck/healthcheck.sh {{ .Params.CLIENT_PORT }}"
initialDelaySeconds: 10
timeoutSeconds: 5
periodSeconds: 30
volumeMounts:
- name: {{ .Name }}-datadir
mountPath: /var/lib/zookeeper
- name: {{ .Name }}-bootstrap
mountPath: /etc/zookeeper
- name: {{ .Name }}-healthcheck
mountPath: /etc/healthcheck
securityContext:
runAsUser: 1000
fsGroup: 1000
volumes:
- name: {{ .Name }}-bootstrap
configMap:
name: {{ .Name }}-bootstrap
defaultMode: 0777
- name: {{ .Name }}-healthcheck
configMap:
name: {{ .Name }}-healthcheck
defaultMode: 0777
volumeClaimTemplates:
- metadata:
name: {{ .Name }}-datadir
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ .Params.DISK_SIZE }}
{{ if .Params.STORAGE_CLASS }}
storageClassName: {{ .Params.STORAGE_CLASS }}
{{ end }}