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.