Use appVersion as default tag for Pulsar images (#200)
Co-authored-by: Michael Marshall <mmarshall@apache.org> ### Motivation There was a suggestion [in a dev mailing list discussion](https://lists.apache.org/thread/bgkvcyt1qq6h67p2k8xwp89xlncbqn3d) that the Helm chart's appVersion should be used as the default image tag. ### Additional context There are some limitations in Helm. It is not possible to set "appVersion" from the command line. There's in an open feature request https://github.com/helm/helm/issues/8194 to add such a feature to Helm. ### Modifications - change default values.yaml and set the tags for the images that use the Pulsar image to an empty value - add "defaultPulsarImageTag" to values.yaml - add a helper template "pulsar.imageFullName" that contains the logic to fall back to .Values.defaultPulsarImageTag and if it's not set, falling back to .Chart.AppVersion - use the helper template in all other templates that require the logic
This commit is contained in:
parent
6a00845670
commit
25f355e6e2
@ -102,3 +102,10 @@ imagePullSecrets:
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create full image name
|
||||
*/}}
|
||||
{{- define "pulsar.imageFullName" -}}
|
||||
{{- printf "%s:%s" .image.repository (.image.tag | default .root.Values.defaultPulsarImageTag | default .root.Chart.AppVersion) -}}
|
||||
{{- end -}}
|
||||
|
||||
@ -111,7 +111,7 @@ spec:
|
||||
# This initContainer will wait for bookkeeper initnewcluster to complete
|
||||
# before deploying the bookies
|
||||
- name: pulsar-bookkeeper-verify-clusterid
|
||||
image: "{{ .Values.images.autorecovery.repository }}:{{ .Values.images.autorecovery.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.autorecovery "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.autorecovery.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -124,7 +124,7 @@ spec:
|
||||
{{- include "pulsar.autorecovery.certs.volumeMounts" . | nindent 8 }}
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.autorecovery.component }}"
|
||||
image: "{{ .Values.images.autorecovery.repository }}:{{ .Values.images.autorecovery.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.autorecovery "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.autorecovery.pullPolicy }}
|
||||
{{- if .Values.autorecovery.resources }}
|
||||
resources:
|
||||
|
||||
@ -39,7 +39,7 @@ spec:
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: wait-zookeeper-ready
|
||||
image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.bookie.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -55,7 +55,7 @@ spec:
|
||||
{{- end}}
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-init"
|
||||
image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.bookie.pullPolicy }}
|
||||
{{- if .Values.bookkeeper.metadata.resources }}
|
||||
resources:
|
||||
|
||||
@ -112,7 +112,7 @@ spec:
|
||||
# This initContainer will wait for bookkeeper initnewcluster to complete
|
||||
# before deploying the bookies
|
||||
- name: pulsar-bookkeeper-verify-clusterid
|
||||
image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.bookie.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -130,7 +130,7 @@ spec:
|
||||
{{- include "pulsar.bookkeeper.certs.volumeMounts" . | nindent 8 }}
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}"
|
||||
image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.bookie.pullPolicy }}
|
||||
{{- if .Values.bookkeeper.probe.liveness.enabled }}
|
||||
livenessProbe:
|
||||
|
||||
@ -58,7 +58,7 @@ data:
|
||||
# support version >= 2.5.0
|
||||
PF_functionRuntimeFactoryConfigs_pulsarRootDir: {{ template "pulsar.home" . }}
|
||||
PF_kubernetesContainerFactory_pulsarRootDir: {{ template "pulsar.home" . }}
|
||||
PF_functionRuntimeFactoryConfigs_pulsarDockerImageName: "{{ .Values.images.functions.repository }}:{{ .Values.images.functions.tag }}"
|
||||
PF_functionRuntimeFactoryConfigs_pulsarDockerImageName: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.functions "root" .) }}"
|
||||
PF_functionRuntimeFactoryConfigs_submittingInsidePod: "true"
|
||||
PF_functionRuntimeFactoryConfigs_installUserCodeDependencies: "true"
|
||||
PF_functionRuntimeFactoryConfigs_jobNamespace: {{ template "pulsar.namespace" . }}
|
||||
@ -74,7 +74,7 @@ data:
|
||||
PF_functionRuntimeFactoryConfigs_changeConfigMap: "{{ template "pulsar.fullname" . }}-{{ .Values.functions.component }}-config"
|
||||
PF_functionRuntimeFactoryConfigs_changeConfigMapNamespace: {{ template "pulsar.namespace" . }}
|
||||
# support version < 2.5.0
|
||||
PF_kubernetesContainerFactory_pulsarDockerImageName: "{{ .Values.images.functions.repository }}:{{ .Values.images.functions.tag }}"
|
||||
PF_kubernetesContainerFactory_pulsarDockerImageName: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.functions "root" .) }}"
|
||||
PF_kubernetesContainerFactory_submittingInsidePod: "true"
|
||||
PF_kubernetesContainerFactory_installUserCodeDependencies: "true"
|
||||
PF_kubernetesContainerFactory_jobNamespace: {{ template "pulsar.namespace" . }}
|
||||
|
||||
@ -106,7 +106,7 @@ spec:
|
||||
# This init container will wait for zookeeper to be ready before
|
||||
# deploying the bookies
|
||||
- name: wait-zookeeper-ready
|
||||
image: "{{ .Values.images.broker.repository }}:{{ .Values.images.broker.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.broker.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -129,7 +129,7 @@ spec:
|
||||
# This init container will wait for bookkeeper to be ready before
|
||||
# deploying the broker
|
||||
- name: wait-bookkeeper-ready
|
||||
image: "{{ .Values.images.broker.repository }}:{{ .Values.images.broker.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.broker.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -159,7 +159,7 @@ spec:
|
||||
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 10 }}
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
||||
image: "{{ .Values.images.broker.repository }}:{{ .Values.images.broker.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.broker.pullPolicy }}
|
||||
{{- if .Values.broker.probe.liveness.enabled }}
|
||||
livenessProbe:
|
||||
|
||||
@ -28,5 +28,5 @@ metadata:
|
||||
{{- include "pulsar.standardLabels" . | nindent 4 }}
|
||||
component: {{ .Values.functions.component }}
|
||||
data:
|
||||
pulsarDockerImageName: "{{ .Values.images.functions.repository }}:{{ .Values.images.functions.tag }}"
|
||||
pulsarDockerImageName: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.functions "root" .) }}"
|
||||
{{- end }}
|
||||
@ -108,7 +108,7 @@ spec:
|
||||
# This init container will wait for zookeeper to be ready before
|
||||
# deploying the bookies
|
||||
- name: wait-zookeeper-ready
|
||||
image: "{{ .Values.images.proxy.repository }}:{{ .Values.images.proxy.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.proxy.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -125,7 +125,7 @@ spec:
|
||||
# This init container will wait for at least one broker to be ready before
|
||||
# deploying the proxy
|
||||
- name: wait-broker-ready
|
||||
image: "{{ .Values.images.proxy.repository }}:{{ .Values.images.proxy.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.proxy.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -139,7 +139,7 @@ spec:
|
||||
done;
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||
image: "{{ .Values.images.proxy.repository }}:{{ .Values.images.proxy.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.proxy.pullPolicy }}
|
||||
{{- if .Values.proxy.probe.liveness.enabled }}
|
||||
livenessProbe:
|
||||
|
||||
@ -38,7 +38,7 @@ spec:
|
||||
initContainers:
|
||||
{{- if .Values.pulsar_metadata.configurationStore }}
|
||||
- name: wait-cs-ready
|
||||
image: "{{ .Values.pulsar_metadata.image.repository }}:{{ .Values.pulsar_metadata.image.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -49,7 +49,7 @@ spec:
|
||||
|
||||
{{- end }}
|
||||
- name: wait-zookeeper-ready
|
||||
image: "{{ .Values.pulsar_metadata.image.repository }}:{{ .Values.pulsar_metadata.image.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -66,7 +66,7 @@ spec:
|
||||
# This initContainer will wait for bookkeeper initnewcluster to complete
|
||||
# before initializing pulsar metadata
|
||||
- name: pulsar-bookkeeper-verify-clusterid
|
||||
image: "{{ .Values.pulsar_metadata.image.repository }}:{{ .Values.pulsar_metadata.image.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
@ -83,7 +83,7 @@ spec:
|
||||
{{- include "pulsar.toolset.certs.volumeMounts" . | nindent 8 }}
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_metadata.component }}"
|
||||
image: "{{ .Values.pulsar_metadata.image.repository }}:{{ .Values.pulsar_metadata.image.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.pulsar_metadata.image.pullPolicy }}
|
||||
{{- if .Values.pulsar_metadata.resources }}
|
||||
resources:
|
||||
|
||||
@ -61,7 +61,7 @@ spec:
|
||||
{{- end}}
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||
image: "{{ .Values.images.broker.repository }}:{{ .Values.images.broker.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.broker.pullPolicy }}
|
||||
{{- if .Values.toolset.resources }}
|
||||
resources:
|
||||
|
||||
@ -107,7 +107,7 @@ spec:
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||
image: "{{ .Values.images.zookeeper.repository }}:{{ .Values.images.zookeeper.tag }}"
|
||||
image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.zookeeper "root" .) }}"
|
||||
imagePullPolicy: {{ .Values.images.zookeeper.pullPolicy }}
|
||||
{{- if .Values.zookeeper.resources }}
|
||||
resources:
|
||||
|
||||
@ -157,33 +157,43 @@ extra:
|
||||
# Configure Kubernetes runtime for Functions
|
||||
functionsAsPods: false
|
||||
|
||||
# default image tag for pulsar images
|
||||
# uses chart's appVersion when unspecified
|
||||
defaultPulsarImageTag:
|
||||
|
||||
## Images
|
||||
##
|
||||
## Control what images to use for each component
|
||||
images:
|
||||
zookeeper:
|
||||
repository: apachepulsar/pulsar-all
|
||||
tag: 2.9.3
|
||||
# uses defaultPulsarImageTag when unspecified
|
||||
tag:
|
||||
pullPolicy: IfNotPresent
|
||||
bookie:
|
||||
repository: apachepulsar/pulsar-all
|
||||
tag: 2.9.3
|
||||
# uses defaultPulsarImageTag when unspecified
|
||||
tag:
|
||||
pullPolicy: IfNotPresent
|
||||
autorecovery:
|
||||
repository: apachepulsar/pulsar-all
|
||||
tag: 2.9.3
|
||||
# uses defaultPulsarImageTag when unspecified
|
||||
tag:
|
||||
pullPolicy: IfNotPresent
|
||||
broker:
|
||||
repository: apachepulsar/pulsar-all
|
||||
tag: 2.9.3
|
||||
# uses defaultPulsarImageTag when unspecified
|
||||
tag:
|
||||
pullPolicy: IfNotPresent
|
||||
proxy:
|
||||
repository: apachepulsar/pulsar-all
|
||||
tag: 2.9.3
|
||||
# uses defaultPulsarImageTag when unspecified
|
||||
tag:
|
||||
pullPolicy: IfNotPresent
|
||||
functions:
|
||||
repository: apachepulsar/pulsar-all
|
||||
tag: 2.9.3
|
||||
# uses defaultPulsarImageTag when unspecified
|
||||
tag:
|
||||
prometheus:
|
||||
repository: prom/prometheus
|
||||
tag: v2.17.2
|
||||
@ -652,7 +662,8 @@ pulsar_metadata:
|
||||
image:
|
||||
# the image used for running `pulsar-cluster-initialize` job
|
||||
repository: apachepulsar/pulsar-all
|
||||
tag: 2.9.3
|
||||
# uses defaultPulsarImageTag when unspecified
|
||||
tag:
|
||||
pullPolicy: IfNotPresent
|
||||
## set an existing configuration store
|
||||
# configurationStore:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user