You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2020/08/13 17:20:10 UTC
[pulsar-helm-chart] branch master updated: Allow initialization to
be set (#53)
This is an automated email from the ASF dual-hosted git repository.
sijie 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 b44b523 Allow initialization to be set (#53)
b44b523 is described below
commit b44b523c8a14255d6939c355130ae7f6e8fdb749
Author: Thomas O'Neill <to...@gmail.com>
AuthorDate: Thu Aug 13 13:20:01 2020 -0400
Allow initialization to be set (#53)
Fixes #47
### Motivation
Only create the initialize job on install.
### Modifications
- Added an initialize value that can be set to true on install, matching the documentation in the README.md
---
.ci/helm.sh | 4 ++--
charts/pulsar/templates/bookkeeper-cluster-initialize.yaml | 3 ++-
charts/pulsar/templates/pulsar-cluster-initialize.yaml | 2 ++
charts/pulsar/values.yaml | 3 +++
4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/.ci/helm.sh b/.ci/helm.sh
index 89f1fc8..2ebd685 100644
--- a/.ci/helm.sh
+++ b/.ci/helm.sh
@@ -81,9 +81,9 @@ function ci::install_pulsar_chart() {
${CHARTS_HOME}/scripts/pulsar/upload_tls.sh -k ${CLUSTER} -d ${PULSAR_HOME}/.ci/tls
sleep 10
- echo ${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
+ echo ${HELM} install --set initialize=true --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
${HELM} template --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
- ${HELM} install --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
+ ${HELM} install --set initialize=true --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
echo "wait until broker is alive"
WC=$(${KUBECTL} get pods -n ${NAMESPACE} --field-selector=status.phase=Running | grep ${CLUSTER}-broker | wc -l)
diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml
index bb48022..e581023 100644
--- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml
+++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-
+{{- if .Values.initialize }}
{{- if .Values.components.bookkeeper }}
apiVersion: batch/v1
kind: Job
@@ -75,3 +75,4 @@ spec:
{{- include "pulsar.toolset.certs.volumes" . | nindent 6 }}
restartPolicy: Never
{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml
index 95459a1..28ca512 100644
--- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml
+++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml
@@ -17,6 +17,7 @@
# under the License.
#
+{{- if .Values.initialize }}
{{- if .Values.components.broker }}
apiVersion: batch/v1
kind: Job
@@ -106,3 +107,4 @@ spec:
{{- include "pulsar.toolset.certs.volumes" . | nindent 6 }}
restartPolicy: Never
{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index c71991c..df9d3cd 100644
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -30,6 +30,9 @@ namespaceCreate: false
### Global Settings
###
+## Set to true on install
+initialize: false
+
## Pulsar Metadata Prefix
##
## By default, pulsar stores all the metadata at root path.