You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2022/10/20 18:46:28 UTC

[pulsar-helm-chart] branch master updated: Allow to use selectors with volumeClaimTemplates (#286)

This is an automated email from the ASF dual-hosted git repository.

mmarshall 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 343ce05  Allow to use selectors with volumeClaimTemplates (#286)
343ce05 is described below

commit 343ce0527de1d82a4e3582e813ae7645866524a1
Author: Claudio Vellage <me...@claudiovellage.com>
AuthorDate: Thu Oct 20 20:46:23 2022 +0200

    Allow to use selectors with volumeClaimTemplates (#286)
    
    * Allow to use selectors with volumeClaimTemplates
    
    * Fixed naming inconsistency, added null value
    
    Co-authored-by: Claudio Vellage <cl...@pm.me>
    Co-authored-by: Michael Marshall <mm...@apache.org>
    
    ### Motivation
    
    Currently it's not possible to use selectors with volumeClaimTemplates which makes it hard/impossible to bind statically provisioned PVs.
    
    ### Modifications
    
    Added (optional) selectors to `volumeClaimTemplates` and documented in values file.
    
    ### Verifying this change
    
    - [ ] Make sure that the change passes the CI checks.
---
 charts/pulsar/templates/bookkeeper-statefulset.yaml | 20 ++++++++++++++++++++
 charts/pulsar/templates/zookeeper-statefulset.yaml  |  4 ++++
 charts/pulsar/values.yaml                           | 14 ++++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/charts/pulsar/templates/bookkeeper-statefulset.yaml b/charts/pulsar/templates/bookkeeper-statefulset.yaml
index b3bf4d8..e1b3948 100644
--- a/charts/pulsar/templates/bookkeeper-statefulset.yaml
+++ b/charts/pulsar/templates/bookkeeper-statefulset.yaml
@@ -248,6 +248,10 @@ spec:
         {{- else if and .Values.volumes.local_storage .Values.bookkeeper.volumes.common.local_storage }}
         storageClassName: "local-storage"
         {{- end }}
+        {{- with .Values.bookkeeper.volumes.common.selector }}
+        selector:
+          {{- toYaml . | nindent 10 }}
+        {{- end }}
   {{- else }}
   {{- if .Values.bookkeeper.volumes.journal.useMultiVolumes }}
   {{- $fullname := include "pulsar.fullname" . -}}
@@ -263,6 +267,10 @@ spec:
     {{- if .storageClassName }}
       storageClassName: "{{ .storageClassName }}"
     {{- end }}
+    {{- with .Values.bookkeeper.volumes.journal.selector }}
+      selector:
+        {{- toYaml . | nindent 8 }}
+    {{- end }}
   {{- end }}
   {{- else }}
   - metadata:
@@ -279,6 +287,10 @@ spec:
     {{- else if and .Values.volumes.local_storage .Values.bookkeeper.volumes.journal.local_storage }}
       storageClassName: "local-storage"
     {{- end }}
+    {{- with .Values.bookkeeper.volumes.journal.selector }}
+      selector:
+        {{- toYaml . | nindent 8 }}
+    {{- end }}
   {{- end }}
   {{- if .Values.bookkeeper.volumes.ledgers.useMultiVolumes }}
   {{- $fullname := include "pulsar.fullname" . -}}
@@ -294,6 +306,10 @@ spec:
     {{- if .storageClassName }}
       storageClassName: "{{ .storageClassName }}"
     {{- end }}
+    {{- with .Values.bookkeeper.volumes.ledgers.selector }}
+      selector:
+        {{- toYaml . | nindent 8 }}
+    {{- end }}
     {{- end }}
   {{- else }}
   - metadata:
@@ -310,6 +326,10 @@ spec:
     {{- else if and .Values.volumes.local_storage .Values.bookkeeper.volumes.ledgers.local_storage }}
       storageClassName: "local-storage"
     {{- end }}
+    {{- with .Values.bookkeeper.volumes.ledgers.selector }}
+      selector:
+        {{- toYaml . | nindent 8 }}
+    {{- end }}
   {{- end }}
   {{- end }}
 {{- end }}
diff --git a/charts/pulsar/templates/zookeeper-statefulset.yaml b/charts/pulsar/templates/zookeeper-statefulset.yaml
index 7fb3002..ef8f9c3 100644
--- a/charts/pulsar/templates/zookeeper-statefulset.yaml
+++ b/charts/pulsar/templates/zookeeper-statefulset.yaml
@@ -268,5 +268,9 @@ spec:
     {{- else if and .Values.volumes.local_storage .Values.zookeeper.volumes.data.local_storage }}
       storageClassName: "local-storage"
     {{- end }}
+    {{- with .Values.zookeeper.volumes.data.selector }}
+      selector:
+        {{- toYaml . | nindent 8 }}
+    {{- end }}
 {{- end }}
 {{- end }}
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index 9d7df5e..c84b5f4 100644
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -367,6 +367,11 @@ zookeeper:
         # 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: ""
@@ -501,6 +506,11 @@ bookkeeper:
         # 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-bookkeeper-journal
+      selector: {}
       useMultiVolumes: false
       multiVolumes:
         - name: journal0
@@ -518,6 +528,8 @@ bookkeeper:
       # storageClassName:
       # storageClass:
         # ...
+      # selector:
+        # ...
       useMultiVolumes: false
       multiVolumes:
         - name: ledgers0
@@ -538,6 +550,8 @@ bookkeeper:
       # storageClassName:
       # storageClass: ## this is common too
         # ...
+      # selector:
+        # ...
 
   ## Bookkeeper configmap
   ## templates/bookkeeper-configmap.yaml