You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2024/03/26 14:51:37 UTC
(pulsar-helm-chart) branch master updated: add ability to use separate disk for zookeeper tx log (#476)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-helm-chart.git
The following commit(s) were added to refs/heads/master by this push:
new 9929b80 add ability to use separate disk for zookeeper tx log (#476)
9929b80 is described below
commit 9929b80b3c39357bf6107ca57b134f6feef01877
Author: doug-ba <do...@gmail.com>
AuthorDate: Tue Mar 26 07:51:31 2024 -0700
add ability to use separate disk for zookeeper tx log (#476)
* add ability to use separate disk for zookeeper tx log
* Use absolute path
---------
Co-authored-by: Lari Hotari <lh...@users.noreply.github.com>
---
charts/pulsar/templates/zookeeper-configmap.yaml | 3 +++
charts/pulsar/templates/zookeeper-statefulset.yaml | 24 ++++++++++++++++++++++
charts/pulsar/values.yaml | 22 ++++++++++++++++++++
3 files changed, 49 insertions(+)
diff --git a/charts/pulsar/templates/zookeeper-configmap.yaml b/charts/pulsar/templates/zookeeper-configmap.yaml
old mode 100644
new mode 100755
index 6536507..601d448
--- a/charts/pulsar/templates/zookeeper-configmap.yaml
+++ b/charts/pulsar/templates/zookeeper-configmap.yaml
@@ -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
diff --git a/charts/pulsar/templates/zookeeper-statefulset.yaml b/charts/pulsar/templates/zookeeper-statefulset.yaml
old mode 100644
new mode 100755
index fde47c4..5a7ea79
--- a/charts/pulsar/templates/zookeeper-statefulset.yaml
+++ b/charts/pulsar/templates/zookeeper-statefulset.yaml
@@ -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
@@ -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 }}
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index c798afe..0d63ba8 100755
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -352,6 +352,7 @@ zookeeper:
fsGroup: 0
fsGroupChangePolicy: "OnRootMismatch"
volumes:
+ useSeparateDiskForTxlog: false
# use a persistent volume or emptyDir
persistence: true
data:
@@ -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-z [...]
externalZookeeperServerList: ""