## Motivation ### Case I have a physical zk cluster and want configure bookkeeper & broker & proxy to use it. So I set components.zookeeper as false, and only found pulsar.zookeeper.connect to set my physical zk address. But deploy stage was stucked in bookkeeper wait-zookeeper-ready container. ### Issue The wait-zookeeper-ready initContainer in bookkeeper-cluster-initialize Job used spliced zk Service hosts to detect zk ready or not, other component init Job initContainer do the same thing. Actually, zk service are unreachable because I disabled zk component. ## Modifications - Add optional pulsar_metadata.userProvidedZookeepers config for this case, and make component's init Job use user zk to detect liveness, instead of spliced Service hosts. - Delete redundant image reference in bookkeeper init Job.
40 lines
1.2 KiB
Smarty
40 lines
1.2 KiB
Smarty
{{/*
|
|
Define the pulsar zookeeper
|
|
*/}}
|
|
{{- define "pulsar.zookeeper.service" -}}
|
|
{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Define the pulsar zookeeper
|
|
*/}}
|
|
{{- define "pulsar.zookeeper.connect" -}}
|
|
{{$zk:=.Values.pulsar_metadata.userProvidedZookeepers}}
|
|
{{- if and (not .Values.components.zookeeper) $zk }}
|
|
{{- $zk -}}
|
|
{{ else }}
|
|
{{- if not (and .Values.tls.enabled .Values.tls.zookeeper.enabled) -}}
|
|
{{ template "pulsar.zookeeper.service" . }}:{{ .Values.zookeeper.ports.client }}
|
|
{{- end -}}
|
|
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled -}}
|
|
{{ template "pulsar.zookeeper.service" . }}:{{ .Values.zookeeper.ports.clientTls }}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Define the zookeeper hostname
|
|
*/}}
|
|
{{- define "pulsar.zookeeper.hostname" -}}
|
|
${HOSTNAME}.{{ template "pulsar.zookeeper.service" . }}.{{ .Values.namespace }}.svc.cluster.local
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Define zookeeper tls settings
|
|
*/}}
|
|
{{- define "pulsar.zookeeper.tls.settings" -}}
|
|
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
|
|
/pulsar/keytool/keytool.sh zookeeper {{ template "pulsar.zookeeper.hostname" . }} false;
|
|
{{- end }}
|
|
{{- end }}
|