diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index 4966e2a..f83ade0 100755 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -29,8 +29,8 @@ metadata: spec: # This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond # https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ -{{- if .Values.job.ttl.enabled }} - ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished }} +{{- if and .Values.job.ttl.enabled (semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version) }} + ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished | default 600 }} {{- end }} template: spec: diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 6a67703..f24949b 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -30,8 +30,8 @@ metadata: spec: # This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond # https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ -{{- if .Values.job.ttl.enabled }} - ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished }} +{{- if and .Values.job.ttl.enabled (semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version) }} + ttlSecondsAfterFinished: {{ .Values.job.ttl.secondsAfterFinished | default 600 }} {{- end }} template: spec: