From 3041b6efe6fa86af6b9f65d75fad1a4eb06046f2 Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 26 May 2026 00:56:27 +0800 Subject: [PATCH 1/7] feat: support oxia metadata store --- .../sn-platform-slim/templates/_helpers.tpl | 99 +++++++++++++++++++ .../templates/bookkeeper/_bookkeeper.tpl | 4 + .../bookkeeper/bookkeeper-cluster.yaml | 10 +- .../templates/broker/broker-cluster.yaml | 17 ++++ .../function-worker-configfile-configmap.yaml | 4 + .../detector/pulsar-detector-deployment.yaml | 2 + charts/sn-platform-slim/templates/extra.yaml | 1 + .../templates/openshift/scc-rolebinding.yaml | 8 +- .../templates/oxia/oxia-cluster.yaml | 34 +++++++ .../templates/oxia/oxia-namespace.yaml | 37 +++++++ .../prometheus/prometheus-configmap.yaml | 67 ++++++++++++- .../prometheus/prometheus-statefulset.yaml | 6 +- .../templates/zookeeper/gen-zk-conf.yaml | 3 +- .../zookeeper-authorizationpolicy.yaml | 4 +- .../zookeeper-backup-clusterrolebinding.yaml | 2 +- .../zookeeper/zookeeper-backup-configmap.yaml | 2 +- .../zookeeper-backup-rolebinding.yaml | 2 +- .../zookeeper/zookeeper-backup-service.yaml | 2 +- .../zookeeper-backup-serviceaccount.yaml | 2 +- .../zookeeper-backup-statefulset.yaml | 2 +- .../zookeeper/zookeeper-cluster.yaml | 2 +- .../zookeeper-restore-clusterrolebinding.yaml | 2 +- .../zookeeper-restore-configmap.yaml | 4 +- .../zookeeper-restore-rolebinding.yaml | 2 +- .../zookeeper-restore-serviceaccount.yaml | 2 +- .../zookeeper/zookeeper-service-account.yaml | 2 +- .../zookeeper/zookeeper-storageclass.yaml | 2 +- charts/sn-platform-slim/values.yaml | 6 ++ charts/sn-platform/templates/_helpers.tpl | 99 +++++++++++++++++++ .../templates/bookkeeper/_bookkeeper.tpl | 4 + .../bookkeeper/bookkeeper-cluster.yaml | 18 +++- .../templates/broker/broker-cluster.yaml | 21 +++- .../function-worker-configfile-configmap.yaml | 4 + .../detector/pulsar-detector-deployment.yaml | 2 + charts/sn-platform/templates/extra.yaml | 1 + .../templates/openshift/scc-rolebinding.yaml | 4 +- .../templates/oxia/oxia-cluster.yaml | 31 ++++++ .../templates/oxia/oxia-namespace.yaml | 37 +++++++ .../prometheus/prometheus-configmap.yaml | 67 ++++++++++++- .../prometheus/prometheus-statefulset.yaml | 6 +- .../templates/zookeeper/gen-zk-conf.yaml | 3 +- .../zookeeper-authorizationpolicy.yaml | 4 +- .../zookeeper-backup-clusterrolebinding.yaml | 2 +- .../zookeeper/zookeeper-backup-configmap.yaml | 2 +- .../zookeeper-backup-rolebinding.yaml | 2 +- .../zookeeper/zookeeper-backup-service.yaml | 2 +- .../zookeeper-backup-serviceaccount.yaml | 2 +- .../zookeeper-backup-statefulset.yaml | 2 +- .../zookeeper/zookeeper-cluster.yaml | 2 +- .../zookeeper-restore-clusterrolebinding.yaml | 2 +- .../zookeeper-restore-configmap.yaml | 4 +- .../zookeeper-restore-rolebinding.yaml | 2 +- .../zookeeper-restore-serviceaccount.yaml | 2 +- .../zookeeper/zookeeper-service-account.yaml | 2 +- .../zookeeper/zookeeper-storageclass.yaml | 2 +- charts/sn-platform/values.yaml | 6 ++ examples/sn-platform/values-oxia.yaml | 3 + 57 files changed, 619 insertions(+), 49 deletions(-) create mode 100644 charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml create mode 100644 charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml create mode 100644 charts/sn-platform/templates/oxia/oxia-cluster.yaml create mode 100644 charts/sn-platform/templates/oxia/oxia-namespace.yaml create mode 100644 examples/sn-platform/values-oxia.yaml diff --git a/charts/sn-platform-slim/templates/_helpers.tpl b/charts/sn-platform-slim/templates/_helpers.tpl index b537d8374..75e09a71f 100644 --- a/charts/sn-platform-slim/templates/_helpers.tpl +++ b/charts/sn-platform-slim/templates/_helpers.tpl @@ -189,6 +189,96 @@ Pulsar Cluster Name. {{- end }} {{- end }} +{{/* +Metadata provider selection. +*/}} +{{- define "pulsar.metadata.provider" -}} +{{- default "zookeeper" .Values.pulsar_metadata.provider -}} +{{- end -}} + +{{- define "pulsar.metadata.isZookeeper" -}} +{{- if eq (include "pulsar.metadata.provider" .) "zookeeper" -}}true{{- end -}} +{{- end -}} + +{{- define "pulsar.metadata.isOxia" -}} +{{- if eq (include "pulsar.metadata.provider" .) "oxia" -}}true{{- end -}} +{{- end -}} + +{{- define "pulsar.oxia.cluster" -}} +{{- template "pulsar.fullname" . -}} +{{- end -}} + +{{- define "pulsar.oxia.service" -}} +{{- template "pulsar.oxia.cluster" . -}}-oxia +{{- end -}} + +{{- define "pulsar.oxia.service.address" -}} +{{- template "pulsar.oxia.service" . -}}.{{ template "pulsar.namespace" . }}.svc.cluster.local:6648 +{{- end -}} + +{{- define "pulsar.oxia.broker.namespace" -}} +broker +{{- end -}} + +{{- define "pulsar.oxia.bookkeeper.namespace" -}} +bookkeeper +{{- end -}} + +{{- define "pulsar.oxia.schema.namespace" -}} +pulsar-schema +{{- end -}} + +{{- define "pulsar.oxia.function.namespace" -}} +function +{{- end -}} + +{{- define "pulsar.oxia.broker.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.broker.namespace" . }} +{{- end -}} + +{{- define "pulsar.oxia.bookkeeper.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.bookkeeper.namespace" . }} +{{- end -}} + +{{- define "pulsar.oxia.schema.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.schema.namespace" . }} +{{- end -}} + +{{- define "pulsar.oxia.metadata.url" -}} +{{- template "pulsar.oxia.broker.url" . -}} +{{- end -}} + +{{- define "pulsar.oxia.bookkeeper.metadataServiceUri" -}} +metadata-store:{{ template "pulsar.oxia.bookkeeper.url" . }} +{{- end -}} + +{{- define "pulsar.oxia.podMonitor.enabled" -}} +{{- if and .Values.monitoring.prometheus (or (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PodMonitor") (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1")) -}} +true +{{- else -}} +false +{{- end -}} +{{- end -}} + +{{- define "pulsar.validate.metadata" -}} +{{- $provider := include "pulsar.metadata.provider" . -}} +{{- if and (ne $provider "zookeeper") (ne $provider "oxia") -}} +{{- fail "pulsar_metadata.provider must be one of: zookeeper, oxia" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.metadataPrefix -}} +{{- fail "metadataPrefix is only supported with pulsar_metadata.provider=zookeeper" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.pulsar_metadata.userProvidedZookeepers -}} +{{- fail "pulsar_metadata.userProvidedZookeepers is only supported with pulsar_metadata.provider=zookeeper" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.pulsar_metadata.configurationStoreServers -}} +{{- fail "pulsar_metadata.configurationStoreServers is only supported with pulsar_metadata.provider=zookeeper" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.components.sql_worker -}} +{{- fail "components.sql_worker is not supported with pulsar_metadata.provider=oxia" -}} +{{- end -}} +{{- end -}} + {{/* Istio gateway selector */}} @@ -213,6 +303,15 @@ prometheus.istio.io/merge-metrics: "false" {{- end -}} {{- end -}} +{{/* +Whether Prometheus should use sidecar-issued mTLS certs to scrape workload metrics. +*/}} +{{- define "pulsar.istio.prometheus.sidecarMTLS" -}} +{{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics) (ne (default "" .Values.istio.dataplaneMode) "ambient") -}} +true +{{- end -}} +{{- end -}} + {{/* Define TLS CA secret name */}} diff --git a/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl b/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl index 99c92204d..e968e4045 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl +++ b/charts/sn-platform-slim/templates/bookkeeper/_bookkeeper.tpl @@ -134,8 +134,12 @@ Define bookie tls certs volumes Define bookie common config */}} {{- define "pulsar.bookkeeper.config.common" -}} +{{- if include "pulsar.metadata.isOxia" . }} +metadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" +{{- else }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}" zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" +{{- end }} # enable bookkeeper http server httpServerEnabled: "true" httpServerPort: "{{ .Values.bookkeeper.ports.http }}" diff --git a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml index ddfe17de7..b600ec226 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml @@ -29,7 +29,11 @@ spec: {{- if not .Values.initialize }} initialized: true {{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + metadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" +{{- else }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}" +{{- end }} replicas: {{ .Values.bookkeeper.replicaCount }} {{- if not (and .Values.components.pulsar_coordinator .Values.images.coordinator) }} image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}" @@ -199,7 +203,11 @@ spec: {{- with .Values.bookkeeper.configData }} {{ toYaml . | indent 6 }} {{- end }} + {{- if include "pulsar.metadata.isZookeeper" . }} zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" + {{- else }} + metadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" + {{- end }} # enable bookkeeper http server httpServerEnabled: "true" httpServerPort: "{{ .Values.bookkeeper.ports.http }}" @@ -351,7 +359,7 @@ spec: {{- with .Values.bookkeeper.customization }} {{- toYaml . | nindent 2 -}} {{- end }} - {{- if .Values.zookeeper.customTools.restore.enable}} + {{- if and .Values.zookeeper.customTools.restore.enable (include "pulsar.metadata.isZookeeper" .) }} - match: groupVersionKinds: - kind: Job diff --git a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml index 9cd966496..f7a545f52 100644 --- a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml @@ -30,8 +30,14 @@ spec: {{- if not .Values.initialize }} initialized: true {{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + bkMetadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" +{{- else }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }}" configurationStoreServers: "{{ template "pulsar.configurationStore.connect" . }}{{ .Values.metadataPrefix }}" +{{- end }} {{- if not .Values.broker.autoScaling.enabled }} replicas: {{ .Values.broker.replicaCount }} {{- end }} @@ -226,6 +232,12 @@ spec: {{- if .Values.pulsar_metadata.clusterName }} clusterName: {{ .Values.pulsar_metadata.clusterName }} {{- end }} + {{- if include "pulsar.metadata.isOxia" . }} + oxiaBasedSystemTopic: + enabled: true + schemaStorageUrl: "{{ template "pulsar.oxia.schema.url" . }}" + topicPoliciesServiceClassName: "io.streamnative.pulsar.OxiaTopicPoliciesService" + {{- end }} {{- if .Values.broker.functionmesh.enabled }} function: enabled: true @@ -324,6 +336,11 @@ spec: {{- end }} custom: PULSAR_PREFIX_additionalServletDirectory: "./brokerAdditionalServlet" + {{- if include "pulsar.metadata.isOxia" . }} + PULSAR_PREFIX_metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + PULSAR_PREFIX_configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + PULSAR_PREFIX_enablePackagesManagement: "false" + {{- end }} {{- with .Values.broker.configData }} {{ toYaml . | indent 6 }} {{- end }} diff --git a/charts/sn-platform-slim/templates/broker/function-worker-configfile-configmap.yaml b/charts/sn-platform-slim/templates/broker/function-worker-configfile-configmap.yaml index 2f7d11c76..c83527543 100644 --- a/charts/sn-platform-slim/templates/broker/function-worker-configfile-configmap.yaml +++ b/charts/sn-platform-slim/templates/broker/function-worker-configfile-configmap.yaml @@ -65,7 +65,11 @@ data: pulsarServiceUrl: {{template "pulsar.function.broker.service.url" . }} pulsarWebServiceUrl: {{template "pulsar.function.web.service.url" . }} {{- end }} + {{- if include "pulsar.metadata.isOxia" . }} + configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + {{- else }} configurationStoreServers: "{{ template "pulsar.configurationStore.connect" . }}{{ .Values.metadataPrefix }}" + {{- end }} {{- if .Values.auth.authorization.enabled }} authorizationEnabled: "true" authorizationProvider: {{ .Values.functions.authorizationProvider }} diff --git a/charts/sn-platform-slim/templates/detector/pulsar-detector-deployment.yaml b/charts/sn-platform-slim/templates/detector/pulsar-detector-deployment.yaml index 9fea545ab..11e02f2b0 100644 --- a/charts/sn-platform-slim/templates/detector/pulsar-detector-deployment.yaml +++ b/charts/sn-platform-slim/templates/detector/pulsar-detector-deployment.yaml @@ -56,6 +56,7 @@ spec: terminationGracePeriodSeconds: {{ .Values.pulsar_detector.gracePeriod }} {{- if not .Values.istio.enabled }} initContainers: + {{- if include "pulsar.metadata.isZookeeper" . }} # This init container will wait for zookeeper to be ready before # deploying the bookies - name: wait-zookeeper-ready @@ -73,6 +74,7 @@ spec: volumeMounts: - name: tmp mountPath: /pulsar/logs + {{- end }} # This init container will wait for at least one broker to be ready before # deploying the pulsar-detector - name: wait-broker-ready diff --git a/charts/sn-platform-slim/templates/extra.yaml b/charts/sn-platform-slim/templates/extra.yaml index ef465d462..d8c94bc0a 100644 --- a/charts/sn-platform-slim/templates/extra.yaml +++ b/charts/sn-platform-slim/templates/extra.yaml @@ -1,6 +1,7 @@ # # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # +{{- include "pulsar.validate.metadata" . }} {{- range .Values.extraResources }} {{ toYaml . }} --- diff --git a/charts/sn-platform-slim/templates/openshift/scc-rolebinding.yaml b/charts/sn-platform-slim/templates/openshift/scc-rolebinding.yaml index 5ff59a6ff..6e83a8fd1 100644 --- a/charts/sn-platform-slim/templates/openshift/scc-rolebinding.yaml +++ b/charts/sn-platform-slim/templates/openshift/scc-rolebinding.yaml @@ -3,8 +3,10 @@ # {{- if and .Values.openshift.enabled .Values.openshift.scc.enabled -}} -{{- $sas := list (include "pulsar.zookeeper.serviceAccount" .) -}} -{{- $sas = append $sas (include "pulsar.bookkeeper.serviceAccount" .) -}} +{{- $sas := list (include "pulsar.bookkeeper.serviceAccount" .) -}} +{{- if include "pulsar.metadata.isZookeeper" . -}} +{{- $sas = append $sas (include "pulsar.zookeeper.serviceAccount" .) -}} +{{- end -}} {{- $sas = append $sas (include "pulsar.broker.serviceAccount" .) -}} {{- $sas = append $sas (include "pulsar.proxy.serviceAccount" .) -}} {{- $sas = append $sas (include "pulsar.streamnative_console.serviceAccount" .) -}} @@ -24,4 +26,4 @@ subjects: name: {{ . }} namespace: {{ include "pulsar.namespace" $ }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml new file mode 100644 index 000000000..b8e96fee9 --- /dev/null +++ b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml @@ -0,0 +1,34 @@ +# +# Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. +# +# deploy oxia only when `pulsar_metadata.provider` is oxia +{{- if include "pulsar.metadata.isOxia" . }} +apiVersion: k8s.streamnative.io/v1alpha1 +kind: OxiaCluster +metadata: + name: "{{ template "pulsar.oxia.cluster" . }}" + namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: oxia +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} +spec: + image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag }}" + imagePullPolicy: {{ .Values.images.oxia.pullPolicy }} + monitoringEnabled: {{ include "pulsar.oxia.podMonitor.enabled" . }} + server: + replicas: 3 + {{- if .Values.istio.enabled }} + istio: + enabled: true + {{- if .Values.istio.dataplaneMode }} + dataplaneMode: {{ .Values.istio.dataplaneMode }} + {{- end }} + {{- if .Values.istio.migration }} + mtls: + mode: permissive + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml b/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml new file mode 100644 index 000000000..904674141 --- /dev/null +++ b/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml @@ -0,0 +1,37 @@ +# +# Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. +# +# deploy oxia namespaces only when `pulsar_metadata.provider` is oxia +{{- if include "pulsar.metadata.isOxia" . }} +{{- $namespaces := list + (dict "name" (include "pulsar.oxia.broker.namespace" .) "type" "broker") + (dict "name" (include "pulsar.oxia.bookkeeper.namespace" .) "type" "bookkeeper") + (dict "name" (include "pulsar.oxia.schema.namespace" .) "type" "pulsar-schema") + (dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function") +}} +{{- range $index, $oxiaNamespace := $namespaces }} +{{- if $index }} +--- +{{- end }} +apiVersion: k8s.streamnative.io/v1alpha1 +kind: OxiaNamespace +metadata: + name: "{{ template "pulsar.oxia.cluster" $ }}-{{ $oxiaNamespace.type }}" + namespace: {{ template "pulsar.namespace" $ }} + labels: + {{- include "pulsar.standardLabels" $ | nindent 4 }} + component: oxia +spec: + namespaceConfig: + name: "{{ $oxiaNamespace.name }}" + initialShardCount: 1 + replicationFactor: 3 + notificationsEnabled: true + clusterRef: + name: "{{ template "pulsar.oxia.cluster" $ }}" + namespace: {{ template "pulsar.namespace" $ }} + ownerRef: + name: "{{ template "pulsar.fullname" $ }}" + namespace: {{ template "pulsar.namespace" $ }} +{{- end }} +{{- end }} diff --git a/charts/sn-platform-slim/templates/prometheus/prometheus-configmap.yaml b/charts/sn-platform-slim/templates/prometheus/prometheus-configmap.yaml index 030dd3add..230eca8bd 100644 --- a/charts/sn-platform-slim/templates/prometheus/prometheus-configmap.yaml +++ b/charts/sn-platform-slim/templates/prometheus/prometheus-configmap.yaml @@ -57,7 +57,7 @@ data: names: - {{ template "pulsar.namespace" . }} {{- end }} -{{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics) }} +{{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} {{- if .Values.istio.migration }} scheme: http enable_http2: false @@ -82,6 +82,12 @@ data: - source_labels: [__meta_kubernetes_pod_label_component] action: drop regex: "{{ .Values.prometheus.component }}|{{ .Values.grafana.component }}|{{ .Values.toolset.component }}|{{ .Values.streamnative_console.component }}" +{{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + # Oxia has two metrics ports. Dedicated Oxia scrape config below handles both. + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance] + action: drop + regex: "{{ template "pulsar.oxia.service" . }}" {{- end }} - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] action: keep @@ -100,8 +106,13 @@ data: - source_labels: [__meta_kubernetes_namespace] action: replace target_label: kubernetes_namespace + - source_labels: [__meta_kubernetes_pod_label_cloud_streamnative_io_component] + action: replace + regex: (.+) + target_label: job - source_labels: [__meta_kubernetes_pod_label_component] action: replace + regex: (.+) target_label: job - source_labels: [__meta_kubernetes_pod_name] action: replace @@ -112,6 +123,60 @@ data: {{ toYaml . | indent 6 }} {{- end }} {{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + - job_name: 'oxia' +{{- if .Values.prometheus.sampleLimit }} + sample_limit: {{ .Values.prometheus.sampleLimit }} +{{- end }} + kubernetes_sd_configs: + - role: pod +{{- if or .Values.istio.enabled (not .Values.prometheus.serviceAccount.clusterRole) }} + namespaces: + names: + - {{ template "pulsar.namespace" . }} +{{- end }} +{{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} +{{- if .Values.istio.migration }} + scheme: http + enable_http2: false +{{- else }} + scheme: https + # Disable http2 for Prometheus issue: https://github.com/prometheus/prometheus/issues/10213 + enable_http2: false + tls_config: + ca_file: /etc/prom-certs/root-cert.pem + cert_file: /etc/prom-certs/cert-chain.pem + key_file: /etc/prom-certs/key.pem + insecure_skip_verify: true +{{- end }} +{{- end }} + relabel_configs: + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance] + action: keep + regex: "{{ template "pulsar.oxia.service" . }}" + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name] + action: keep + regex: oxia-cluster + - source_labels: [__meta_kubernetes_pod_container_port_name] + action: keep + regex: metrics|coord-metrics + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: kubernetes_namespace + - target_label: job + replacement: oxia + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: kubernetes_pod_name + metric_relabel_configs: +{{- if .Values.prometheus.customRelabelConfigs -}} +{{- with .Values.prometheus.customRelabelConfigs }} +{{ toYaml . | indent 6 }} +{{- end }} +{{- end }} +{{- end }} {{- if and .Values.prometheus.serviceAccount.clusterRole (or (not (hasKey .Values.prometheus.scrape "kubernetesNodes")) (eq .Values.prometheus.scrape.kubernetesNodes true)) }} - job_name: 'kubernetes-nodes' scheme: https diff --git a/charts/sn-platform-slim/templates/prometheus/prometheus-statefulset.yaml b/charts/sn-platform-slim/templates/prometheus/prometheus-statefulset.yaml index c2b72c7b2..4d16cd349 100644 --- a/charts/sn-platform-slim/templates/prometheus/prometheus-statefulset.yaml +++ b/charts/sn-platform-slim/templates/prometheus/prometheus-statefulset.yaml @@ -37,7 +37,7 @@ spec: {{ toYaml . | indent 8 }} {{- end }} annotations: - {{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics ) }} + {{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} # ref: https://istio.io/latest/docs/ops/integrations/prometheus/#tls-settings traffic.sidecar.istio.io/includeOutboundIPRanges: "" # do not intercept any outbound traffic # configure an env variable `OUTPUT_CERTS` to write certificates to the given folder @@ -158,7 +158,7 @@ spec: mountPath: /etc/config - name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}" mountPath: /prometheus - {{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics ) }} + {{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} - name: istio-certs mountPath: /etc/prom-certs/ {{- end }} @@ -167,7 +167,7 @@ spec: - name: config-volume configMap: name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}" - {{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics )}} + {{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} - emptyDir: medium: Memory name: istio-certs diff --git a/charts/sn-platform-slim/templates/zookeeper/gen-zk-conf.yaml b/charts/sn-platform-slim/templates/zookeeper/gen-zk-conf.yaml index 95b4787f9..6b936ac6d 100644 --- a/charts/sn-platform-slim/templates/zookeeper/gen-zk-conf.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/gen-zk-conf.yaml @@ -1,7 +1,7 @@ # # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # - +{{- if include "pulsar.metadata.isZookeeper" . }} apiVersion: v1 kind: ConfigMap metadata: @@ -66,3 +66,4 @@ data: echo $MY_ID > $DATA_DIR/myid fi fi +{{- end }} diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-authorizationpolicy.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-authorizationpolicy.yaml index 7c4e26b43..685e7179d 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-authorizationpolicy.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-authorizationpolicy.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if and .Values.components.zookeeper .Values.istio.enabled }} +{{- if and .Values.components.zookeeper .Values.istio.enabled (include "pulsar.metadata.isZookeeper" .) }} apiVersion: security.istio.io/v1beta1 kind: AuthorizationPolicy metadata: @@ -33,4 +33,4 @@ spec: cloud.streamnative.io/app: pulsar cloud.streamnative.io/component: zookeeper cloud.streamnative.io/cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml index e7224b083..4f199d675 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml @@ -3,7 +3,7 @@ # {{- if .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-configmap.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-configmap.yaml index ab6eb9d54..c31c6444b 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-configmap.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-configmap.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.backup.enable` is true -{{- if .Values.zookeeper.customTools.backup.enable }} +{{- if and .Values.zookeeper.customTools.backup.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-rolebinding.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-rolebinding.yaml index db512131d..bd26c232a 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-rolebinding.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-rolebinding.yaml @@ -3,7 +3,7 @@ # {{- if not .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-service.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-service.yaml index 0644cb011..5d5c54ea3 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-service.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-service.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.backup.enable` is true -{{- if .Values.zookeeper.customTools.backup.enable }} +{{- if and .Values.zookeeper.customTools.backup.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: Service metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-serviceaccount.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-serviceaccount.yaml index 2c7a3628b..c337ed77b 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-serviceaccount.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-serviceaccount.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml index 29aff777d..beef397a1 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.backup.enable` is true -{{- if .Values.zookeeper.customTools.backup.enable }} +{{- if and .Values.zookeeper.customTools.backup.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml index e72209f4a..e81c52196 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # # deploy zookeeper only when `components.zookeeper` is true -{{- if .Values.components.zookeeper }} +{{- if and .Values.components.zookeeper (include "pulsar.metadata.isZookeeper" .) }} apiVersion: zookeeper.streamnative.io/v1alpha1 kind: ZooKeeperCluster metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml index a11824e49..6f8ec17f8 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml @@ -3,7 +3,7 @@ # {{- if .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml index ac7eded35..8d9693267 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.restore.enable` is true -{{- if .Values.zookeeper.customTools.restore.enable }} +{{- if and .Values.zookeeper.customTools.restore.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ConfigMap metadata: @@ -24,4 +24,4 @@ data: cleanupBookieMeta={{ .Values.zookeeper.customTools.restore.cleanupBookieMeta }} cleanupClusterMeta={{ .Values.zookeeper.customTools.restore.cleanupClusterMeta }} {{ toYaml .Values.zookeeper.customTools.restore.configData | indent 2 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-rolebinding.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-rolebinding.yaml index bc49c1ea4..148abb1dc 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-rolebinding.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-rolebinding.yaml @@ -3,7 +3,7 @@ # {{- if not .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-serviceaccount.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-serviceaccount.yaml index c4b817cdc..ee5f4bd70 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-serviceaccount.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-serviceaccount.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-service-account.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-service-account.yaml index b1411929e..e30c05937 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-service-account.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-service-account.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if and .Values.components.zookeeper .Values.zookeeper.serviceAccount.create }} +{{- if and .Values.components.zookeeper .Values.zookeeper.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-storageclass.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-storageclass.yaml index 41835d846..7812c1cfb 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-storageclass.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-storageclass.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `components.zookeeper` is true -{{- if .Values.components.zookeeper }} +{{- if and .Values.components.zookeeper (include "pulsar.metadata.isZookeeper" .) }} {{- if and .Values.volumes.persistence .Values.zookeeper.volumes.persistence }} # define the storage class for data directory diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index 1f1464dae..d97727e27 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -122,6 +122,10 @@ images: repository: "streamnative/pulsar-metadata-tool" tag: "3.3.3.3" pullPolicy: IfNotPresent + oxia: + repository: oxia/oxia + tag: "0.16.4" + pullPolicy: IfNotPresent bookie: repository: streamnative/sn-platform-slim tag: "3.3.3.3" @@ -1114,6 +1118,8 @@ autorecovery: ## metadata deployed pulsar_metadata: component: pulsar-init + # metadata provider. Valid values: zookeeper, oxia + provider: zookeeper # set the cluster name. if empty or not specified, # it will use helm release name to generate a cluster name. clusterName: "" diff --git a/charts/sn-platform/templates/_helpers.tpl b/charts/sn-platform/templates/_helpers.tpl index 85552cb19..3f9a27fc3 100644 --- a/charts/sn-platform/templates/_helpers.tpl +++ b/charts/sn-platform/templates/_helpers.tpl @@ -187,6 +187,96 @@ Pulsar Cluster Name. {{- end }} {{- end }} +{{/* +Metadata provider selection. +*/}} +{{- define "pulsar.metadata.provider" -}} +{{- default "zookeeper" .Values.pulsar_metadata.provider -}} +{{- end -}} + +{{- define "pulsar.metadata.isZookeeper" -}} +{{- if eq (include "pulsar.metadata.provider" .) "zookeeper" -}}true{{- end -}} +{{- end -}} + +{{- define "pulsar.metadata.isOxia" -}} +{{- if eq (include "pulsar.metadata.provider" .) "oxia" -}}true{{- end -}} +{{- end -}} + +{{- define "pulsar.oxia.cluster" -}} +{{- template "pulsar.fullname" . -}} +{{- end -}} + +{{- define "pulsar.oxia.service" -}} +{{- template "pulsar.oxia.cluster" . -}}-oxia +{{- end -}} + +{{- define "pulsar.oxia.service.address" -}} +{{- template "pulsar.oxia.service" . -}}.{{ template "pulsar.namespace" . }}.svc.cluster.local:6648 +{{- end -}} + +{{- define "pulsar.oxia.broker.namespace" -}} +broker +{{- end -}} + +{{- define "pulsar.oxia.bookkeeper.namespace" -}} +bookkeeper +{{- end -}} + +{{- define "pulsar.oxia.schema.namespace" -}} +pulsar-schema +{{- end -}} + +{{- define "pulsar.oxia.function.namespace" -}} +function +{{- end -}} + +{{- define "pulsar.oxia.broker.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.broker.namespace" . }} +{{- end -}} + +{{- define "pulsar.oxia.bookkeeper.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.bookkeeper.namespace" . }} +{{- end -}} + +{{- define "pulsar.oxia.schema.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.schema.namespace" . }} +{{- end -}} + +{{- define "pulsar.oxia.metadata.url" -}} +{{- template "pulsar.oxia.broker.url" . -}} +{{- end -}} + +{{- define "pulsar.oxia.bookkeeper.metadataServiceUri" -}} +metadata-store:{{ template "pulsar.oxia.bookkeeper.url" . }} +{{- end -}} + +{{- define "pulsar.oxia.podMonitor.enabled" -}} +{{- if and .Values.monitoring.prometheus (or (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PodMonitor") (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1")) -}} +true +{{- else -}} +false +{{- end -}} +{{- end -}} + +{{- define "pulsar.validate.metadata" -}} +{{- $provider := include "pulsar.metadata.provider" . -}} +{{- if and (ne $provider "zookeeper") (ne $provider "oxia") -}} +{{- fail "pulsar_metadata.provider must be one of: zookeeper, oxia" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.metadataPrefix -}} +{{- fail "metadataPrefix is only supported with pulsar_metadata.provider=zookeeper" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.pulsar_metadata.userProvidedZookeepers -}} +{{- fail "pulsar_metadata.userProvidedZookeepers is only supported with pulsar_metadata.provider=zookeeper" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.pulsar_metadata.configurationStoreServers -}} +{{- fail "pulsar_metadata.configurationStoreServers is only supported with pulsar_metadata.provider=zookeeper" -}} +{{- end -}} +{{- if and (eq $provider "oxia") .Values.components.sql_worker -}} +{{- fail "components.sql_worker is not supported with pulsar_metadata.provider=oxia" -}} +{{- end -}} +{{- end -}} + {{/* Istio gateway selector */}} @@ -211,6 +301,15 @@ prometheus.istio.io/merge-metrics: "false" {{- end -}} {{- end -}} +{{/* +Whether Prometheus should use sidecar-issued mTLS certs to scrape workload metrics. +*/}} +{{- define "pulsar.istio.prometheus.sidecarMTLS" -}} +{{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics) (ne (default "" .Values.istio.dataplaneMode) "ambient") -}} +true +{{- end -}} +{{- end -}} + {{/* Define TLS CA secret name */}} diff --git a/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl b/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl index 21d8ca697..3eb808a48 100644 --- a/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl +++ b/charts/sn-platform/templates/bookkeeper/_bookkeeper.tpl @@ -134,8 +134,12 @@ Define bookie tls certs volumes Define bookie common config */}} {{- define "pulsar.bookkeeper.config.common" -}} +{{- if include "pulsar.metadata.isOxia" . }} +metadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" +{{- else }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}" zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" +{{- end }} # enable bookkeeper http server httpServerEnabled: "true" httpServerPort: "{{ .Values.bookkeeper.ports.http }}" diff --git a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml index 1241b08ce..5ccbf6633 100644 --- a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml @@ -29,7 +29,11 @@ spec: {{- if not .Values.initialize }} initialized: true {{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + metadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" +{{- else }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}" +{{- end }} replicas: {{ .Values.bookkeeper.replicaCount }} {{- if not (and .Values.components.pulsar_coordinator .Values.images.coordinator) }} image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}" @@ -176,6 +180,14 @@ spec: {{- include "pulsar.bookkeeper.ledgers.storage.class" . | nindent 8 }} reclaimPolicy: {{ .Values.bookkeeper.volumes.reclaimPolicy | default "Delete" }} {{- end }} + {{- if .Values.istio.enabled }} + istio: + enabled: true + {{- if .Values.istio.migration }} + mtls: + mode: permissive + {{- end }} + {{- end }} config: {{- with .Values.bookkeeper.rackAwareTopologyLabels }} rackAwareTopologyLabels: @@ -188,7 +200,11 @@ spec: {{- with .Values.bookkeeper.configData }} {{ toYaml . | indent 6 }} {{- end }} + {{- if include "pulsar.metadata.isZookeeper" . }} zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" + {{- else }} + metadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" + {{- end }} # enable bookkeeper http server httpServerEnabled: "true" httpServerPort: "{{ .Values.bookkeeper.ports.http }}" @@ -340,7 +356,7 @@ spec: {{- with .Values.bookkeeper.customization }} {{- toYaml . | nindent 2 -}} {{- end }} - {{- if .Values.zookeeper.customTools.restore.enable}} + {{- if and .Values.zookeeper.customTools.restore.enable (include "pulsar.metadata.isZookeeper" .) }} - match: groupVersionKinds: - kind: Job diff --git a/charts/sn-platform/templates/broker/broker-cluster.yaml b/charts/sn-platform/templates/broker/broker-cluster.yaml index c5268848d..6f2cccc8f 100644 --- a/charts/sn-platform/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform/templates/broker/broker-cluster.yaml @@ -30,8 +30,14 @@ spec: {{- if not .Values.initialize }} initialized: true {{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + bkMetadataServiceUri: "{{ template "pulsar.oxia.bookkeeper.metadataServiceUri" . }}" +{{- else }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }}" configurationStoreServers: "{{ template "pulsar.configurationStore.connect" . }}{{ .Values.metadataPrefix }}" +{{- end }} {{- if not .Values.broker.autoScaling.enabled }} replicas: {{ .Values.broker.replicaCount }} {{- end }} @@ -171,13 +177,14 @@ spec: certSecretName: "{{ template "pulsar.broker.tls.secret.name" . }}" trustCertsEnabled: {{ .Values.tls.broker.trustCertsEnabled }} {{- end }} - {{- if and .Values.istio.enabled .Values.ingress.broker.enabled }} + {{- if .Values.istio.enabled }} istio: enabled: true {{- if .Values.istio.migration }} mtls: mode: permissive {{- end }} + {{- if .Values.ingress.broker.enabled }} gateway: selector: {{- include "pulsar.istio.gateway.selector" . | indent 8 }} @@ -190,6 +197,7 @@ spec: trustCertsEnabled: {{ .Values.tls.broker.gateway.trustCertsEnabled }} mode: "passthrough" {{- end }} + {{- end }} {{- end }} {{- if and .Values.broker.pulsarBroker.networking .Values.broker.pulsarBroker.networking.podService .Values.broker.pulsarBroker.networking.podService.enabled }} networking: @@ -225,6 +233,12 @@ spec: {{- if .Values.pulsar_metadata.clusterName }} clusterName: {{ .Values.pulsar_metadata.clusterName }} {{- end }} + {{- if include "pulsar.metadata.isOxia" . }} + oxiaBasedSystemTopic: + enabled: true + schemaStorageUrl: "{{ template "pulsar.oxia.schema.url" . }}" + topicPoliciesServiceClassName: "io.streamnative.pulsar.OxiaTopicPoliciesService" + {{- end }} {{- if .Values.broker.functionmesh.enabled }} function: enabled: true @@ -323,6 +337,11 @@ spec: {{- end }} custom: PULSAR_PREFIX_additionalServletDirectory: "./brokerAdditionalServlet" + {{- if include "pulsar.metadata.isOxia" . }} + PULSAR_PREFIX_metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + PULSAR_PREFIX_configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + PULSAR_PREFIX_enablePackagesManagement: "false" + {{- end }} {{- with .Values.broker.configData }} {{ toYaml . | indent 6 }} {{- end }} diff --git a/charts/sn-platform/templates/broker/function-worker-configfile-configmap.yaml b/charts/sn-platform/templates/broker/function-worker-configfile-configmap.yaml index 2f7d11c76..c83527543 100644 --- a/charts/sn-platform/templates/broker/function-worker-configfile-configmap.yaml +++ b/charts/sn-platform/templates/broker/function-worker-configfile-configmap.yaml @@ -65,7 +65,11 @@ data: pulsarServiceUrl: {{template "pulsar.function.broker.service.url" . }} pulsarWebServiceUrl: {{template "pulsar.function.web.service.url" . }} {{- end }} + {{- if include "pulsar.metadata.isOxia" . }} + configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" + {{- else }} configurationStoreServers: "{{ template "pulsar.configurationStore.connect" . }}{{ .Values.metadataPrefix }}" + {{- end }} {{- if .Values.auth.authorization.enabled }} authorizationEnabled: "true" authorizationProvider: {{ .Values.functions.authorizationProvider }} diff --git a/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml b/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml index 161fa5c04..d0dcaf30d 100644 --- a/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml +++ b/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml @@ -56,6 +56,7 @@ spec: terminationGracePeriodSeconds: {{ .Values.pulsar_detector.gracePeriod }} {{- if not .Values.istio.enabled }} initContainers: + {{- if include "pulsar.metadata.isZookeeper" . }} # This init container will wait for zookeeper to be ready before # deploying the bookies - name: wait-zookeeper-ready @@ -73,6 +74,7 @@ spec: volumeMounts: - name: tmp mountPath: /pulsar/logs + {{- end }} # This init container will wait for at least one broker to be ready before # deploying the pulsar-detector - name: wait-broker-ready diff --git a/charts/sn-platform/templates/extra.yaml b/charts/sn-platform/templates/extra.yaml index ef465d462..d8c94bc0a 100644 --- a/charts/sn-platform/templates/extra.yaml +++ b/charts/sn-platform/templates/extra.yaml @@ -1,6 +1,7 @@ # # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # +{{- include "pulsar.validate.metadata" . }} {{- range .Values.extraResources }} {{ toYaml . }} --- diff --git a/charts/sn-platform/templates/openshift/scc-rolebinding.yaml b/charts/sn-platform/templates/openshift/scc-rolebinding.yaml index 5ec34731e..760967990 100644 --- a/charts/sn-platform/templates/openshift/scc-rolebinding.yaml +++ b/charts/sn-platform/templates/openshift/scc-rolebinding.yaml @@ -4,7 +4,9 @@ {{- if and .Values.openshift.enabled .Values.openshift.scc.enabled -}} {{- $sas := list (include "pulsar.vault.serviceAccount" .) -}} +{{- if include "pulsar.metadata.isZookeeper" . -}} {{- $sas = append $sas (include "pulsar.zookeeper.serviceAccount" .) -}} +{{- end -}} {{- $sas = append $sas (include "pulsar.bookkeeper.serviceAccount" .) -}} {{- $sas = append $sas (include "pulsar.broker.serviceAccount" .) -}} {{- $sas = append $sas (include "pulsar.proxy.serviceAccount" .) -}} @@ -25,4 +27,4 @@ subjects: name: {{ . }} namespace: {{ include "pulsar.namespace" $ }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/sn-platform/templates/oxia/oxia-cluster.yaml b/charts/sn-platform/templates/oxia/oxia-cluster.yaml new file mode 100644 index 000000000..0e2b6af07 --- /dev/null +++ b/charts/sn-platform/templates/oxia/oxia-cluster.yaml @@ -0,0 +1,31 @@ +# +# Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. +# +# deploy oxia only when `pulsar_metadata.provider` is oxia +{{- if include "pulsar.metadata.isOxia" . }} +apiVersion: k8s.streamnative.io/v1alpha1 +kind: OxiaCluster +metadata: + name: "{{ template "pulsar.oxia.cluster" . }}" + namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: oxia +{{- if .Values.components.pulsar_coordinator }} + k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" +{{- end }} +spec: + image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag }}" + imagePullPolicy: {{ .Values.images.oxia.pullPolicy }} + monitoringEnabled: {{ include "pulsar.oxia.podMonitor.enabled" . }} + server: + replicas: 3 + {{- if .Values.istio.enabled }} + istio: + enabled: true + {{- if .Values.istio.migration }} + mtls: + mode: permissive + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/sn-platform/templates/oxia/oxia-namespace.yaml b/charts/sn-platform/templates/oxia/oxia-namespace.yaml new file mode 100644 index 000000000..904674141 --- /dev/null +++ b/charts/sn-platform/templates/oxia/oxia-namespace.yaml @@ -0,0 +1,37 @@ +# +# Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. +# +# deploy oxia namespaces only when `pulsar_metadata.provider` is oxia +{{- if include "pulsar.metadata.isOxia" . }} +{{- $namespaces := list + (dict "name" (include "pulsar.oxia.broker.namespace" .) "type" "broker") + (dict "name" (include "pulsar.oxia.bookkeeper.namespace" .) "type" "bookkeeper") + (dict "name" (include "pulsar.oxia.schema.namespace" .) "type" "pulsar-schema") + (dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function") +}} +{{- range $index, $oxiaNamespace := $namespaces }} +{{- if $index }} +--- +{{- end }} +apiVersion: k8s.streamnative.io/v1alpha1 +kind: OxiaNamespace +metadata: + name: "{{ template "pulsar.oxia.cluster" $ }}-{{ $oxiaNamespace.type }}" + namespace: {{ template "pulsar.namespace" $ }} + labels: + {{- include "pulsar.standardLabels" $ | nindent 4 }} + component: oxia +spec: + namespaceConfig: + name: "{{ $oxiaNamespace.name }}" + initialShardCount: 1 + replicationFactor: 3 + notificationsEnabled: true + clusterRef: + name: "{{ template "pulsar.oxia.cluster" $ }}" + namespace: {{ template "pulsar.namespace" $ }} + ownerRef: + name: "{{ template "pulsar.fullname" $ }}" + namespace: {{ template "pulsar.namespace" $ }} +{{- end }} +{{- end }} diff --git a/charts/sn-platform/templates/prometheus/prometheus-configmap.yaml b/charts/sn-platform/templates/prometheus/prometheus-configmap.yaml index 030dd3add..230eca8bd 100644 --- a/charts/sn-platform/templates/prometheus/prometheus-configmap.yaml +++ b/charts/sn-platform/templates/prometheus/prometheus-configmap.yaml @@ -57,7 +57,7 @@ data: names: - {{ template "pulsar.namespace" . }} {{- end }} -{{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics) }} +{{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} {{- if .Values.istio.migration }} scheme: http enable_http2: false @@ -82,6 +82,12 @@ data: - source_labels: [__meta_kubernetes_pod_label_component] action: drop regex: "{{ .Values.prometheus.component }}|{{ .Values.grafana.component }}|{{ .Values.toolset.component }}|{{ .Values.streamnative_console.component }}" +{{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + # Oxia has two metrics ports. Dedicated Oxia scrape config below handles both. + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance] + action: drop + regex: "{{ template "pulsar.oxia.service" . }}" {{- end }} - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] action: keep @@ -100,8 +106,13 @@ data: - source_labels: [__meta_kubernetes_namespace] action: replace target_label: kubernetes_namespace + - source_labels: [__meta_kubernetes_pod_label_cloud_streamnative_io_component] + action: replace + regex: (.+) + target_label: job - source_labels: [__meta_kubernetes_pod_label_component] action: replace + regex: (.+) target_label: job - source_labels: [__meta_kubernetes_pod_name] action: replace @@ -112,6 +123,60 @@ data: {{ toYaml . | indent 6 }} {{- end }} {{- end }} +{{- if include "pulsar.metadata.isOxia" . }} + - job_name: 'oxia' +{{- if .Values.prometheus.sampleLimit }} + sample_limit: {{ .Values.prometheus.sampleLimit }} +{{- end }} + kubernetes_sd_configs: + - role: pod +{{- if or .Values.istio.enabled (not .Values.prometheus.serviceAccount.clusterRole) }} + namespaces: + names: + - {{ template "pulsar.namespace" . }} +{{- end }} +{{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} +{{- if .Values.istio.migration }} + scheme: http + enable_http2: false +{{- else }} + scheme: https + # Disable http2 for Prometheus issue: https://github.com/prometheus/prometheus/issues/10213 + enable_http2: false + tls_config: + ca_file: /etc/prom-certs/root-cert.pem + cert_file: /etc/prom-certs/cert-chain.pem + key_file: /etc/prom-certs/key.pem + insecure_skip_verify: true +{{- end }} +{{- end }} + relabel_configs: + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance] + action: keep + regex: "{{ template "pulsar.oxia.service" . }}" + - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name] + action: keep + regex: oxia-cluster + - source_labels: [__meta_kubernetes_pod_container_port_name] + action: keep + regex: metrics|coord-metrics + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: kubernetes_namespace + - target_label: job + replacement: oxia + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: kubernetes_pod_name + metric_relabel_configs: +{{- if .Values.prometheus.customRelabelConfigs -}} +{{- with .Values.prometheus.customRelabelConfigs }} +{{ toYaml . | indent 6 }} +{{- end }} +{{- end }} +{{- end }} {{- if and .Values.prometheus.serviceAccount.clusterRole (or (not (hasKey .Values.prometheus.scrape "kubernetesNodes")) (eq .Values.prometheus.scrape.kubernetesNodes true)) }} - job_name: 'kubernetes-nodes' scheme: https diff --git a/charts/sn-platform/templates/prometheus/prometheus-statefulset.yaml b/charts/sn-platform/templates/prometheus/prometheus-statefulset.yaml index 0304b35b7..4d16cd349 100644 --- a/charts/sn-platform/templates/prometheus/prometheus-statefulset.yaml +++ b/charts/sn-platform/templates/prometheus/prometheus-statefulset.yaml @@ -37,7 +37,7 @@ spec: {{ toYaml . | indent 8 }} {{- end }} annotations: - {{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics ) }} + {{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} # ref: https://istio.io/latest/docs/ops/integrations/prometheus/#tls-settings traffic.sidecar.istio.io/includeOutboundIPRanges: "" # do not intercept any outbound traffic # configure an env variable `OUTPUT_CERTS` to write certificates to the given folder @@ -158,7 +158,7 @@ spec: mountPath: /etc/config - name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}" mountPath: /prometheus - {{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics ) }} + {{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} - name: istio-certs mountPath: /etc/prom-certs/ {{- end }} @@ -167,7 +167,7 @@ spec: - name: config-volume configMap: name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}" - {{- if and .Values.istio.enabled (not .Values.istio.mergeMetrics ) }} + {{- if eq (include "pulsar.istio.prometheus.sidecarMTLS" .) "true" }} - emptyDir: medium: Memory name: istio-certs diff --git a/charts/sn-platform/templates/zookeeper/gen-zk-conf.yaml b/charts/sn-platform/templates/zookeeper/gen-zk-conf.yaml index 95b4787f9..6b936ac6d 100644 --- a/charts/sn-platform/templates/zookeeper/gen-zk-conf.yaml +++ b/charts/sn-platform/templates/zookeeper/gen-zk-conf.yaml @@ -1,7 +1,7 @@ # # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # - +{{- if include "pulsar.metadata.isZookeeper" . }} apiVersion: v1 kind: ConfigMap metadata: @@ -66,3 +66,4 @@ data: echo $MY_ID > $DATA_DIR/myid fi fi +{{- end }} diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-authorizationpolicy.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-authorizationpolicy.yaml index 7c4e26b43..685e7179d 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-authorizationpolicy.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-authorizationpolicy.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if and .Values.components.zookeeper .Values.istio.enabled }} +{{- if and .Values.components.zookeeper .Values.istio.enabled (include "pulsar.metadata.isZookeeper" .) }} apiVersion: security.istio.io/v1beta1 kind: AuthorizationPolicy metadata: @@ -33,4 +33,4 @@ spec: cloud.streamnative.io/app: pulsar cloud.streamnative.io/component: zookeeper cloud.streamnative.io/cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml index e7224b083..4f199d675 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-backup-clusterrolebinding.yaml @@ -3,7 +3,7 @@ # {{- if .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-backup-configmap.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-backup-configmap.yaml index ab6eb9d54..c31c6444b 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-backup-configmap.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-backup-configmap.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.backup.enable` is true -{{- if .Values.zookeeper.customTools.backup.enable }} +{{- if and .Values.zookeeper.customTools.backup.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-backup-rolebinding.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-backup-rolebinding.yaml index db512131d..bd26c232a 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-backup-rolebinding.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-backup-rolebinding.yaml @@ -3,7 +3,7 @@ # {{- if not .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.backup.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-backup-service.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-backup-service.yaml index 0644cb011..5d5c54ea3 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-backup-service.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-backup-service.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.backup.enable` is true -{{- if .Values.zookeeper.customTools.backup.enable }} +{{- if and .Values.zookeeper.customTools.backup.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: Service metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-backup-serviceaccount.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-backup-serviceaccount.yaml index 2c7a3628b..c337ed77b 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-backup-serviceaccount.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-backup-serviceaccount.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml index db94f9a6b..029eb3244 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.backup.enable` is true -{{- if .Values.zookeeper.customTools.backup.enable }} +{{- if and .Values.zookeeper.customTools.backup.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml index 879bd3583..fd6693907 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # # deploy zookeeper only when `components.zookeeper` is true -{{- if .Values.components.zookeeper }} +{{- if and .Values.components.zookeeper (include "pulsar.metadata.isZookeeper" .) }} apiVersion: zookeeper.streamnative.io/v1alpha1 kind: ZooKeeperCluster metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml index a11824e49..6f8ec17f8 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-restore-clusterrolebinding.yaml @@ -3,7 +3,7 @@ # {{- if .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml index ac7eded35..8d9693267 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `zookeeper.customTools.restore.enable` is true -{{- if .Values.zookeeper.customTools.restore.enable }} +{{- if and .Values.zookeeper.customTools.restore.enable (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ConfigMap metadata: @@ -24,4 +24,4 @@ data: cleanupBookieMeta={{ .Values.zookeeper.customTools.restore.cleanupBookieMeta }} cleanupClusterMeta={{ .Values.zookeeper.customTools.restore.cleanupClusterMeta }} {{ toYaml .Values.zookeeper.customTools.restore.configData | indent 2 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-restore-rolebinding.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-restore-rolebinding.yaml index bc49c1ea4..148abb1dc 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-restore-rolebinding.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-restore-rolebinding.yaml @@ -3,7 +3,7 @@ # {{- if not .Values.zookeeper.customTools.serviceAccount.clusterRole }} -{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.restore.enable .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-restore-serviceaccount.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-restore-serviceaccount.yaml index c4b817cdc..ee5f4bd70 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-restore-serviceaccount.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-restore-serviceaccount.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if .Values.zookeeper.customTools.serviceAccount.create }} +{{- if and .Values.zookeeper.customTools.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-service-account.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-service-account.yaml index b1411929e..e30c05937 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-service-account.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-service-account.yaml @@ -2,7 +2,7 @@ # Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. # -{{- if and .Values.components.zookeeper .Values.zookeeper.serviceAccount.create }} +{{- if and .Values.components.zookeeper .Values.zookeeper.serviceAccount.create (include "pulsar.metadata.isZookeeper" .) }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-storageclass.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-storageclass.yaml index 41835d846..7812c1cfb 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-storageclass.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-storageclass.yaml @@ -3,7 +3,7 @@ # # deploy zookeeper only when `components.zookeeper` is true -{{- if .Values.components.zookeeper }} +{{- if and .Values.components.zookeeper (include "pulsar.metadata.isZookeeper" .) }} {{- if and .Values.volumes.persistence .Values.zookeeper.volumes.persistence }} # define the storage class for data directory diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index c5976a101..6266a1dc2 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -132,6 +132,10 @@ images: repository: "streamnative/pulsar-metadata-tool" tag: "3.3.3.3" pullPolicy: IfNotPresent + oxia: + repository: oxia/oxia + tag: "0.16.4" + pullPolicy: IfNotPresent bookie: repository: streamnative/sn-platform tag: "3.3.3.3" @@ -1189,6 +1193,8 @@ autorecovery: ## metadata deployed pulsar_metadata: component: pulsar-init + # metadata provider. Valid values: zookeeper, oxia + provider: zookeeper # set the cluster name. if empty or not specified, # it will use helm release name to generate a cluster name. clusterName: "" diff --git a/examples/sn-platform/values-oxia.yaml b/examples/sn-platform/values-oxia.yaml new file mode 100644 index 000000000..89528e2f9 --- /dev/null +++ b/examples/sn-platform/values-oxia.yaml @@ -0,0 +1,3 @@ +# Use an in-cluster Oxia metadata store instead of ZooKeeper. +pulsar_metadata: + provider: oxia From c346bc0cf69d58ee769a5e49399441d84e2d366e Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 26 May 2026 01:08:02 +0800 Subject: [PATCH 2/7] fix: repair oxia namespace template --- .../templates/oxia/oxia-namespace.yaml | 11 +++++------ charts/sn-platform/templates/oxia/oxia-namespace.yaml | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml b/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml index 904674141..8198cb115 100644 --- a/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml +++ b/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml @@ -3,12 +3,11 @@ # # deploy oxia namespaces only when `pulsar_metadata.provider` is oxia {{- if include "pulsar.metadata.isOxia" . }} -{{- $namespaces := list - (dict "name" (include "pulsar.oxia.broker.namespace" .) "type" "broker") - (dict "name" (include "pulsar.oxia.bookkeeper.namespace" .) "type" "bookkeeper") - (dict "name" (include "pulsar.oxia.schema.namespace" .) "type" "pulsar-schema") - (dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function") -}} +{{- $brokerNamespace := dict "name" (include "pulsar.oxia.broker.namespace" .) "type" "broker" }} +{{- $bookkeeperNamespace := dict "name" (include "pulsar.oxia.bookkeeper.namespace" .) "type" "bookkeeper" }} +{{- $schemaNamespace := dict "name" (include "pulsar.oxia.schema.namespace" .) "type" "pulsar-schema" }} +{{- $functionNamespace := dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function" }} +{{- $namespaces := list $brokerNamespace $bookkeeperNamespace $schemaNamespace $functionNamespace }} {{- range $index, $oxiaNamespace := $namespaces }} {{- if $index }} --- diff --git a/charts/sn-platform/templates/oxia/oxia-namespace.yaml b/charts/sn-platform/templates/oxia/oxia-namespace.yaml index 904674141..8198cb115 100644 --- a/charts/sn-platform/templates/oxia/oxia-namespace.yaml +++ b/charts/sn-platform/templates/oxia/oxia-namespace.yaml @@ -3,12 +3,11 @@ # # deploy oxia namespaces only when `pulsar_metadata.provider` is oxia {{- if include "pulsar.metadata.isOxia" . }} -{{- $namespaces := list - (dict "name" (include "pulsar.oxia.broker.namespace" .) "type" "broker") - (dict "name" (include "pulsar.oxia.bookkeeper.namespace" .) "type" "bookkeeper") - (dict "name" (include "pulsar.oxia.schema.namespace" .) "type" "pulsar-schema") - (dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function") -}} +{{- $brokerNamespace := dict "name" (include "pulsar.oxia.broker.namespace" .) "type" "broker" }} +{{- $bookkeeperNamespace := dict "name" (include "pulsar.oxia.bookkeeper.namespace" .) "type" "bookkeeper" }} +{{- $schemaNamespace := dict "name" (include "pulsar.oxia.schema.namespace" .) "type" "pulsar-schema" }} +{{- $functionNamespace := dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function" }} +{{- $namespaces := list $brokerNamespace $bookkeeperNamespace $schemaNamespace $functionNamespace }} {{- range $index, $oxiaNamespace := $namespaces }} {{- if $index }} --- From 74ac225fa833a145a0013e204de037678e9ca2a2 Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 26 May 2026 01:15:41 +0800 Subject: [PATCH 3/7] fix: align oxia istio dataplane mode --- charts/sn-platform/templates/oxia/oxia-cluster.yaml | 3 +++ charts/sn-platform/values.yaml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/charts/sn-platform/templates/oxia/oxia-cluster.yaml b/charts/sn-platform/templates/oxia/oxia-cluster.yaml index 0e2b6af07..b8e96fee9 100644 --- a/charts/sn-platform/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform/templates/oxia/oxia-cluster.yaml @@ -23,6 +23,9 @@ spec: {{- if .Values.istio.enabled }} istio: enabled: true + {{- if .Values.istio.dataplaneMode }} + dataplaneMode: {{ .Values.istio.dataplaneMode }} + {{- end }} {{- if .Values.istio.migration }} mtls: mode: permissive diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 6266a1dc2..dc40e8df1 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -2930,6 +2930,11 @@ istio: # mergeMetrics should be enabled if you want to scrape pulsar metrics from an external prometheus not running on Istio # prometheus and grafana will not be Istio injected if mergeMetrics is enabled mergeMetrics: false + # Istio data plane mode: "sidecar" or "ambient" + # - sidecar: Traditional per-pod sidecars (default if empty) + # - ambient: Sidecar-less data plane using ztunnel for L4 mTLS + # Leave empty for default behavior (sidecar mode) + dataplaneMode: "" gateway: # gateway selector if it's not `istio: ingressgateway` selector: {} From ed3e330bcdf22fd65711b463d02291e4716c64ec Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 26 May 2026 01:21:24 +0800 Subject: [PATCH 4/7] fix: keep oxia istio config scoped --- charts/sn-platform/templates/oxia/oxia-cluster.yaml | 3 --- charts/sn-platform/values.yaml | 5 ----- 2 files changed, 8 deletions(-) diff --git a/charts/sn-platform/templates/oxia/oxia-cluster.yaml b/charts/sn-platform/templates/oxia/oxia-cluster.yaml index b8e96fee9..0e2b6af07 100644 --- a/charts/sn-platform/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform/templates/oxia/oxia-cluster.yaml @@ -23,9 +23,6 @@ spec: {{- if .Values.istio.enabled }} istio: enabled: true - {{- if .Values.istio.dataplaneMode }} - dataplaneMode: {{ .Values.istio.dataplaneMode }} - {{- end }} {{- if .Values.istio.migration }} mtls: mode: permissive diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index dc40e8df1..6266a1dc2 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -2930,11 +2930,6 @@ istio: # mergeMetrics should be enabled if you want to scrape pulsar metrics from an external prometheus not running on Istio # prometheus and grafana will not be Istio injected if mergeMetrics is enabled mergeMetrics: false - # Istio data plane mode: "sidecar" or "ambient" - # - sidecar: Traditional per-pod sidecars (default if empty) - # - ambient: Sidecar-less data plane using ztunnel for L4 mTLS - # Leave empty for default behavior (sidecar mode) - dataplaneMode: "" gateway: # gateway selector if it's not `istio: ingressgateway` selector: {} From 7fd6057c3cf59ef0ab68c3703753e935fa9ab86e Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 26 May 2026 11:41:47 +0800 Subject: [PATCH 5/7] fix: add oxia component configuration --- .../sn-platform-slim/templates/_helpers.tpl | 3 +++ .../templates/oxia/oxia-cluster.yaml | 24 +++++++++++++++++-- charts/sn-platform-slim/values.yaml | 16 +++++++++++++ charts/sn-platform/templates/_helpers.tpl | 3 +++ .../templates/oxia/oxia-cluster.yaml | 24 +++++++++++++++++-- charts/sn-platform/values.yaml | 16 +++++++++++++ 6 files changed, 82 insertions(+), 4 deletions(-) diff --git a/charts/sn-platform-slim/templates/_helpers.tpl b/charts/sn-platform-slim/templates/_helpers.tpl index 75e09a71f..3480638af 100644 --- a/charts/sn-platform-slim/templates/_helpers.tpl +++ b/charts/sn-platform-slim/templates/_helpers.tpl @@ -277,6 +277,9 @@ false {{- if and (eq $provider "oxia") .Values.components.sql_worker -}} {{- fail "components.sql_worker is not supported with pulsar_metadata.provider=oxia" -}} {{- end -}} +{{- if and (eq $provider "oxia") (lt (int .Values.oxia.replicaCount) 3) -}} +{{- fail "oxia.replicaCount must be at least 3 when pulsar_metadata.provider=oxia" -}} +{{- end -}} {{- end -}} {{/* diff --git a/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml index b8e96fee9..2d24004e9 100644 --- a/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml @@ -8,9 +8,16 @@ kind: OxiaCluster metadata: name: "{{ template "pulsar.oxia.cluster" . }}" namespace: {{ template "pulsar.namespace" . }} +{{- with .Values.oxia.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} labels: {{- include "pulsar.standardLabels" . | nindent 4 }} - component: oxia + component: {{ .Values.oxia.component }} +{{- with .Values.oxia.labels }} +{{ toYaml . | indent 4 }} +{{- end }} {{- if .Values.components.pulsar_coordinator }} k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" {{- end }} @@ -18,8 +25,21 @@ spec: image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag }}" imagePullPolicy: {{ .Values.images.oxia.pullPolicy }} monitoringEnabled: {{ include "pulsar.oxia.podMonitor.enabled" . }} + {{- with .Values.oxia.labels }} + labels: +{{ toYaml . | indent 4 }} + {{- end }} + {{- with .Values.oxia.coordinator.resources }} + coordinator: + resources: +{{ toYaml . | indent 6 }} + {{- end }} server: - replicas: 3 + replicas: {{ .Values.oxia.replicaCount }} + {{- with .Values.oxia.resources }} + resources: +{{ toYaml . | indent 6 }} + {{- end }} {{- if .Values.istio.enabled }} istio: enabled: true diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index d97727e27..f05fca084 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -1134,6 +1134,22 @@ pulsar_metadata: # # configurationStoreServers: "zk04:2181,zk05:2181,zk06:2181" +## Oxia metadata store. +## Used only when pulsar_metadata.provider is oxia. +oxia: + component: oxia + # The number of Oxia server replicas to run. Must be at least 3 for Oxia metadata deployments. + replicaCount: 3 + # Labels added to the OxiaCluster CR and propagated to generated Oxia resources. + labels: {} + # Annotations added to the OxiaCluster CR. + annotations: {} + # Resources requests/limits for Oxia server containers. + resources: {} + coordinator: + # Resources requests/limits for Oxia coordinator containers. + resources: {} + ## deprecated: move to broker.kop # kop: # ports: diff --git a/charts/sn-platform/templates/_helpers.tpl b/charts/sn-platform/templates/_helpers.tpl index 3f9a27fc3..0962a8abe 100644 --- a/charts/sn-platform/templates/_helpers.tpl +++ b/charts/sn-platform/templates/_helpers.tpl @@ -275,6 +275,9 @@ false {{- if and (eq $provider "oxia") .Values.components.sql_worker -}} {{- fail "components.sql_worker is not supported with pulsar_metadata.provider=oxia" -}} {{- end -}} +{{- if and (eq $provider "oxia") (lt (int .Values.oxia.replicaCount) 3) -}} +{{- fail "oxia.replicaCount must be at least 3 when pulsar_metadata.provider=oxia" -}} +{{- end -}} {{- end -}} {{/* diff --git a/charts/sn-platform/templates/oxia/oxia-cluster.yaml b/charts/sn-platform/templates/oxia/oxia-cluster.yaml index 0e2b6af07..1036f83e9 100644 --- a/charts/sn-platform/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform/templates/oxia/oxia-cluster.yaml @@ -8,9 +8,16 @@ kind: OxiaCluster metadata: name: "{{ template "pulsar.oxia.cluster" . }}" namespace: {{ template "pulsar.namespace" . }} +{{- with .Values.oxia.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} labels: {{- include "pulsar.standardLabels" . | nindent 4 }} - component: oxia + component: {{ .Values.oxia.component }} +{{- with .Values.oxia.labels }} +{{ toYaml . | indent 4 }} +{{- end }} {{- if .Values.components.pulsar_coordinator }} k8s.streamnative.io/coordinator-name: "{{ template "pulsar.fullname" . }}-coordinator" {{- end }} @@ -18,8 +25,21 @@ spec: image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag }}" imagePullPolicy: {{ .Values.images.oxia.pullPolicy }} monitoringEnabled: {{ include "pulsar.oxia.podMonitor.enabled" . }} + {{- with .Values.oxia.labels }} + labels: +{{ toYaml . | indent 4 }} + {{- end }} + {{- with .Values.oxia.coordinator.resources }} + coordinator: + resources: +{{ toYaml . | indent 6 }} + {{- end }} server: - replicas: 3 + replicas: {{ .Values.oxia.replicaCount }} + {{- with .Values.oxia.resources }} + resources: +{{ toYaml . | indent 6 }} + {{- end }} {{- if .Values.istio.enabled }} istio: enabled: true diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 6266a1dc2..b08ee4bca 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -1209,6 +1209,22 @@ pulsar_metadata: # # configurationStoreServers: "zk04:2181,zk05:2181,zk06:2181" +## Oxia metadata store. +## Used only when pulsar_metadata.provider is oxia. +oxia: + component: oxia + # The number of Oxia server replicas to run. Must be at least 3 for Oxia metadata deployments. + replicaCount: 3 + # Labels added to the OxiaCluster CR and propagated to generated Oxia resources. + labels: {} + # Annotations added to the OxiaCluster CR. + annotations: {} + # Resources requests/limits for Oxia server containers. + resources: {} + coordinator: + # Resources requests/limits for Oxia coordinator containers. + resources: {} + ## deprecated: move to broker.kop # kop: # ports: From 00ad6a461fcbe7bf2b87f231b568cc2398bb1e79 Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 26 May 2026 12:01:28 +0800 Subject: [PATCH 6/7] fix: remove oxia component value --- charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml | 2 +- charts/sn-platform-slim/values.yaml | 1 - charts/sn-platform/templates/oxia/oxia-cluster.yaml | 2 +- charts/sn-platform/values.yaml | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml index 2d24004e9..f8f911e07 100644 --- a/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml @@ -14,7 +14,7 @@ metadata: {{- end }} labels: {{- include "pulsar.standardLabels" . | nindent 4 }} - component: {{ .Values.oxia.component }} + component: oxia {{- with .Values.oxia.labels }} {{ toYaml . | indent 4 }} {{- end }} diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index f05fca084..728622c38 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -1137,7 +1137,6 @@ pulsar_metadata: ## Oxia metadata store. ## Used only when pulsar_metadata.provider is oxia. oxia: - component: oxia # The number of Oxia server replicas to run. Must be at least 3 for Oxia metadata deployments. replicaCount: 3 # Labels added to the OxiaCluster CR and propagated to generated Oxia resources. diff --git a/charts/sn-platform/templates/oxia/oxia-cluster.yaml b/charts/sn-platform/templates/oxia/oxia-cluster.yaml index 1036f83e9..52ef4078c 100644 --- a/charts/sn-platform/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform/templates/oxia/oxia-cluster.yaml @@ -14,7 +14,7 @@ metadata: {{- end }} labels: {{- include "pulsar.standardLabels" . | nindent 4 }} - component: {{ .Values.oxia.component }} + component: oxia {{- with .Values.oxia.labels }} {{ toYaml . | indent 4 }} {{- end }} diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index b08ee4bca..727f554e6 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -1212,7 +1212,6 @@ pulsar_metadata: ## Oxia metadata store. ## Used only when pulsar_metadata.provider is oxia. oxia: - component: oxia # The number of Oxia server replicas to run. Must be at least 3 for Oxia metadata deployments. replicaCount: 3 # Labels added to the OxiaCluster CR and propagated to generated Oxia resources. From c6d2ef19cd2d1b867c878501a8ac4bc23efcb8ed Mon Sep 17 00:00:00 2001 From: mattisonchao Date: Tue, 26 May 2026 12:03:02 +0800 Subject: [PATCH 7/7] fix: document optional oxia values as examples --- .../templates/oxia/oxia-cluster.yaml | 4 +++- charts/sn-platform-slim/values.yaml | 22 +++++++++++-------- .../templates/oxia/oxia-cluster.yaml | 4 +++- charts/sn-platform/values.yaml | 22 +++++++++++-------- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml index f8f911e07..f9978f374 100644 --- a/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform-slim/templates/oxia/oxia-cluster.yaml @@ -29,10 +29,12 @@ spec: labels: {{ toYaml . | indent 4 }} {{- end }} - {{- with .Values.oxia.coordinator.resources }} + {{- with .Values.oxia.coordinator }} + {{- with .resources }} coordinator: resources: {{ toYaml . | indent 6 }} + {{- end }} {{- end }} server: replicas: {{ .Values.oxia.replicaCount }} diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index 728622c38..8fe5a667a 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -1139,15 +1139,19 @@ pulsar_metadata: oxia: # The number of Oxia server replicas to run. Must be at least 3 for Oxia metadata deployments. replicaCount: 3 - # Labels added to the OxiaCluster CR and propagated to generated Oxia resources. - labels: {} - # Annotations added to the OxiaCluster CR. - annotations: {} - # Resources requests/limits for Oxia server containers. - resources: {} - coordinator: - # Resources requests/limits for Oxia coordinator containers. - resources: {} + # labels: + # example: value + # annotations: + # example: value + # resources: + # requests: + # cpu: "0.5" + # memory: "1Gi" + # coordinator: + # resources: + # requests: + # cpu: "0.25" + # memory: "512Mi" ## deprecated: move to broker.kop # kop: diff --git a/charts/sn-platform/templates/oxia/oxia-cluster.yaml b/charts/sn-platform/templates/oxia/oxia-cluster.yaml index 52ef4078c..26ebaf784 100644 --- a/charts/sn-platform/templates/oxia/oxia-cluster.yaml +++ b/charts/sn-platform/templates/oxia/oxia-cluster.yaml @@ -29,10 +29,12 @@ spec: labels: {{ toYaml . | indent 4 }} {{- end }} - {{- with .Values.oxia.coordinator.resources }} + {{- with .Values.oxia.coordinator }} + {{- with .resources }} coordinator: resources: {{ toYaml . | indent 6 }} + {{- end }} {{- end }} server: replicas: {{ .Values.oxia.replicaCount }} diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 727f554e6..52d8f98a4 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -1214,15 +1214,19 @@ pulsar_metadata: oxia: # The number of Oxia server replicas to run. Must be at least 3 for Oxia metadata deployments. replicaCount: 3 - # Labels added to the OxiaCluster CR and propagated to generated Oxia resources. - labels: {} - # Annotations added to the OxiaCluster CR. - annotations: {} - # Resources requests/limits for Oxia server containers. - resources: {} - coordinator: - # Resources requests/limits for Oxia coordinator containers. - resources: {} + # labels: + # example: value + # annotations: + # example: value + # resources: + # requests: + # cpu: "0.5" + # memory: "1Gi" + # coordinator: + # resources: + # requests: + # cpu: "0.25" + # memory: "512Mi" ## deprecated: move to broker.kop # kop: