diff --git a/charts/sn-platform-slim/templates/_helpers.tpl b/charts/sn-platform-slim/templates/_helpers.tpl index 3f37d3a3b..a26c81bc6 100644 --- a/charts/sn-platform-slim/templates/_helpers.tpl +++ b/charts/sn-platform-slim/templates/_helpers.tpl @@ -228,6 +228,10 @@ bookkeeper pulsar-schema {{- end -}} +{{- define "pulsar.oxia.kafkaSchema.namespace" -}} +kafka-schema +{{- end -}} + {{- define "pulsar.oxia.function.namespace" -}} function {{- end -}} @@ -244,6 +248,10 @@ oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.b oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.schema.namespace" . }} {{- end -}} +{{- define "pulsar.oxia.kafkaSchema.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.kafkaSchema.namespace" . }} +{{- end -}} + {{- define "pulsar.oxia.metadata.url" -}} {{- template "pulsar.oxia.broker.url" . -}} {{- end -}} diff --git a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml index f7a545f52..6af3cbc58 100644 --- a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml @@ -232,12 +232,6 @@ 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 @@ -333,6 +327,9 @@ spec: {{- end }} {{- end }} + {{- end }} + {{- if include "pulsar.metadata.isOxia" . }} + useStorageCatalog: true {{- end }} custom: PULSAR_PREFIX_additionalServletDirectory: "./brokerAdditionalServlet" @@ -340,6 +337,16 @@ spec: PULSAR_PREFIX_metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" PULSAR_PREFIX_configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" PULSAR_PREFIX_enablePackagesManagement: "false" + PULSAR_PREFIX_kafkaGroupOffsetsStoreInMetadata: "true" + PULSAR_PREFIX_kafkaProducerStateStoreInMetadata: "true" + PULSAR_PREFIX_kafkaSchemaRegistryStoreInOxia: "true" + {{- $oxia := default dict .Values.oxia }} + {{- $storageCatalog := default dict $oxia.storageCatalog }} + PULSAR_PREFIX_oxiaSchemaStorageUrl: {{ default (include "pulsar.oxia.schema.url" .) $storageCatalog.schemaStorageUrl | quote }} + PULSAR_PREFIX_oxiaSchemaRegistryUrl: "{{ template "pulsar.oxia.kafkaSchema.url" . }}" + PULSAR_PREFIX_schemaRegistryUrl: {{ default (include "pulsar.oxia.kafkaSchema.url" .) $storageCatalog.schemaRegistryUrl | quote }} + PULSAR_PREFIX_schemaRegistryStorageClassName: {{ default "io.streamnative.pulsar.schema.OxiaSchemaStorageFactory" $storageCatalog.schemaRegistryStorageClassName | quote }} + PULSAR_PREFIX_topicPoliciesServiceClassName: "io.streamnative.pulsar.OxiaTopicPoliciesService" {{- end }} {{- with .Values.broker.configData }} {{ toYaml . | indent 6 }} diff --git a/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml b/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml index 8198cb115..6dd3984e5 100644 --- a/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml +++ b/charts/sn-platform-slim/templates/oxia/oxia-namespace.yaml @@ -6,8 +6,9 @@ {{- $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" }} +{{- $kafkaSchemaNamespace := dict "name" (include "pulsar.oxia.kafkaSchema.namespace" .) "type" "kafka-schema" }} {{- $functionNamespace := dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function" }} -{{- $namespaces := list $brokerNamespace $bookkeeperNamespace $schemaNamespace $functionNamespace }} +{{- $namespaces := list $brokerNamespace $bookkeeperNamespace $schemaNamespace $kafkaSchemaNamespace $functionNamespace }} {{- range $index, $oxiaNamespace := $namespaces }} {{- if $index }} --- diff --git a/charts/sn-platform-slim/templates/oxia/storage-catalog.yaml b/charts/sn-platform-slim/templates/oxia/storage-catalog.yaml new file mode 100644 index 000000000..5924ba01a --- /dev/null +++ b/charts/sn-platform-slim/templates/oxia/storage-catalog.yaml @@ -0,0 +1,39 @@ +# +# Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. +# +# deploy StorageCatalog only when `pulsar_metadata.provider` is oxia +{{- if and .Values.components.broker (include "pulsar.metadata.isOxia" .) }} +{{- $oxia := default dict .Values.oxia }} +{{- $storageCatalog := default dict $oxia.storageCatalog }} +apiVersion: k8s.streamnative.io/v1alpha1 +kind: StorageCatalog +metadata: + name: "{{ template "pulsar.fullname" . }}" + namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: broker +spec: + oxiaMetadataServiceUrl: {{ default (include "pulsar.oxia.metadata.url" .) $storageCatalog.oxiaMetadataServiceUrl | quote }} + schemaStorageUrl: {{ default (include "pulsar.oxia.schema.url" .) $storageCatalog.schemaStorageUrl | quote }} + schemaRegistryUrl: {{ default (include "pulsar.oxia.kafkaSchema.url" .) $storageCatalog.schemaRegistryUrl | quote }} + schemaRegistryStorageClassName: {{ default "io.streamnative.pulsar.schema.OxiaSchemaStorageFactory" $storageCatalog.schemaRegistryStorageClassName | quote }} + {{- with $storageCatalog.storageUrl }} + storageUrl: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.backendStorageType }} + backendStorageType: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.bucket }} + bucket: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.prefix }} + prefix: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.region }} + region: {{ . | quote }} + {{- end }} + {{- if hasKey $storageCatalog "useOwnStorage" }} + useOwnStorage: {{ $storageCatalog.useOwnStorage }} + {{- end }} +{{- end }} diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index ebc3f8d35..be3f89fbb 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -1159,7 +1159,6 @@ pulsar_metadata: # limits: # cpu: "1" # memory: "1Gi" - ## deprecated: move to broker.kop # kop: # ports: diff --git a/charts/sn-platform/templates/_helpers.tpl b/charts/sn-platform/templates/_helpers.tpl index fff8bba66..3681d51c4 100644 --- a/charts/sn-platform/templates/_helpers.tpl +++ b/charts/sn-platform/templates/_helpers.tpl @@ -226,6 +226,10 @@ bookkeeper pulsar-schema {{- end -}} +{{- define "pulsar.oxia.kafkaSchema.namespace" -}} +kafka-schema +{{- end -}} + {{- define "pulsar.oxia.function.namespace" -}} function {{- end -}} @@ -242,6 +246,10 @@ oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.b oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.schema.namespace" . }} {{- end -}} +{{- define "pulsar.oxia.kafkaSchema.url" -}} +oxia://{{ template "pulsar.oxia.service.address" . }}/{{ template "pulsar.oxia.kafkaSchema.namespace" . }} +{{- end -}} + {{- define "pulsar.oxia.metadata.url" -}} {{- template "pulsar.oxia.broker.url" . -}} {{- end -}} diff --git a/charts/sn-platform/templates/broker/broker-cluster.yaml b/charts/sn-platform/templates/broker/broker-cluster.yaml index 6f2cccc8f..cb7d6fdce 100644 --- a/charts/sn-platform/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform/templates/broker/broker-cluster.yaml @@ -233,12 +233,6 @@ 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 @@ -334,6 +328,9 @@ spec: {{- end }} {{- end }} + {{- end }} + {{- if include "pulsar.metadata.isOxia" . }} + useStorageCatalog: true {{- end }} custom: PULSAR_PREFIX_additionalServletDirectory: "./brokerAdditionalServlet" @@ -341,6 +338,16 @@ spec: PULSAR_PREFIX_metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" PULSAR_PREFIX_configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url" . }}" PULSAR_PREFIX_enablePackagesManagement: "false" + PULSAR_PREFIX_kafkaGroupOffsetsStoreInMetadata: "true" + PULSAR_PREFIX_kafkaProducerStateStoreInMetadata: "true" + PULSAR_PREFIX_kafkaSchemaRegistryStoreInOxia: "true" + {{- $oxia := default dict .Values.oxia }} + {{- $storageCatalog := default dict $oxia.storageCatalog }} + PULSAR_PREFIX_oxiaSchemaStorageUrl: {{ default (include "pulsar.oxia.schema.url" .) $storageCatalog.schemaStorageUrl | quote }} + PULSAR_PREFIX_oxiaSchemaRegistryUrl: "{{ template "pulsar.oxia.kafkaSchema.url" . }}" + PULSAR_PREFIX_schemaRegistryUrl: {{ default (include "pulsar.oxia.kafkaSchema.url" .) $storageCatalog.schemaRegistryUrl | quote }} + PULSAR_PREFIX_schemaRegistryStorageClassName: {{ default "io.streamnative.pulsar.schema.OxiaSchemaStorageFactory" $storageCatalog.schemaRegistryStorageClassName | quote }} + PULSAR_PREFIX_topicPoliciesServiceClassName: "io.streamnative.pulsar.OxiaTopicPoliciesService" {{- end }} {{- with .Values.broker.configData }} {{ toYaml . | indent 6 }} diff --git a/charts/sn-platform/templates/oxia/oxia-namespace.yaml b/charts/sn-platform/templates/oxia/oxia-namespace.yaml index 8198cb115..6dd3984e5 100644 --- a/charts/sn-platform/templates/oxia/oxia-namespace.yaml +++ b/charts/sn-platform/templates/oxia/oxia-namespace.yaml @@ -6,8 +6,9 @@ {{- $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" }} +{{- $kafkaSchemaNamespace := dict "name" (include "pulsar.oxia.kafkaSchema.namespace" .) "type" "kafka-schema" }} {{- $functionNamespace := dict "name" (include "pulsar.oxia.function.namespace" .) "type" "function" }} -{{- $namespaces := list $brokerNamespace $bookkeeperNamespace $schemaNamespace $functionNamespace }} +{{- $namespaces := list $brokerNamespace $bookkeeperNamespace $schemaNamespace $kafkaSchemaNamespace $functionNamespace }} {{- range $index, $oxiaNamespace := $namespaces }} {{- if $index }} --- diff --git a/charts/sn-platform/templates/oxia/storage-catalog.yaml b/charts/sn-platform/templates/oxia/storage-catalog.yaml new file mode 100644 index 000000000..5924ba01a --- /dev/null +++ b/charts/sn-platform/templates/oxia/storage-catalog.yaml @@ -0,0 +1,39 @@ +# +# Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved. +# +# deploy StorageCatalog only when `pulsar_metadata.provider` is oxia +{{- if and .Values.components.broker (include "pulsar.metadata.isOxia" .) }} +{{- $oxia := default dict .Values.oxia }} +{{- $storageCatalog := default dict $oxia.storageCatalog }} +apiVersion: k8s.streamnative.io/v1alpha1 +kind: StorageCatalog +metadata: + name: "{{ template "pulsar.fullname" . }}" + namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: broker +spec: + oxiaMetadataServiceUrl: {{ default (include "pulsar.oxia.metadata.url" .) $storageCatalog.oxiaMetadataServiceUrl | quote }} + schemaStorageUrl: {{ default (include "pulsar.oxia.schema.url" .) $storageCatalog.schemaStorageUrl | quote }} + schemaRegistryUrl: {{ default (include "pulsar.oxia.kafkaSchema.url" .) $storageCatalog.schemaRegistryUrl | quote }} + schemaRegistryStorageClassName: {{ default "io.streamnative.pulsar.schema.OxiaSchemaStorageFactory" $storageCatalog.schemaRegistryStorageClassName | quote }} + {{- with $storageCatalog.storageUrl }} + storageUrl: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.backendStorageType }} + backendStorageType: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.bucket }} + bucket: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.prefix }} + prefix: {{ . | quote }} + {{- end }} + {{- with $storageCatalog.region }} + region: {{ . | quote }} + {{- end }} + {{- if hasKey $storageCatalog "useOwnStorage" }} + useOwnStorage: {{ $storageCatalog.useOwnStorage }} + {{- end }} +{{- end }} diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 4d275aed3..9b1f942e1 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -1234,7 +1234,6 @@ pulsar_metadata: # limits: # cpu: "1" # memory: "1Gi" - ## deprecated: move to broker.kop # kop: # ports: