From 48c970986f4947c7311a0c1c2f4ed8a21e3fe7bf Mon Sep 17 00:00:00 2001 From: Eric Shen Date: Fri, 7 Jun 2024 14:07:31 +0800 Subject: [PATCH] feat: add the pulsar_coordinator in the values (#1165) * feat: add the pulsar_coordinator in the values Signed-off-by: ericsyh * update crd defination Signed-off-by: ericsyh * update to the sn-platform chart Signed-off-by: ericsyh * fix lint Signed-off-by: ericsyh * add the coordinator label on sn-platform chart Signed-off-by: ericsyh --------- Signed-off-by: ericsyh (cherry picked from commit 6220ededdf8db88b89267b9e5a69b9bf4c2ce406) --- .../templates/bookkeeper/bookkeeper-cluster.yaml | 3 +++ .../templates/broker/broker-cluster.yaml | 3 +++ .../templates/proxy/proxy-cluster.yaml | 3 +++ .../pulsar-coordinator/pulsar-coordinator.yaml | 13 ++++--------- .../templates/zookeeper/zookeeper-cluster.yaml | 3 +++ charts/sn-platform-slim/values.yaml | 3 +++ .../templates/bookkeeper/bookkeeper-cluster.yaml | 3 +++ .../templates/broker/broker-cluster.yaml | 3 +++ .../sn-platform/templates/proxy/proxy-cluster.yaml | 3 +++ .../pulsar-coordinator/pulsar-coordinator.yaml | 13 ++++--------- .../templates/zookeeper/zookeeper-cluster.yaml | 3 +++ charts/sn-platform/values.yaml | 3 +++ 12 files changed, 38 insertions(+), 18 deletions(-) diff --git a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml index f742f30a..dd84a8d7 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml @@ -37,6 +37,9 @@ metadata: {{- with .Values.bookkeeper.bookKeeperCluster.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: {{- if not .Values.initialize }} initialized: true diff --git a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml index e1bc170d..37123861 100644 --- a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml @@ -38,6 +38,9 @@ metadata: {{- with .Values.broker.pulsarBroker.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: {{- if not .Values.initialize }} initialized: true diff --git a/charts/sn-platform-slim/templates/proxy/proxy-cluster.yaml b/charts/sn-platform-slim/templates/proxy/proxy-cluster.yaml index 7de69936..fe0b9337 100644 --- a/charts/sn-platform-slim/templates/proxy/proxy-cluster.yaml +++ b/charts/sn-platform-slim/templates/proxy/proxy-cluster.yaml @@ -38,6 +38,9 @@ metadata: {{- with .Values.proxy.pulsarProxy.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: brokerAddress: {{ template "pulsar.proxy.broker.service.address" . }} replicas: {{ .Values.proxy.replicaCount }} diff --git a/charts/sn-platform-slim/templates/pulsar-coordinator/pulsar-coordinator.yaml b/charts/sn-platform-slim/templates/pulsar-coordinator/pulsar-coordinator.yaml index 139b5940..a4a532e8 100644 --- a/charts/sn-platform-slim/templates/pulsar-coordinator/pulsar-coordinator.yaml +++ b/charts/sn-platform-slim/templates/pulsar-coordinator/pulsar-coordinator.yaml @@ -17,17 +17,12 @@ # under the License. # {{- if .Values.components.pulsar_coordinator }} -apiVersion: cloud.streamnative.io/v1alpha1 +apiVersion: k8s.streamnative.io/v1alpha1 kind: PulsarCoordinator metadata: - name: "{{ template "pulsar.fullname" . }}" + name: "{{ template "pulsar.fullname" . }}-coordinator" namespace: {{ template "pulsar.namespace" . }} - annotations: - helm.sh/hook: pre-install,pre-upgrade spec: - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - {{- if .Values.placement.availability_policy }} - placement: - availabilityPolicy: {{ .Values.placement.availability_policy }} - {{- end }} + toolSet: + enabled: false {{- end }} \ No newline at end of file diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml index dfb7c7f8..6b663aec 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml @@ -38,6 +38,9 @@ metadata: {{- with .Values.zookeeper.zooKeeperCluster.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: replicas: {{ .Values.zookeeper.replicaCount }} image: "{{ .Values.images.zookeeper.repository }}:{{ .Values.images.zookeeper.tag }}" diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index 5a6ec90b..7ac7dc9c 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -98,6 +98,9 @@ components: streamnative_console: true # pulsar detector pulsar_detector: true + # pulsar_coordinator is a new CRD from the sn-operator, make sure you already installed the sn-operator or + # upgrade from the pulsar-operator with the documentation of https://docs.streamnative.io/private/upgrade-from-pulsar-operators + pulsar_coordinator: false ## Monitoring Components ## diff --git a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml index 0b5b29ae..bb069f02 100644 --- a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml @@ -37,6 +37,9 @@ metadata: {{- with .Values.bookkeeper.bookKeeperCluster.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: {{- if not .Values.initialize }} initialized: true diff --git a/charts/sn-platform/templates/broker/broker-cluster.yaml b/charts/sn-platform/templates/broker/broker-cluster.yaml index f50a697d..353fe399 100644 --- a/charts/sn-platform/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform/templates/broker/broker-cluster.yaml @@ -38,6 +38,9 @@ metadata: {{- with .Values.broker.pulsarBroker.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: {{- if not .Values.initialize }} initialized: true diff --git a/charts/sn-platform/templates/proxy/proxy-cluster.yaml b/charts/sn-platform/templates/proxy/proxy-cluster.yaml index 0b3e90d1..ac11bfee 100644 --- a/charts/sn-platform/templates/proxy/proxy-cluster.yaml +++ b/charts/sn-platform/templates/proxy/proxy-cluster.yaml @@ -38,6 +38,9 @@ metadata: {{- with .Values.proxy.pulsarProxy.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: brokerAddress: {{ template "pulsar.proxy.broker.service.address" . }} replicas: {{ .Values.proxy.replicaCount }} diff --git a/charts/sn-platform/templates/pulsar-coordinator/pulsar-coordinator.yaml b/charts/sn-platform/templates/pulsar-coordinator/pulsar-coordinator.yaml index 139b5940..a4a532e8 100644 --- a/charts/sn-platform/templates/pulsar-coordinator/pulsar-coordinator.yaml +++ b/charts/sn-platform/templates/pulsar-coordinator/pulsar-coordinator.yaml @@ -17,17 +17,12 @@ # under the License. # {{- if .Values.components.pulsar_coordinator }} -apiVersion: cloud.streamnative.io/v1alpha1 +apiVersion: k8s.streamnative.io/v1alpha1 kind: PulsarCoordinator metadata: - name: "{{ template "pulsar.fullname" . }}" + name: "{{ template "pulsar.fullname" . }}-coordinator" namespace: {{ template "pulsar.namespace" . }} - annotations: - helm.sh/hook: pre-install,pre-upgrade spec: - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - {{- if .Values.placement.availability_policy }} - placement: - availabilityPolicy: {{ .Values.placement.availability_policy }} - {{- end }} + toolSet: + enabled: false {{- end }} \ No newline at end of file diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml index dfb7c7f8..6b663aec 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml @@ -38,6 +38,9 @@ metadata: {{- with .Values.zookeeper.zooKeeperCluster.labels -}} {{ toYaml . | nindent 4 }} {{- end }} +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} spec: replicas: {{ .Values.zookeeper.replicaCount }} image: "{{ .Values.images.zookeeper.repository }}:{{ .Values.images.zookeeper.tag }}" diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 353fb80b..3ae75fb8 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -106,6 +106,9 @@ components: superset: false # custom_metric_server custom_metric_server: false + # pulsar_coordinator is a new CRD from the sn-operator, make sure you already installed the sn-operator or + # upgrade from the pulsar-operator with the documentation of https://docs.streamnative.io/private/upgrade-from-pulsar-operators + pulsar_coordinator: false ## Monitoring Components ##