From 4386eacba8ddb40b506c26d07b7f4330bff6bee6 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 28 Feb 2025 19:17:54 +0200 Subject: [PATCH] [fix] Fix broker service annotations issue and other annotations issues (#574) * Fix broker services annotations issues * Add annotations support to autorecovery.service * Consistently use similar way to handle annotations * Add autorecovery service annotations key to values.yaml --- charts/pulsar/templates/autorecovery-service.yaml | 4 ++++ charts/pulsar/templates/bookkeeper-service.yaml | 4 ++-- charts/pulsar/templates/broker-service.yaml | 2 +- charts/pulsar/templates/pulsar-manager-service.yaml | 8 ++++++-- charts/pulsar/templates/zookeeper-service.yaml | 5 ++++- charts/pulsar/values.yaml | 4 ++++ 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/charts/pulsar/templates/autorecovery-service.yaml b/charts/pulsar/templates/autorecovery-service.yaml index 348ccd5..1021a3b 100644 --- a/charts/pulsar/templates/autorecovery-service.yaml +++ b/charts/pulsar/templates/autorecovery-service.yaml @@ -26,6 +26,10 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.autorecovery.component }} +{{- with .Values.autorecovery.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: ports: - name: http diff --git a/charts/pulsar/templates/bookkeeper-service.yaml b/charts/pulsar/templates/bookkeeper-service.yaml index c434a4b..9ab1b0f 100644 --- a/charts/pulsar/templates/bookkeeper-service.yaml +++ b/charts/pulsar/templates/bookkeeper-service.yaml @@ -26,9 +26,9 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.bookkeeper.component }} -{{- if .Values.bookkeeper.service.annotations }} +{{- with .Values.bookkeeper.service.annotations }} annotations: -{{ toYaml .Values.bookkeeper.service.annotations | indent 4 }} +{{ toYaml . | indent 4 }} {{- end }} spec: ports: diff --git a/charts/pulsar/templates/broker-service.yaml b/charts/pulsar/templates/broker-service.yaml index 0c683c4..998f9be 100644 --- a/charts/pulsar/templates/broker-service.yaml +++ b/charts/pulsar/templates/broker-service.yaml @@ -26,7 +26,7 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.broker.component }} -{{- with .Values.broker.service_account.annotations }} +{{- with .Values.broker.service.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} diff --git a/charts/pulsar/templates/pulsar-manager-service.yaml b/charts/pulsar/templates/pulsar-manager-service.yaml index 3cdec1b..f663590 100644 --- a/charts/pulsar/templates/pulsar-manager-service.yaml +++ b/charts/pulsar/templates/pulsar-manager-service.yaml @@ -26,8 +26,10 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.pulsar_manager.component }} +{{- with .Values.pulsar_manager.service.annotations }} annotations: -{{ toYaml .Values.pulsar_manager.service.annotations | indent 4 }} +{{ toYaml . | indent 4 }} +{{- end }} spec: type: {{ .Values.pulsar_manager.service.type }} {{- if .Values.pulsar_manager.service.externalTrafficPolicy }} @@ -58,8 +60,10 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.pulsar_manager.component }} +{{- with .Values.pulsar_manager.adminService.annotations }} annotations: -{{ toYaml .Values.pulsar_manager.adminService.annotations | indent 4 }} +{{ toYaml . | indent 4 }} +{{- end }} spec: type: {{ .Values.pulsar_manager.adminService.type }} ports: diff --git a/charts/pulsar/templates/zookeeper-service.yaml b/charts/pulsar/templates/zookeeper-service.yaml index 1907058..a28f479 100644 --- a/charts/pulsar/templates/zookeeper-service.yaml +++ b/charts/pulsar/templates/zookeeper-service.yaml @@ -28,7 +28,10 @@ metadata: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.zookeeper.component }} annotations: -{{ toYaml .Values.zookeeper.service.annotations | indent 4 }} +{{- with .Values.zookeeper.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: ports: # prometheus needs to access /metrics endpoint diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 1c51359..823ff66 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -833,6 +833,10 @@ autorecovery: requests: memory: 64Mi cpu: 0.05 + ## Bookkeeper auto-recovery service + ## templates/autorecovery-service.yaml + service: + annotations: {} ## Bookkeeper auto-recovery service account ## templates/autorecovery-service-account.yaml service_account: