Skip to content

Commit

Permalink
add ability to use separate disk for zookeeper tx log (#476)
Browse files Browse the repository at this point in the history
* add ability to use separate disk for zookeeper tx log

* Use absolute path

---------

Co-authored-by: Lari Hotari <[email protected]>
  • Loading branch information
doug-ba and lhotari authored Mar 26, 2024
1 parent eb0a878 commit 9929b80
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/pulsar/templates/zookeeper-configmap.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ metadata:
component: {{ .Values.zookeeper.component }}
data:
dataDir: /pulsar/data/zookeeper
{{- if .Values.zookeeper.volumes.useSeparateDiskForTxlog }}
PULSAR_PREFIX_dataLogDir: /pulsar/data-log
{{- end }}
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
# enable zookeeper tls
PULSAR_PREFIX_serverCnxnFactory: org.apache.zookeeper.server.NettyServerCnxnFactory
Expand Down
24 changes: 24 additions & 0 deletions charts/pulsar/templates/zookeeper-statefulset.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ spec:
volumeMounts:
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.volumes.data.name }}"
mountPath: /pulsar/data
{{- if .Values.zookeeper.volumes.useSeparateDiskForTxlog }}
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.volumes.datalog.name }}"
mountPath: /pulsar/data-log
{{- end }}
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
- mountPath: "/pulsar/certs/zookeeper"
name: zookeeper-certs
Expand Down Expand Up @@ -272,5 +276,25 @@ spec:
selector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.zookeeper.volumes.useSeparateDiskForTxlog }}
- metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.volumes.datalog.name }}"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ .Values.zookeeper.volumes.datalog.size }}
{{- if .Values.zookeeper.volumes.datalog.storageClassName }}
storageClassName: "{{ .Values.zookeeper.volumes.datalog.storageClassName }}"
{{- else if and (not (and .Values.volumes.local_storage .Values.zookeeper.volumes.datalog.local_storage)) .Values.zookeeper.volumes.datalog.storageClass }}
storageClassName: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.volumes.datalog.name }}"
{{- else if and .Values.volumes.local_storage .Values.zookeeper.volumes.datalog.local_storage }}
storageClassName: "local-storage"
{{- end }}
{{- with .Values.zookeeper.volumes.datalog.selector }}
selector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
22 changes: 22 additions & 0 deletions charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ zookeeper:
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
volumes:
useSeparateDiskForTxlog: false
# use a persistent volume or emptyDir
persistence: true
data:
Expand All @@ -374,6 +375,27 @@ zookeeper:
# matchLabels:
# app: pulsar-zookeeper
selector: {}
## If you set useSeparateDiskForTxlog to true, this section configures the extra volume for the zookeeper transaction log.
datalog:
name: datalog
size: 20Gi
local_storage: true
## If you already have an existent storage class and want to reuse it, you can specify its name with the option below
##
# storageClassName: existent-storage-class
#
## Instead if you want to create a new storage class define it below
## If left undefined no storage class will be defined along with PVC
##
# storageClass:
# type: pd-ssd
# fsType: xfs
# provisioner: kubernetes.io/gce-pd
## If you want to bind static persistent volumes via selectors, e.g.:
# selector:
# matchLabels:
# app: pulsar-zookeeper
selector: {}
# External zookeeper server list in case of global-zk list to create zk cluster across zk deployed on different clusters/namespaces
# Example value: "us-east1-pulsar-zookeeper-0.us-east1-pulsar-zookeeper.us-east1.svc.cluster.local:2888:3888,us-east1-pulsar-zookeeper-1.us-east1-pulsar-zookeeper.us-east1.svc.cluster.local:2888:3888,us-east1-pulsar-zookeeper-2.us-east1-pulsar-zookeeper.us-east1.svc.cluster.local:2888:3888,us-west1-pulsar-zookeeper-0.us-west1-pulsar-zookeeper.us-west1.svc.cluster.local:2888:3888,us-west1-pulsar-zookeeper-1.us-west1-pulsar-zookeeper.us-west1.svc.cluster.local:2888:3888,us-west1-pulsar-zookeeper-2.us-west1-pulsar-zookeeper.us-west1.svc.cluster.local:2888:3888"
externalZookeeperServerList: ""
Expand Down

0 comments on commit 9929b80

Please sign in to comment.