From 4de4f7ea4e6400f2edac8f148e0e9178fc22b475 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Wed, 6 Nov 2024 09:40:30 -0600 Subject: [PATCH 01/67] change oxia templates --- charts/pulsar/templates/_helpers.tpl | 2 +- charts/pulsar/templates/_oxia.tpl | 82 +++++++++++++++++++ .../templates/oxia-coordinator-configmap.yaml | 32 ++++++++ .../oxia-coordinator-deployment.yaml | 66 +++++++++++++++ .../templates/oxia-coordinator-role.yaml | 27 ++++++ .../oxia-coordinator-rolebinding.yaml | 28 +++++++ .../templates/oxia-coordinator-service.yaml | 30 +++++++ .../oxia-coordinator-serviceaccount.yaml | 24 ++++++ .../oxia-coordinator-servicemonitor.yaml | 30 +++++++ .../templates/oxia-server-service-public.yaml | 30 +++++++ .../pulsar/templates/oxia-server-service.yaml | 32 ++++++++ .../templates/oxia-server-serviceaccount.yaml | 24 ++++++ .../templates/oxia-server-servicemonitor.yaml | 30 +++++++ .../templates/oxia-server-statefulset.yaml | 81 ++++++++++++++++++ charts/pulsar/values.yaml | 31 +++++++ 15 files changed, 548 insertions(+), 1 deletion(-) create mode 100644 charts/pulsar/templates/_oxia.tpl create mode 100644 charts/pulsar/templates/oxia-coordinator-configmap.yaml create mode 100644 charts/pulsar/templates/oxia-coordinator-deployment.yaml create mode 100644 charts/pulsar/templates/oxia-coordinator-role.yaml create mode 100644 charts/pulsar/templates/oxia-coordinator-rolebinding.yaml create mode 100644 charts/pulsar/templates/oxia-coordinator-service.yaml create mode 100644 charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml create mode 100644 charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml create mode 100644 charts/pulsar/templates/oxia-server-service-public.yaml create mode 100644 charts/pulsar/templates/oxia-server-service.yaml create mode 100644 charts/pulsar/templates/oxia-server-serviceaccount.yaml create mode 100644 charts/pulsar/templates/oxia-server-servicemonitor.yaml create mode 100644 charts/pulsar/templates/oxia-server-statefulset.yaml diff --git a/charts/pulsar/templates/_helpers.tpl b/charts/pulsar/templates/_helpers.tpl index 62eb0466..5d38c4dd 100644 --- a/charts/pulsar/templates/_helpers.tpl +++ b/charts/pulsar/templates/_helpers.tpl @@ -134,4 +134,4 @@ Lookup pull policy, default to defaultPullPolicy */}} {{- define "pulsar.imagePullPolicy" -}} {{- printf "%s" (.image.pullPolicy | default .root.Values.defaultPullPolicy) -}} -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl new file mode 100644 index 00000000..8b1d8750 --- /dev/null +++ b/charts/pulsar/templates/_oxia.tpl @@ -0,0 +1,82 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{{/* +Coordinator labels +*/}} +{{- define "oxia-cluster.coordinator.labels" -}} +{{ include "oxia-cluster.coordinator.selectorLabels" . }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +app.kubernetes.io/part-of: oxia +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Coordinator selector labels +*/}} +{{- define "oxia-cluster.coordinator.selectorLabels" -}} +app.kubernetes.io/name: {{ .Chart.Name }} +app.kubernetes.io/component: coordinator +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Server labels +*/}} +{{- define "oxia-cluster.server.labels" -}} +{{ include "oxia-cluster.server.selectorLabels" . }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Server selector labels +*/}} +{{- define "oxia-cluster.server.selectorLabels" -}} +app.kubernetes.io/name: {{ .Chart.Name }} +app.kubernetes.io/component: server +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Probe +*/}} +{{- define "oxia-cluster.probe" -}} +exec: + command: ["oxia", "health", "--port={{ . }}"] +initialDelaySeconds: 10 +timeoutSeconds: 10 +{{- end }} + + +{{/* +Probe +*/}} +{{- define "oxia-cluster.readiness-probe" -}} +exec: + command: ["oxia", "health", "--port={{ . }}", "--service=oxia-readiness"] +initialDelaySeconds: 10 +timeoutSeconds: 10 +{{- end }} + +{{/* +Probe +*/}} +{{- define "oxia-cluster.startup-probe" -}} +exec: + command: ["oxia", "health", "--port={{ . }}"] +initialDelaySeconds: 60 +timeoutSeconds: 10 +{{- end }} + diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml new file mode 100644 index 00000000..1981821b --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-configmap.yaml @@ -0,0 +1,32 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} + name: {{ .Release.Name }}-coordinator +data: + config.yaml: | + namespaces: + - name: default + initialShardCount: {{ .Values.oxia.initialShardCount }} + replicationFactor: {{ .Values.oxia.replicationFactor }} + servers: + {{- $vars := dict "name" .Release.Name "namespace" .Release.Namespace "public" .Values.oxia.server.ports.public "internal" .Values.oxia.server.ports.internal }} + {{- range until (int .Values.oxia.server.replicas) }} + - public: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc.{{ $vars.namespace }}.svc.cluster.local:{{ $vars.public }} + internal: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc:{{ $vars.internal }} + {{- end }} diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml new file mode 100644 index 00000000..7d457f65 --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -0,0 +1,66 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} + name: {{ .Release.Name }}-coordinator +spec: + replicas: 1 + selector: + matchLabels: + {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 6 }} + strategy: + type: Recreate + template: + metadata: + annotations: + prometheus.io/port: "{{ .Values.oxia.coordinator.ports.metrics }}" + prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}" + labels: + oxia_cluster: {{ .Release.Name }} + {{- include "oxia-cluster.coordinator.labels" . | nindent 8 }} + name: {{ .Release.Name }}-coordinator + spec: + serviceAccountName: {{ .Release.Name }}-coordinator + containers: + - command: + - "oxia" + - "coordinator" + - "--conf=configmap:{{ .Release.Namespace }}/{{ .Release.Name }}-coordinator" + - "--log-json" + - "--metadata=configmap" + - "--k8s-namespace={{ .Release.Namespace }}" + - "--k8s-configmap-name={{ .Release.Name }}-status" + {{- if .Values.oxia.pprofEnabled }} + - "--profile" + {{- end}} + image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.images.oxia.pullPolicy }} + name: coordinator + ports: + {{- range $key, $value := .Values.oxia.coordinator.ports }} + - containerPort: {{ $value | int }} + name: {{ $key }} + {{- end}} + resources: + limits: + cpu: {{ .Values.oxia.coordinator.cpu }} + memory: {{ .Values.oxia.coordinator.memory }} + livenessProbe: + {{- include "oxia-cluster.probe" .Values.oxia.coordinator.ports.internal | nindent 12 }} + readinessProbe: + {{- include "oxia-cluster.probe" .Values.oxia.coordinator.ports.internal | nindent 12 }} diff --git a/charts/pulsar/templates/oxia-coordinator-role.yaml b/charts/pulsar/templates/oxia-coordinator-role.yaml new file mode 100644 index 00000000..5cb372b7 --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-role.yaml @@ -0,0 +1,27 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} + name: {{ .Release.Name }}-coordinator +rules: + - apiGroups: [ "" ] + resources: [ "configmaps" ] + verbs: [ "*" ] + - apiGroups: [ "oxia.streamnative.io" ] + resources: [ "oxiaclusters" ] + verbs: [ "get", "update" ] diff --git a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml new file mode 100644 index 00000000..137c0817 --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml @@ -0,0 +1,28 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} + name: {{ .Release.Name }}-coordinator +subjects: + - kind: ServiceAccount + name: {{ .Release.Name }}-coordinator + namespace: {{ .Release.Namespace }} +roleRef: + apiGroup: "" + kind: Role + name: {{ .Release.Name }}-coordinator diff --git a/charts/pulsar/templates/oxia-coordinator-service.yaml b/charts/pulsar/templates/oxia-coordinator-service.yaml new file mode 100644 index 00000000..aacbd72c --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-service.yaml @@ -0,0 +1,30 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Service +metadata: + labels: + oxia_cluster: {{ .Release.Name }} + {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} + name: {{ .Release.Name }}-coordinator +spec: + ports: + {{- range $key, $value := .Values.oxia.coordinator.ports }} + - name: {{ $key }} + port: {{ $value }} + targetPort: {{ $key }} + {{- end}} + selector: + {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 4 }} diff --git a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml new file mode 100644 index 00000000..98920be2 --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} + name: {{ .Release.Name }}-coordinator +{{- if .Values.images.imagePullSecrets }} +imagePullSecrets: + - name: {{ .Values.images.imagePullSecrets.secretName }} +{{- end}} diff --git a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml new file mode 100644 index 00000000..4d8d36b9 --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml @@ -0,0 +1,30 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{{- if .Values.monitoringEnabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} + name: {{ .Release.Name }}-coordinator +spec: + endpoints: + - port: metrics + selector: + matchLabels: + {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 6 }} + targetLabels: + - oxia_cluster +{{- end }} diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml new file mode 100644 index 00000000..fb18260f --- /dev/null +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -0,0 +1,30 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Service +metadata: + labels: + oxia_cluster: {{ .Release.Name }} + {{- include "oxia-cluster.server.labels" . | nindent 4 }} + name: {{ .Release.Name }} +spec: + ports: + {{- range $key, $value := .Values.oxia.server.ports }} + - name: {{ $key }} + port: {{ $value }} + targetPort: {{ $key }} + {{- end}} + selector: + {{- include "oxia-cluster.server.selectorLabels" . | nindent 4 }} diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml new file mode 100644 index 00000000..0f406c19 --- /dev/null +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -0,0 +1,32 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Service +metadata: + labels: + oxia_cluster: {{ .Release.Name }} + {{- include "oxia-cluster.server.labels" . | nindent 4 }} + name: {{ .Release.Name }}-svc +spec: + clusterIP: None + publishNotReadyAddresses: true + ports: + {{- range $key, $value := .Values.oxia.server.ports }} + - name: {{ $key }} + port: {{ $value }} + targetPort: {{ $key }} + {{- end}} + selector: + {{- include "oxia-cluster.server.selectorLabels" . | nindent 4 }} diff --git a/charts/pulsar/templates/oxia-server-serviceaccount.yaml b/charts/pulsar/templates/oxia-server-serviceaccount.yaml new file mode 100644 index 00000000..ae27b255 --- /dev/null +++ b/charts/pulsar/templates/oxia-server-serviceaccount.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + {{- include "oxia-cluster.server.labels" . | nindent 4 }} + name: {{ .Release.Name }} +{{- if .Values.images.imagePullSecrets }} +imagePullSecrets: + - name: {{ .Values.images.imagePullSecrets.secretName }} +{{- end}} diff --git a/charts/pulsar/templates/oxia-server-servicemonitor.yaml b/charts/pulsar/templates/oxia-server-servicemonitor.yaml new file mode 100644 index 00000000..4d7f15bd --- /dev/null +++ b/charts/pulsar/templates/oxia-server-servicemonitor.yaml @@ -0,0 +1,30 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +{{- if .Values.monitoringEnabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + {{- include "oxia-cluster.server.labels" . | nindent 4 }} + name: {{ .Release.Name }} +spec: + endpoints: + - port: metrics + selector: + matchLabels: + {{- include "oxia-cluster.server.selectorLabels" . | nindent 6 }} + targetLabels: + - oxia_cluster +{{- end }} diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml new file mode 100644 index 00000000..70af1811 --- /dev/null +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -0,0 +1,81 @@ +# Copyright 2023 StreamNative, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + {{- include "oxia-cluster.server.labels" . | nindent 4 }} + name: {{ .Release.Name }} +spec: + replicas: {{ .Values.oxia.server.replicas }} + selector: + matchLabels: + {{- include "oxia-cluster.server.selectorLabels" . | nindent 6 }} + serviceName: {{ .Release.Name }}-svc + podManagementPolicy: Parallel + template: + metadata: + annotations: + prometheus.io/port: "{{ .Values.oxia.server.ports.metrics }}" + prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}" + labels: + oxia_cluster: {{ .Release.Name }} + {{- include "oxia-cluster.server.labels" . | nindent 8 }} + name: {{ .Release.Name }} + spec: + serviceAccountName: {{ .Release.Name }} + containers: + - command: + - "oxia" + - "server" + - "--log-json" + - "--data-dir=/data/db" + - "--wal-dir=/data/wal" + - "--db-cache-size-mb=512" + {{- if .Values.oxia.pprofEnabled }} + - "--profile" + {{- end}} + image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.images.oxia.pullPolicy }} + name: server + ports: + {{- range $key, $value := .Values.oxia.server.ports }} + - containerPort: {{ $value | int }} + name: {{ $key }} + {{- end}} + resources: + limits: + cpu: {{ .Values.oxia.server.cpu }} + memory: {{ .Values.oxia.server.memory }} + volumeMounts: + - name: data + mountPath: /data + livenessProbe: + {{- include "oxia-cluster.probe" .Values.oxia.server.ports.internal | nindent 12 }} + readinessProbe: + {{- include "oxia-cluster.readiness-probe" .Values.oxia.server.ports.internal | nindent 12 }} + startupProbe: + {{- include "oxia-cluster.startup-probe" .Values.oxia.server.ports.internal | nindent 12 }} + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: [ "ReadWriteOnce" ] + {{- if .Values.oxia.server.storageClassName }} + storageClassName: {{ .Values.oxia.server.storageClassName }} + {{- end}} + resources: + requests: + storage: {{ .Values.oxia.server.storage }} diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index ffd08672..f6ff0b4e 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -113,6 +113,8 @@ affinity: components: # zookeeper zookeeper: true + # oxia + oxia: true # bookkeeper bookkeeper: true # bookkeeper - autorecovery @@ -202,6 +204,10 @@ images: # uses defaultPullPolicy when unspecified pullPolicy: hasCommand: false + oxia: + repository: streamnative/oxia + tag: main + pullPolicy: Always ## TLS ## templates/tls-certs.yaml @@ -467,6 +473,31 @@ zookeeper: usePolicy: true maxUnavailable: 1 +## Pulsar: Oxia cluster + +oxia: + initialShardCount: 3 + replicationFactor: 3 +## templates/coordinator-deployment.yaml + coordinator: + cpu: 100m + memory: 128Mi + ports: + internal: 6649 + metrics: 8080 +## templates/server-statefulset.yaml + server: + replicas: 3 + cpu: 1 + memory: 1Gi + storage: 8Gi + #storageClassName: xxx + ports: + public: 6648 + internal: 6649 + metrics: 8080 + pprofEnabled: false + monitoringEnabled: false ## Pulsar: Bookkeeper cluster ## templates/bookkeeper-statefulset.yaml From 8b2eff2ef82bfe5996997bc396eddbda45ff13ca Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Wed, 6 Nov 2024 09:41:01 -0600 Subject: [PATCH 02/67] add oxia templates --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index f6ff0b4e..75a6210a 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -114,7 +114,7 @@ components: # zookeeper zookeeper: true # oxia - oxia: true + oxia: false # bookkeeper bookkeeper: true # bookkeeper - autorecovery From b9532b88e5a298c0ee2d58ec9600e330c427d988 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Fri, 8 Nov 2024 14:01:57 -0600 Subject: [PATCH 03/67] change to Apache license. --- charts/pulsar/templates/_oxia.tpl | 31 +++++++++++-------- .../templates/oxia-coordinator-configmap.yaml | 31 +++++++++++-------- .../oxia-coordinator-deployment.yaml | 31 +++++++++++-------- .../templates/oxia-coordinator-role.yaml | 31 +++++++++++-------- .../oxia-coordinator-rolebinding.yaml | 31 +++++++++++-------- .../templates/oxia-coordinator-service.yaml | 31 +++++++++++-------- .../oxia-coordinator-serviceaccount.yaml | 31 +++++++++++-------- .../oxia-coordinator-servicemonitor.yaml | 30 ++++++++++-------- .../templates/oxia-server-service-public.yaml | 31 +++++++++++-------- .../pulsar/templates/oxia-server-service.yaml | 31 +++++++++++-------- .../templates/oxia-server-serviceaccount.yaml | 31 +++++++++++-------- .../templates/oxia-server-servicemonitor.yaml | 31 +++++++++++-------- .../templates/oxia-server-statefulset.yaml | 31 +++++++++++-------- 13 files changed, 233 insertions(+), 169 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 8b1d8750..6c3bd44a 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} {{/* Coordinator labels diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml index 1981821b..8e4aab97 100644 --- a/charts/pulsar/templates/oxia-coordinator-configmap.yaml +++ b/charts/pulsar/templates/oxia-coordinator-configmap.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: v1 kind: ConfigMap diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index 7d457f65..81e48d2a 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: apps/v1 kind: Deployment diff --git a/charts/pulsar/templates/oxia-coordinator-role.yaml b/charts/pulsar/templates/oxia-coordinator-role.yaml index 5cb372b7..caf140d4 100644 --- a/charts/pulsar/templates/oxia-coordinator-role.yaml +++ b/charts/pulsar/templates/oxia-coordinator-role.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: rbac.authorization.k8s.io/v1 kind: Role diff --git a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml index 137c0817..d46b57ad 100644 --- a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml +++ b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding diff --git a/charts/pulsar/templates/oxia-coordinator-service.yaml b/charts/pulsar/templates/oxia-coordinator-service.yaml index aacbd72c..c9fa236f 100644 --- a/charts/pulsar/templates/oxia-coordinator-service.yaml +++ b/charts/pulsar/templates/oxia-coordinator-service.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: v1 kind: Service diff --git a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml index 98920be2..1ef7d3d1 100644 --- a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: v1 kind: ServiceAccount diff --git a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml index 4d8d36b9..e4786548 100644 --- a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml @@ -1,17 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} {{- if .Values.monitoringEnabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml index fb18260f..422b1bc0 100644 --- a/charts/pulsar/templates/oxia-server-service-public.yaml +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: v1 kind: Service diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index 0f406c19..f9d19077 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: v1 kind: Service diff --git a/charts/pulsar/templates/oxia-server-serviceaccount.yaml b/charts/pulsar/templates/oxia-server-serviceaccount.yaml index ae27b255..9b1286c5 100644 --- a/charts/pulsar/templates/oxia-server-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-server-serviceaccount.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: v1 kind: ServiceAccount diff --git a/charts/pulsar/templates/oxia-server-servicemonitor.yaml b/charts/pulsar/templates/oxia-server-servicemonitor.yaml index 4d7f15bd..341d8e73 100644 --- a/charts/pulsar/templates/oxia-server-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-server-servicemonitor.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} {{- if .Values.monitoringEnabled }} apiVersion: monitoring.coreos.com/v1 diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index 70af1811..5e50baa9 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -1,16 +1,21 @@ -# Copyright 2023 StreamNative, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +{{/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/}} apiVersion: apps/v1 kind: StatefulSet From 205eaf66eaab32bf0bcda0d56ba7d37644e6236c Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Mon, 11 Nov 2024 10:30:18 -0600 Subject: [PATCH 04/67] add oxia to pulsar-init-job --- charts/pulsar/templates/_oxia.tpl | 23 ++++++++ charts/pulsar/templates/_zookeeper.tpl | 1 + .../templates/pulsar-cluster-initialize.yaml | 58 ++++++++++++------- charts/pulsar/values.yaml | 13 +++-- 4 files changed, 71 insertions(+), 24 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 6c3bd44a..ab76ce55 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -85,3 +85,26 @@ initialDelaySeconds: 60 timeoutSeconds: 10 {{- end }} +{{/* +Define the pulsar oxia +*/}} +{{- define "pulsar.oxia.server.service" -}} +{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} +{{- end }} + +{{/* +Define the pulsar oxia +*/}} +{{- define "pulsar.oxia.connect" -}} +{{$oxia:=.Values.pulsar_metadata.userProvidedOxia}} +{{- if and (not .Values.components.zookeeper) $oxia }} +{{- $oxia -}} +{{ else }} +{{- if not (and .Values.tls.enabled .Values.tls.oxia.enabled) -}} +{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.client }} +{{- end -}} +{{- if and .Values.tls.enabled .Values.tls.oxia.enabled -}} +{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.clientTls }} +{{- end -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/pulsar/templates/_zookeeper.tpl b/charts/pulsar/templates/_zookeeper.tpl index 08f7426c..215b4552 100644 --- a/charts/pulsar/templates/_zookeeper.tpl +++ b/charts/pulsar/templates/_zookeeper.tpl @@ -56,3 +56,4 @@ Define zookeeper tls settings /pulsar/keytool/keytool.sh zookeeper {{ template "pulsar.zookeeper.hostname" . }} false; {{- end }} {{- end }} + diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index b34494b2..b5a0cf0a 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -41,7 +41,7 @@ spec: {{ toYaml .Values.pulsar_metadata.nodeSelector | indent 8 }} {{- end }} initContainers: - {{- if and .Values.pulsar_metadata.waitZookeeperTimeout (not (eq (.Values.pulsar_metadata.waitZookeeperTimeout | toString) "0")) }} + {{- if and .Values.pulsar_metadata.waitZookeeperTimeout (ne (.Values.pulsar_metadata.waitZookeeperTimeout | toString) "0") }} {{- if .Values.pulsar_metadata.configurationStore }} - name: wait-cs-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" @@ -54,7 +54,7 @@ spec: sleep 3; done; {{- end }} - - name: wait-zookeeper-ready + - name: wait-metastore-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }}" resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} @@ -66,10 +66,14 @@ spec: until timeout 15 bin/pulsar zookeeper-shell -server {{ $zk }} ls {{ or .Values.metadataPrefix "/" }}; do echo "user provided zookeepers {{ $zk }} are unreachable... check in 3 seconds ..." && sleep 3; done; - {{ else }} + {{ else if .Values.components.zookeeper }} until nslookup {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ add (.Values.zookeeper.replicaCount | int) -1 }}.{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}.{{ template "pulsar.namespace" . }}; do sleep 3; done; + {{ else }} + untile nslookup {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-{{ add (.Values.oxia.server.replicas | int) -1}}.{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}.{{template "pulsar.namespace" . }}; do + sleep 3; + done; {{- end}} {{- end }} {{- if and .Values.pulsar_metadata.waitBookkeeperTimeout (not (eq (.Values.pulsar_metadata.waitBookkeeperTimeout | toString) "0")) }} @@ -107,23 +111,37 @@ spec: command: ["timeout", "{{ .Values.pulsar_metadata.initTimeout | default 60 }}", "sh", "-c"] args: - | - {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 12 }} - export PULSAR_MEM="-Xmx128M"; - bin/pulsar initialize-cluster-metadata \ - --cluster {{ template "pulsar.cluster.name" . }} \ - --zookeeper {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ - {{- if .Values.pulsar_metadata.configurationStore }} - --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ - {{- end }} - {{- if not .Values.pulsar_metadata.configurationStore }} - --configuration-store {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ - {{- end }} - --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ - --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ - --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ - --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; - {{- if .Values.extraInitCommand }} - {{ .Values.extraInitCommand }} + {{- if .Values.components.zookeeper }} + {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 12 }} + export PULSAR_MEM="-Xmx128M"; + bin/pulsar initialize-cluster-metadata \ + --cluster {{ template "pulsar.cluster.name" . }} \ + --zookeeper {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ + {{- if .Values.pulsar_metadata.configurationStore }} + --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ + {{- else }} + --configuration-store {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ + {{- end }} + --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ + --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ + --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ + --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; + {{- if .Values.extraInitCommand }} + {{ .Values.extraInitCommand }} + {{- end }} + {{- else if .Values.components.oxia }} + bin/pulsar initialize-cluster-metadata \ + --cluster {{ template "pulsar.cluster.name" . }} \ + --metadata-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}\ + {{- if .Values.pulsar_metadata.configurationStore }} + --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ + {{- else }} + --configuration-store {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ + {{- end }} + --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ + --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ + --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ + --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; {{- end }} volumeMounts: {{- include "pulsar.toolset.certs.volumeMounts" . | nindent 8 }} diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 75a6210a..71a51343 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -206,7 +206,7 @@ images: hasCommand: false oxia: repository: streamnative/oxia - tag: main + tag: 0.11.3 pullPolicy: Always ## TLS @@ -255,6 +255,8 @@ tls: function_instance: # controls the use of TLS for function runtime connections towards brokers enabled: false + oxia: + enabled: false # Enable or disable broker authentication and authorization. auth: @@ -476,6 +478,7 @@ zookeeper: ## Pulsar: Oxia cluster oxia: + component: oxia initialShardCount: 3 replicationFactor: 3 ## templates/coordinator-deployment.yaml @@ -796,10 +799,11 @@ pulsar_metadata: # uses defaultPullPolicy when unspecified pullPolicy: ## set an existing configuration store - # configurationStore: + # configurationStore: default zk. available: zk or oxia configurationStoreMetadataPrefix: "" + # default: zk port. avaiable: zk 2181, oxia 6648 configurationStorePort: 2181 - ## Timeout for waiting for zookeeper to become available before running metadata initialization + ## Timeout for waiting for zookeeper or oxia to become available before running metadata initialization waitZookeeperTimeout: 600 ## Timeout for waiting for bookkeeper to be initialized before running metadata initialization waitBookkeeperTimeout: 120 @@ -821,10 +825,11 @@ pulsar_metadata: # nodeSelector: {} # cloud.google.com/gke-nodepool: default-pool - ## optional, you can provide your own zookeeper metadata store for other components + ## optional, you can provide your own zookeeper metadata store or oxia metadata store for other components # to use this, you should explicit set components.zookeeper to false # # userProvidedZookeepers: "zk01.example.com:2181,zk02.example.com:2181" + # userProvidedOxia: "" # Can be used to run extra commands in the initialization jobs e.g. to quit istio sidecars etc. extraInitCommand: "" From 782988c120fed5ab7e1c050dfb52f66a298cbcce Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Mon, 11 Nov 2024 14:07:34 -0600 Subject: [PATCH 05/67] licenses --- .../templates/oxia-coordinator-configmap.yaml | 36 +++++++++--------- .../oxia-coordinator-deployment.yaml | 37 +++++++++---------- .../templates/oxia-coordinator-role.yaml | 36 +++++++++--------- .../oxia-coordinator-rolebinding.yaml | 36 +++++++++--------- .../templates/oxia-coordinator-service.yaml | 36 +++++++++--------- .../oxia-coordinator-serviceaccount.yaml | 36 +++++++++--------- .../oxia-coordinator-servicemonitor.yaml | 36 +++++++++--------- .../templates/oxia-server-service-public.yaml | 36 +++++++++--------- .../pulsar/templates/oxia-server-service.yaml | 36 +++++++++--------- .../templates/oxia-server-serviceaccount.yaml | 36 +++++++++--------- .../templates/oxia-server-servicemonitor.yaml | 36 +++++++++--------- .../templates/oxia-server-statefulset.yaml | 36 +++++++++--------- 12 files changed, 216 insertions(+), 217 deletions(-) diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml index 8e4aab97..ff67ad8f 100644 --- a/charts/pulsar/templates/oxia-coordinator-configmap.yaml +++ b/charts/pulsar/templates/oxia-coordinator-configmap.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: v1 kind: ConfigMap diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index 81e48d2a..978059fe 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -1,22 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} - +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/pulsar/templates/oxia-coordinator-role.yaml b/charts/pulsar/templates/oxia-coordinator-role.yaml index caf140d4..638b37d0 100644 --- a/charts/pulsar/templates/oxia-coordinator-role.yaml +++ b/charts/pulsar/templates/oxia-coordinator-role.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: rbac.authorization.k8s.io/v1 kind: Role diff --git a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml index d46b57ad..97ae5506 100644 --- a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml +++ b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding diff --git a/charts/pulsar/templates/oxia-coordinator-service.yaml b/charts/pulsar/templates/oxia-coordinator-service.yaml index c9fa236f..42b27619 100644 --- a/charts/pulsar/templates/oxia-coordinator-service.yaml +++ b/charts/pulsar/templates/oxia-coordinator-service.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: v1 kind: Service diff --git a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml index 1ef7d3d1..e8164409 100644 --- a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: v1 kind: ServiceAccount diff --git a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml index e4786548..de15d549 100644 --- a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# {{- if .Values.monitoringEnabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml index 422b1bc0..589bafb1 100644 --- a/charts/pulsar/templates/oxia-server-service-public.yaml +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: v1 kind: Service diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index f9d19077..3f17820c 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: v1 kind: Service diff --git a/charts/pulsar/templates/oxia-server-serviceaccount.yaml b/charts/pulsar/templates/oxia-server-serviceaccount.yaml index 9b1286c5..07792d81 100644 --- a/charts/pulsar/templates/oxia-server-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-server-serviceaccount.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: v1 kind: ServiceAccount diff --git a/charts/pulsar/templates/oxia-server-servicemonitor.yaml b/charts/pulsar/templates/oxia-server-servicemonitor.yaml index 341d8e73..534216c6 100644 --- a/charts/pulsar/templates/oxia-server-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-server-servicemonitor.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# {{- if .Values.monitoringEnabled }} apiVersion: monitoring.coreos.com/v1 diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index 5e50baa9..cd2f23ba 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -1,21 +1,21 @@ -{{/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/}} +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# apiVersion: apps/v1 kind: StatefulSet From 496daa4c3ac4fb35fe54badff1778f6a366be8ff Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Tue, 12 Nov 2024 08:11:27 -0600 Subject: [PATCH 06/67] fix comment space --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 71a51343..547e5b40 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -494,7 +494,7 @@ oxia: cpu: 1 memory: 1Gi storage: 8Gi - #storageClassName: xxx + # storageClassName: xxx ports: public: 6648 internal: 6649 From 79927af63b6295994f4069d05aa0ae56201eee5d Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Tue, 12 Nov 2024 13:29:56 -0600 Subject: [PATCH 07/67] add namespace and name --- .gitignore | 3 +++ charts/pulsar/templates/oxia-coordinator-configmap.yaml | 3 ++- charts/pulsar/templates/oxia-coordinator-deployment.yaml | 6 +++++- charts/pulsar/templates/oxia-coordinator-role.yaml | 5 ++++- charts/pulsar/templates/oxia-coordinator-rolebinding.yaml | 5 ++++- charts/pulsar/templates/oxia-coordinator-service.yaml | 5 ++++- .../pulsar/templates/oxia-coordinator-serviceaccount.yaml | 6 ++++-- .../pulsar/templates/oxia-coordinator-servicemonitor.yaml | 6 +++++- charts/pulsar/templates/oxia-server-service-public.yaml | 5 ++++- charts/pulsar/templates/oxia-server-service.yaml | 6 ++++-- charts/pulsar/templates/oxia-server-serviceaccount.yaml | 6 ++++-- charts/pulsar/templates/oxia-server-servicemonitor.yaml | 5 ++++- charts/pulsar/templates/oxia-server-statefulset.yaml | 5 ++++- 13 files changed, 51 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 8f642984..ad51371e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ PUBLICKEY .vagrant/ pulsarctl-*-*.tar.gz pulsarctl-*-*/ + +#test.yaml +test-values.yaml \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml index ff67ad8f..f45aa300 100644 --- a/charts/pulsar/templates/oxia-coordinator-configmap.yaml +++ b/charts/pulsar/templates/oxia-coordinator-configmap.yaml @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. # - +{{- if .Values.components.oxia }} apiVersion: v1 kind: ConfigMap metadata: @@ -35,3 +35,4 @@ data: - public: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc.{{ $vars.namespace }}.svc.cluster.local:{{ $vars.public }} internal: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc:{{ $vars.internal }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index 978059fe..4b30f861 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -16,12 +16,15 @@ # specific language governing permissions and limitations # under the License. # + +{{- if .Values.components.oxia }} apiVersion: apps/v1 kind: Deployment metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ .Release.Name }}-coordinator + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + namespace: {{ template "pulsar.namespace" . }} spec: replicas: 1 selector: @@ -68,3 +71,4 @@ spec: {{- include "oxia-cluster.probe" .Values.oxia.coordinator.ports.internal | nindent 12 }} readinessProbe: {{- include "oxia-cluster.probe" .Values.oxia.coordinator.ports.internal | nindent 12 }} +{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-role.yaml b/charts/pulsar/templates/oxia-coordinator-role.yaml index 638b37d0..5c247aa5 100644 --- a/charts/pulsar/templates/oxia-coordinator-role.yaml +++ b/charts/pulsar/templates/oxia-coordinator-role.yaml @@ -17,12 +17,14 @@ # under the License. # +{{- if .Values.components.oxia }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ .Release.Name }}-coordinator + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + namespace: {{ template "pulsar.namespace" . }} rules: - apiGroups: [ "" ] resources: [ "configmaps" ] @@ -30,3 +32,4 @@ rules: - apiGroups: [ "oxia.streamnative.io" ] resources: [ "oxiaclusters" ] verbs: [ "get", "update" ] +{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml index 97ae5506..e168e2b8 100644 --- a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml +++ b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml @@ -17,12 +17,14 @@ # under the License. # +{{- if .Values.components.oxia }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ .Release.Name }}-coordinator + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + namespace: {{ template "pulsar.namespace" . }} subjects: - kind: ServiceAccount name: {{ .Release.Name }}-coordinator @@ -31,3 +33,4 @@ roleRef: apiGroup: "" kind: Role name: {{ .Release.Name }}-coordinator +{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-service.yaml b/charts/pulsar/templates/oxia-coordinator-service.yaml index 42b27619..2a248462 100644 --- a/charts/pulsar/templates/oxia-coordinator-service.yaml +++ b/charts/pulsar/templates/oxia-coordinator-service.yaml @@ -17,13 +17,15 @@ # under the License. # +{{- if .Values.components.oxia }} apiVersion: v1 kind: Service metadata: labels: oxia_cluster: {{ .Release.Name }} {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ .Release.Name }}-coordinator + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + namespace: {{ template "pulsar.namespace" . }} spec: ports: {{- range $key, $value := .Values.oxia.coordinator.ports }} @@ -33,3 +35,4 @@ spec: {{- end}} selector: {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml index e8164409..263811c0 100644 --- a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml @@ -16,14 +16,16 @@ # specific language governing permissions and limitations # under the License. # - +{{- if .Values.components.oxia }} apiVersion: v1 kind: ServiceAccount metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ .Release.Name }}-coordinator + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + namespace: {{ template "pulsar.namespace" . }} {{- if .Values.images.imagePullSecrets }} imagePullSecrets: - name: {{ .Values.images.imagePullSecrets.secretName }} {{- end}} +{{- end}} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml index de15d549..77a93977 100644 --- a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml @@ -16,13 +16,16 @@ # specific language governing permissions and limitations # under the License. # + +{{- if .Values.components.oxia }} {{- if .Values.monitoringEnabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ .Release.Name }}-coordinator + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + namespace: {{ template "pulsar.namespace" . }} spec: endpoints: - port: metrics @@ -32,3 +35,4 @@ spec: targetLabels: - oxia_cluster {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml index 589bafb1..1e81e2e1 100644 --- a/charts/pulsar/templates/oxia-server-service-public.yaml +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -17,13 +17,15 @@ # under the License. # +{{- if .Values.components.oxia }} apiVersion: v1 kind: Service metadata: labels: oxia_cluster: {{ .Release.Name }} {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: {{ .Release.Name }} + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + namespace: {{ template "pulsar.namespace" . }} spec: ports: {{- range $key, $value := .Values.oxia.server.ports }} @@ -33,3 +35,4 @@ spec: {{- end}} selector: {{- include "oxia-cluster.server.selectorLabels" . | nindent 4 }} +{{- end}} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index 3f17820c..09b4cb8d 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -16,14 +16,15 @@ # specific language governing permissions and limitations # under the License. # - +{{- if .Values.components.oxia }} apiVersion: v1 kind: Service metadata: labels: oxia_cluster: {{ .Release.Name }} {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: {{ .Release.Name }}-svc + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + namespace: {{ template "pulsar.namespace" . }} spec: clusterIP: None publishNotReadyAddresses: true @@ -35,3 +36,4 @@ spec: {{- end}} selector: {{- include "oxia-cluster.server.selectorLabels" . | nindent 4 }} +{{- end}} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-serviceaccount.yaml b/charts/pulsar/templates/oxia-server-serviceaccount.yaml index 07792d81..876a3ef8 100644 --- a/charts/pulsar/templates/oxia-server-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-server-serviceaccount.yaml @@ -16,14 +16,16 @@ # specific language governing permissions and limitations # under the License. # - +{{- if .Values.components.oxia }} apiVersion: v1 kind: ServiceAccount metadata: labels: {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: {{ .Release.Name }} + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + namespace: {{ template "pulsar.namespace" . }} {{- if .Values.images.imagePullSecrets }} imagePullSecrets: - name: {{ .Values.images.imagePullSecrets.secretName }} {{- end}} +{{- end}} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-servicemonitor.yaml b/charts/pulsar/templates/oxia-server-servicemonitor.yaml index 534216c6..8c653a29 100644 --- a/charts/pulsar/templates/oxia-server-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-server-servicemonitor.yaml @@ -17,13 +17,15 @@ # under the License. # +{{- if .Values.components.oxia }} {{- if .Values.monitoringEnabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: {{ .Release.Name }} + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + namespace: {{ template "pulsar.namespace" . }} spec: endpoints: - port: metrics @@ -33,3 +35,4 @@ spec: targetLabels: - oxia_cluster {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index cd2f23ba..7377cfd7 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -17,12 +17,14 @@ # under the License. # +{{- if .Values.components.oxia }} apiVersion: apps/v1 kind: StatefulSet metadata: labels: {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: {{ .Release.Name }} + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + namespace: {{ template "pulsar.namespace" . }} spec: replicas: {{ .Values.oxia.server.replicas }} selector: @@ -84,3 +86,4 @@ spec: resources: requests: storage: {{ .Values.oxia.server.storage }} +{{- end}} \ No newline at end of file From d325c12811d3ae088d3f9748ad086ef205bb6bf8 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Tue, 12 Nov 2024 13:56:33 -0600 Subject: [PATCH 08/67] fix pvc name --- .gitignore | 2 +- charts/pulsar/templates/oxia-server-statefulset.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ad51371e..01bedb2a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ pulsarctl-*-*.tar.gz pulsarctl-*-*/ #test.yaml -test-values.yaml \ No newline at end of file +charts/pulsar/test-values.yaml \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index 7377cfd7..267e147b 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -77,7 +77,7 @@ spec: {{- include "oxia-cluster.startup-probe" .Values.oxia.server.ports.internal | nindent 12 }} volumeClaimTemplates: - metadata: - name: data + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-data spec: accessModes: [ "ReadWriteOnce" ] {{- if .Values.oxia.server.storageClassName }} From 4438a4f150298523d9703a1d993653959fa31100 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Tue, 12 Nov 2024 18:25:25 -0600 Subject: [PATCH 09/67] fix doublequotes --- charts/pulsar/templates/_helpers.tpl | 3 +- charts/pulsar/templates/_oxia.tpl | 32 ++++++++++++++++++- .../templates/oxia-coordinator-configmap.yaml | 15 +++------ .../oxia-coordinator-deployment.yaml | 21 ++++-------- .../templates/oxia-coordinator-role.yaml | 2 +- .../oxia-coordinator-rolebinding.yaml | 8 ++--- .../templates/oxia-coordinator-service.yaml | 4 +-- .../oxia-coordinator-serviceaccount.yaml | 2 +- .../templates/oxia-server-service-public.yaml | 2 +- .../pulsar/templates/oxia-server-service.yaml | 2 +- .../templates/oxia-server-statefulset.yaml | 10 +++--- 11 files changed, 58 insertions(+), 43 deletions(-) diff --git a/charts/pulsar/templates/_helpers.tpl b/charts/pulsar/templates/_helpers.tpl index 5d38c4dd..d8bc866d 100644 --- a/charts/pulsar/templates/_helpers.tpl +++ b/charts/pulsar/templates/_helpers.tpl @@ -134,4 +134,5 @@ Lookup pull policy, default to defaultPullPolicy */}} {{- define "pulsar.imagePullPolicy" -}} {{- printf "%s" (.image.pullPolicy | default .root.Values.defaultPullPolicy) -}} -{{- end -}} \ No newline at end of file +{{- end -}} + diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index ab76ce55..a12ab30c 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -107,4 +107,34 @@ Define the pulsar oxia {{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.clientTls }} {{- end -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Define coordinator configmap +*/}} +{{- define "oxia.coordinator.CMProperties" -}} +namespaces: + - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + initialShardCount: {{ .Values.oxia.initialShardCount }} + replicationFactor: {{ .Values.oxia.replicationFactor }} +servers: + - public: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc.{{ template "pulsar.namespace" . }}.svc.cluster.local:{{ .Values.oxia.server.ports.public }} + internal: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc.{{ template "pulsar.namespace" . }}.svc:{{ .Values.oxia.server.ports.internal }} +{{- end }} + +{{/* +Define coordinator entrypoint +*/}} +{{- define "oxia.coordinator.entrypoint" -}} +- "oxia" +- "coordinator" +- "--conf=configmap:{{ template "pulsar.namespace" . }}/{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator" +- "--log-json" +- "--metadata=configmap" +- "--k8s-namespace={{ template "pulsar.namespace" . }}" +- "--k8s-configmap-name={{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator-status" +{{- if .Values.oxia.pprofEnabled }} +- "--profile" +{{- end}} +{{- end}} + diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml index f45aa300..17959f49 100644 --- a/charts/pulsar/templates/oxia-coordinator-configmap.yaml +++ b/charts/pulsar/templates/oxia-coordinator-configmap.yaml @@ -22,17 +22,10 @@ kind: ConfigMap metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ .Release.Name }}-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator + namespace: {{ template "pulsar.namespace" . }} data: config.yaml: | - namespaces: - - name: default - initialShardCount: {{ .Values.oxia.initialShardCount }} - replicationFactor: {{ .Values.oxia.replicationFactor }} - servers: - {{- $vars := dict "name" .Release.Name "namespace" .Release.Namespace "public" .Values.oxia.server.ports.public "internal" .Values.oxia.server.ports.internal }} - {{- range until (int .Values.oxia.server.replicas) }} - - public: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc.{{ $vars.namespace }}.svc.cluster.local:{{ $vars.public }} - internal: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc:{{ $vars.internal }} - {{- end }} + {{- include "oxia.coordinator.CMProperties" . | nindent 4 }} + {{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index 4b30f861..bef99f32 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -23,7 +23,7 @@ kind: Deployment metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} spec: replicas: 1 @@ -38,24 +38,15 @@ spec: prometheus.io/port: "{{ .Values.oxia.coordinator.ports.metrics }}" prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}" labels: - oxia_cluster: {{ .Release.Name }} + oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.coordinator.labels" . | nindent 8 }} - name: {{ .Release.Name }}-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator spec: - serviceAccountName: {{ .Release.Name }}-coordinator + serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator containers: - command: - - "oxia" - - "coordinator" - - "--conf=configmap:{{ .Release.Namespace }}/{{ .Release.Name }}-coordinator" - - "--log-json" - - "--metadata=configmap" - - "--k8s-namespace={{ .Release.Namespace }}" - - "--k8s-configmap-name={{ .Release.Name }}-status" - {{- if .Values.oxia.pprofEnabled }} - - "--profile" - {{- end}} - image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag | default .Chart.AppVersion }}" + {{- include "oxia.coordinator.entrypoint" . | nindent 12 }} + image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag }}" imagePullPolicy: {{ .Values.images.oxia.pullPolicy }} name: coordinator ports: diff --git a/charts/pulsar/templates/oxia-coordinator-role.yaml b/charts/pulsar/templates/oxia-coordinator-role.yaml index 5c247aa5..067045f5 100644 --- a/charts/pulsar/templates/oxia-coordinator-role.yaml +++ b/charts/pulsar/templates/oxia-coordinator-role.yaml @@ -23,7 +23,7 @@ kind: Role metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} rules: - apiGroups: [ "" ] diff --git a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml index e168e2b8..686ccb90 100644 --- a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml +++ b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml @@ -23,14 +23,14 @@ kind: RoleBinding metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} subjects: - kind: ServiceAccount - name: {{ .Release.Name }}-coordinator - namespace: {{ .Release.Namespace }} + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator + namespace: {{ template "pulsar.namespace" . }} roleRef: apiGroup: "" kind: Role - name: {{ .Release.Name }}-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator {{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-service.yaml b/charts/pulsar/templates/oxia-coordinator-service.yaml index 2a248462..8c70f670 100644 --- a/charts/pulsar/templates/oxia-coordinator-service.yaml +++ b/charts/pulsar/templates/oxia-coordinator-service.yaml @@ -22,9 +22,9 @@ apiVersion: v1 kind: Service metadata: labels: - oxia_cluster: {{ .Release.Name }} + oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} spec: ports: diff --git a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml index 263811c0..66de1394 100644 --- a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml @@ -22,7 +22,7 @@ kind: ServiceAccount metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} {{- if .Values.images.imagePullSecrets }} imagePullSecrets: diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml index 1e81e2e1..a2b6df45 100644 --- a/charts/pulsar/templates/oxia-server-service-public.yaml +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -22,7 +22,7 @@ apiVersion: v1 kind: Service metadata: labels: - oxia_cluster: {{ .Release.Name }} + oxia_cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" namespace: {{ template "pulsar.namespace" . }} diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index 09b4cb8d..92a8bdd7 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -21,7 +21,7 @@ apiVersion: v1 kind: Service metadata: labels: - oxia_cluster: {{ .Release.Name }} + oxia_cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" namespace: {{ template "pulsar.namespace" . }} diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index 267e147b..c5473cd7 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -30,7 +30,7 @@ spec: selector: matchLabels: {{- include "oxia-cluster.server.selectorLabels" . | nindent 6 }} - serviceName: {{ .Release.Name }}-svc + serviceName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc podManagementPolicy: Parallel template: metadata: @@ -38,11 +38,11 @@ spec: prometheus.io/port: "{{ .Values.oxia.server.ports.metrics }}" prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}" labels: - oxia_cluster: {{ .Release.Name }} + oxia_cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" {{- include "oxia-cluster.server.labels" . | nindent 8 }} - name: {{ .Release.Name }} + name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" spec: - serviceAccountName: {{ .Release.Name }} + serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" containers: - command: - "oxia" @@ -77,7 +77,7 @@ spec: {{- include "oxia-cluster.startup-probe" .Values.oxia.server.ports.internal | nindent 12 }} volumeClaimTemplates: - metadata: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-data + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-data spec: accessModes: [ "ReadWriteOnce" ] {{- if .Values.oxia.server.storageClassName }} From 33bfdc12a66369428e061f025793d8dc505fd5ff Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Tue, 12 Nov 2024 18:48:19 -0600 Subject: [PATCH 10/67] fix more doublequotes --- charts/pulsar/output.yml | 2913 +++++++++++++++++ .../oxia-coordinator-servicemonitor.yaml | 2 +- .../templates/oxia-server-service-public.yaml | 4 +- .../pulsar/templates/oxia-server-service.yaml | 4 +- .../templates/oxia-server-serviceaccount.yaml | 2 +- .../templates/oxia-server-servicemonitor.yaml | 2 +- .../templates/oxia-server-statefulset.yaml | 6 +- 7 files changed, 2923 insertions(+), 10 deletions(-) create mode 100644 charts/pulsar/output.yml diff --git a/charts/pulsar/output.yml b/charts/pulsar/output.yml new file mode 100644 index 00000000..568f5fad --- /dev/null +++ b/charts/pulsar/output.yml @@ -0,0 +1,2913 @@ +--- +# Source: pulsar/templates/bookkeeper-pdb.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# pdb version detection +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: "release-name-pulsar-bookie" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: bookie +spec: + selector: + matchLabels: + app: pulsar + release: release-name + component: bookie + maxUnavailable: 1 +--- +# Source: pulsar/templates/broker-pdb.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# pdb version detection +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: "release-name-pulsar-broker" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: broker +spec: + selector: + matchLabels: + app: pulsar + release: release-name + component: broker + maxUnavailable: 1 +--- +# Source: pulsar/templates/autorecovery-service-account.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ServiceAccount +metadata: + name: "release-name-pulsar-recovery" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: recovery + annotations: +--- +# Source: pulsar/templates/bookkeeper-service-account.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ServiceAccount +metadata: + name: "release-name-pulsar-bookie" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: bookie + annotations: +--- +# Source: pulsar/templates/broker-service-account.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ServiceAccount +metadata: + name: "release-name-pulsar-broker-acct" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: broker + annotations: +--- +# Source: pulsar/templates/oxia-coordinator-serviceaccount.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/part-of: oxia + app.kubernetes.io/managed-by: Helm + name: release-name-pulsar-oxia-coordinator + namespace: pulsar +--- +# Source: pulsar/templates/oxia-server-serviceaccount.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/managed-by: Helm + name: "release-name-pulsar-oxia" + namespace: pulsar +--- +# Source: pulsar/templates/toolset-service-account.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ServiceAccount +metadata: + name: "release-name-pulsar-toolset" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: toolset + annotations: +--- +# Source: pulsar/templates/autorecovery-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ConfigMap +metadata: + name: "release-name-pulsar-recovery" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: recovery +data: + # common config + zkServers: "release-name-pulsar-zookeeper:2181" + zkLedgersRootPath: "/ledgers" + # enable bookkeeper http server + httpServerEnabled: "true" + httpServerPort: "8000" + # config the stats provider + statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider + # use hostname as the bookie id + useHostNameAsBookieID: "true" + BOOKIE_MEM: | + -Xms64m -Xmx64m + PULSAR_PREFIX_useV2WireProtocol: "true" +--- +# Source: pulsar/templates/bookkeeper-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ConfigMap +metadata: + name: "release-name-pulsar-bookie" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: bookie +data: + # common config + zkServers: "release-name-pulsar-zookeeper:2181" + zkLedgersRootPath: "/ledgers" + # enable bookkeeper http server + httpServerEnabled: "true" + httpServerPort: "8000" + # config the stats provider + statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider + # use hostname as the bookie id + useHostNameAsBookieID: "true" + # disable auto recovery on bookies since we will start AutoRecovery in separated pods + autoRecoveryDaemonEnabled: "false" + # Do not retain journal files as it increase the disk utilization + journalMaxBackups: "0" + journalDirectories: "/pulsar/data/bookkeeper/journal" + PULSAR_PREFIX_journalDirectories: "/pulsar/data/bookkeeper/journal" + ledgerDirectories: "/pulsar/data/bookkeeper/ledgers" + # TLS config + + PULSAR_GC: | + -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem + PULSAR_MEM: | + -Xms128m -Xmx256m -XX:MaxDirectMemorySize=256m + diskCheckInterval: "1800" + diskUsageLwmThreshold: "0.85" + diskUsageThreshold: "0.95" + diskUsageWarnThreshold: "0.9" + gcWaitTime: "300000" + isForceGCAllowWhenNoSpace: "true" + majorCompactionInterval: "10800" + majorCompactionThreshold: "0.8" + minorCompactionInterval: "360" + minorCompactionThreshold: "0.2" +--- +# Source: pulsar/templates/broker-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ConfigMap +metadata: + name: "release-name-pulsar-broker" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: broker +data: + # Metadata settings + zookeeperServers: "release-name-pulsar-zookeeper:2181" + configurationStoreServers: "release-name-pulsar-zookeeper:2181" + + # Broker settings + clusterName: release-name-pulsar + exposeTopicLevelMetricsInPrometheus: "true" + numHttpServerThreads: "8" + zooKeeperSessionTimeoutMillis: "30000" + statusFilePath: "/pulsar/logs/status" + + # Tiered storage settings + + # Function Worker Settings + # function worker configuration + functionsWorkerEnabled: "false" + + # prometheus needs to access /metrics endpoint + webServicePort: "8080" + brokerServicePort: "6650" + + # Authentication Settings + PULSAR_GC: | + -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem + PULSAR_MEM: | + -Xms128m -Xmx256m -XX:MaxDirectMemorySize=256m + managedLedgerDefaultAckQuorum: "1" + managedLedgerDefaultEnsembleSize: "1" + managedLedgerDefaultWriteQuorum: "1" +--- +# Source: pulsar/templates/oxia-coordinator-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/part-of: oxia + app.kubernetes.io/managed-by: Helm + name: release-name-pulsar-oxia-coordinator + namespace: pulsar +data: + config.yaml: | + namespaces: + - name: "release-name-pulsar-oxia" + initialShardCount: 3 + replicationFactor: 3 + servers: + - public: release-name-pulsar-oxia-svc.pulsar.svc.cluster.local:6648 + internal: release-name-pulsar-oxia-svc.pulsar.svc:6649 +--- +# Source: pulsar/templates/toolset-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: ConfigMap +metadata: + name: "release-name-pulsar-toolset" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: toolset +data: + BOOKIE_LOG_APPENDER: "RollingFile" + zkServers: "release-name-pulsar-zookeeper:2181" + zkLedgersRootPath: "/ledgers" + # enable bookkeeper http server + httpServerEnabled: "true" + httpServerPort: "8000" + # config the stats provider + statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider + # use hostname as the bookie id + useHostNameAsBookieID: "true" + # talk to proxy + webServiceUrl: "http://release-name-pulsar-proxy:80/" + brokerServiceUrl: "pulsar://release-name-pulsar-proxy:6650/" + # Authentication Settings + PULSAR_MEM: | + -Xms64M -Xmx128M -XX:MaxDirectMemorySize=128M +--- +# Source: pulsar/templates/broker-cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: "release-name-pulsar-broker-role" + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar +rules: +- apiGroups: [""] + resources: + - configmaps + verbs: ["get", "list", "watch"] +- apiGroups: [""] + resources: + - pods + - services + - secrets + verbs: + - list + - watch + - get + - update + - create + - delete + - patch +- apiGroups: ["apps"] + resources: + - deployments + - statefulsets + verbs: + - list + - watch + - get + - update + - create + - delete + - patch +--- +# Source: pulsar/templates/oxia-coordinator-role.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/part-of: oxia + app.kubernetes.io/managed-by: Helm + name: release-name-pulsar-oxia-coordinator + namespace: pulsar +rules: + - apiGroups: [ "" ] + resources: [ "configmaps" ] + verbs: [ "*" ] + - apiGroups: [ "oxia.streamnative.io" ] + resources: [ "oxiaclusters" ] + verbs: [ "get", "update" ] +--- +# Source: pulsar/templates/broker-cluster-role-binding.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +## TODO create our own cluster role with less privledges than admin +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: "release-name-pulsar-broker-rolebinding" + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "release-name-pulsar-broker-role" +subjects: +- kind: ServiceAccount + name: "release-name-pulsar-broker-acct" + namespace: pulsar +--- +# Source: pulsar/templates/oxia-coordinator-rolebinding.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/part-of: oxia + app.kubernetes.io/managed-by: Helm + name: release-name-pulsar-oxia-coordinator + namespace: pulsar +subjects: + - kind: ServiceAccount + name: release-name-pulsar-oxia-coordinator + namespace: pulsar +roleRef: + apiGroup: "" + kind: Role + name: release-name-pulsar-oxia-coordinator +--- +# Source: pulsar/templates/autorecovery-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: Service +metadata: + name: "release-name-pulsar-recovery" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: recovery +spec: + ports: + - name: http + port: 8000 + clusterIP: None + selector: + app: pulsar + release: release-name + component: recovery +--- +# Source: pulsar/templates/bookkeeper-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: Service +metadata: + name: "release-name-pulsar-bookie" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: bookie +spec: + ports: + - name: "bookie" + port: 3181 + - name: http + port: 8000 + clusterIP: None + selector: + app: pulsar + release: release-name + component: bookie + publishNotReadyAddresses: true +--- +# Source: pulsar/templates/broker-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: Service +metadata: + name: "release-name-pulsar-broker" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: broker + annotations: + {} +spec: + type: ClusterIP + ports: + # prometheus needs to access /metrics endpoint + - name: http + port: 8080 + - name: "pulsar" + port: 6650 + clusterIP: "None" + selector: + app: pulsar + release: release-name + component: broker +--- +# Source: pulsar/templates/oxia-coordinator-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: Service +metadata: + labels: + oxia_cluster: release-name-pulsar-oxia + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/part-of: oxia + app.kubernetes.io/managed-by: Helm + name: release-name-pulsar-oxia-coordinator + namespace: pulsar +spec: + ports: + - name: internal + port: 6649 + targetPort: internal + - name: metrics + port: 8080 + targetPort: metrics + selector: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name +--- +# Source: pulsar/templates/oxia-server-service-public.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: Service +metadata: + labels: + oxia_cluster: "release-name-pulsar-oxia" + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/managed-by: Helm + name: "release-name-pulsar-oxia" + namespace: pulsar +spec: + ports: + - name: internal + port: 6649 + targetPort: internal + - name: metrics + port: 8080 + targetPort: metrics + - name: public + port: 6648 + targetPort: public + selector: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name +--- +# Source: pulsar/templates/oxia-server-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: Service +metadata: + labels: + oxia_cluster: "release-name-pulsar-oxia" + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/managed-by: Helm + name: "release-name-pulsar-oxia" + namespace: pulsar +spec: + clusterIP: None + publishNotReadyAddresses: true + ports: + - name: internal + port: 6649 + targetPort: internal + - name: metrics + port: 8080 + targetPort: metrics + - name: public + port: 6648 + targetPort: public + selector: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name +--- +# Source: pulsar/templates/toolset-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: v1 +kind: Service +metadata: + name: "release-name-pulsar-toolset" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: toolset +spec: + clusterIP: None + selector: + app: pulsar + release: release-name + component: toolset +--- +# Source: pulsar/templates/oxia-coordinator-deployment.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/part-of: oxia + app.kubernetes.io/managed-by: Helm + name: release-name-pulsar-oxia-coordinator + namespace: pulsar +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + strategy: + type: Recreate + template: + metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scrape: "false" + labels: + oxia_cluster: release-name-pulsar-oxia + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: coordinator + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/part-of: oxia + app.kubernetes.io/managed-by: Helm + name: release-name-pulsar-oxia-coordinator + spec: + serviceAccountName: release-name-pulsar-oxia-coordinator + containers: + - command: + - "oxia" + - "coordinator" + - "--conf=configmap:pulsar/release-name-pulsar-oxia-coordinator" + - "--log-json" + - "--metadata=configmap" + - "--k8s-namespace=pulsar" + - "--k8s-configmap-name=release-name-pulsar-oxia-coordinator-status" + image: "streamnative/oxia:0.11.3" + imagePullPolicy: Always + name: coordinator + ports: + - containerPort: 6649 + name: internal + - containerPort: 8080 + name: metrics + resources: + limits: + cpu: 100m + memory: 128Mi + livenessProbe: + exec: + command: ["oxia", "health", "--port=6649"] + initialDelaySeconds: 10 + timeoutSeconds: 10 + readinessProbe: + exec: + command: ["oxia", "health", "--port=6649"] + initialDelaySeconds: 10 + timeoutSeconds: 10 +--- +# Source: pulsar/templates/autorecovery-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: "release-name-pulsar-recovery" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: recovery +spec: + serviceName: "release-name-pulsar-recovery" + replicas: 1 + updateStrategy: + type: RollingUpdate + podManagementPolicy: Parallel + # nodeSelector: + selector: + matchLabels: + app: pulsar + release: release-name + component: recovery + template: + metadata: + labels: + app: pulsar + release: release-name + cluster: release-name-pulsar + component: recovery + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8000" + spec: + affinity: + podAntiAffinity: + + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - "pulsar" + - key: "release" + operator: In + values: + - release-name + - key: "component" + operator: In + values: + - recovery + topologyKey: kubernetes.io/hostname + + terminationGracePeriodSeconds: 30 + serviceAccountName: "release-name-pulsar-recovery" + initContainers: + # This initContainer will wait for bookkeeper initnewcluster to complete + # before deploying the bookies + - name: pulsar-bookkeeper-verify-clusterid + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["timeout", "120", "sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/bookkeeper.conf;until timeout 15 bin/bookkeeper shell whatisinstanceid; do + sleep 3; + done; + envFrom: + - configMapRef: + name: "release-name-pulsar-recovery" + volumeMounts: + + containers: + - name: "release-name-pulsar-recovery" + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.05 + memory: 64Mi + command: ["sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/bookkeeper.conf; + + OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/bookkeeper autorecovery + ports: + - name: http + containerPort: 8000 + envFrom: + - configMapRef: + name: "release-name-pulsar-recovery" + volumeMounts: + + volumes: +--- +# Source: pulsar/templates/bookkeeper-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: "release-name-pulsar-bookie" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: bookie +spec: + serviceName: "release-name-pulsar-bookie" + replicas: 4 + selector: + matchLabels: + app: pulsar + release: release-name + component: bookie + updateStrategy: + type: RollingUpdate + podManagementPolicy: Parallel + template: + metadata: + labels: + app: pulsar + release: release-name + cluster: release-name-pulsar + component: bookie + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8000" + spec: + affinity: + podAntiAffinity: + + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - "pulsar" + - key: "release" + operator: In + values: + - release-name + - key: "component" + operator: In + values: + - bookie + topologyKey: kubernetes.io/hostname + + terminationGracePeriodSeconds: 30 + serviceAccountName: "release-name-pulsar-bookie" + securityContext: + fsGroup: 0 + fsGroupChangePolicy: OnRootMismatch + initContainers: + # This initContainer will wait for bookkeeper initnewcluster to complete + # before deploying the bookies + - name: pulsar-bookkeeper-verify-clusterid + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["timeout", "600", "sh", "-c"] + args: + # only reformat bookie if bookkeeper is running without persistence + - > + + set -e; + bin/apply-config-from-env.py conf/bookkeeper.conf;until timeout 15 bin/bookkeeper shell whatisinstanceid; do + sleep 3; + done; + envFrom: + - configMapRef: + name: "release-name-pulsar-bookie" + volumeMounts: + + containers: + - name: "release-name-pulsar-bookie" + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + livenessProbe: + httpGet: + path: /api/v1/bookie/state + port: 8000 + initialDelaySeconds: 10 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 60 + readinessProbe: + httpGet: + path: /api/v1/bookie/is_ready + port: 8000 + initialDelaySeconds: 10 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 60 + resources: + requests: + cpu: 0.2 + memory: 512Mi + command: ["sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/bookkeeper.conf; + + OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/pulsar bookie; + ports: + - name: "bookie" + containerPort: 3181 + - name: http + containerPort: 8000 + envFrom: + - configMapRef: + name: "release-name-pulsar-bookie" + volumeMounts: + - name: "release-name-pulsar-bookie-journal" + mountPath: /pulsar/data/bookkeeper/journal + - name: "release-name-pulsar-bookie-ledgers" + mountPath: /pulsar/data/bookkeeper/ledgers + + volumes: + + + volumeClaimTemplates: + - metadata: + name: "release-name-pulsar-bookie-journal" + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 10Gi + storageClassName: "rook-ceph-block" + - metadata: + name: "release-name-pulsar-bookie-ledgers" + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 50Gi +--- +# Source: pulsar/templates/broker-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: "release-name-pulsar-broker" + namespace: "pulsar" + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: broker +spec: + serviceName: "release-name-pulsar-broker" + replicas: 3 + selector: + matchLabels: + app: pulsar + release: release-name + component: broker + updateStrategy: + type: RollingUpdate + podManagementPolicy: Parallel + template: + metadata: + labels: + app: pulsar + release: release-name + cluster: release-name-pulsar + component: broker + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8080" + spec: + serviceAccountName: "release-name-pulsar-broker-acct" + affinity: + podAntiAffinity: + + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - "pulsar" + - key: "release" + operator: In + values: + - release-name + - key: "component" + operator: In + values: + - broker + topologyKey: kubernetes.io/hostname + + terminationGracePeriodSeconds: 30 + initContainers: + # This init container will wait for zookeeper to be ready before + # deploying the bookies + - name: wait-zookeeper-ready + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["timeout", "600", "sh", "-c"] + args: + - >- + + export BOOKIE_MEM="-Xmx128M"; + until timeout 15 bin/pulsar zookeeper-shell -server release-name-pulsar-zookeeper:2181 get /admin/clusters/release-name-pulsar; do + echo "pulsar cluster release-name-pulsar isn't initialized yet ... check in 3 seconds ..." && sleep 3; + done; + volumeMounts: + + # This init container will wait for bookkeeper to be ready before + # deploying the broker + - name: wait-bookkeeper-ready + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["timeout", "120", "sh", "-c"] + args: + - > + + bin/apply-config-from-env.py conf/bookkeeper.conf; + export BOOKIE_MEM="-Xmx128M"; + until timeout 15 bin/bookkeeper shell whatisinstanceid; do + echo "bookkeeper cluster is not initialized yet. backoff for 3 seconds ..."; + sleep 3; + done; + echo "bookkeeper cluster is already initialized"; + bookieServiceNumber="$(nslookup -timeout=10 release-name-pulsar-bookie | grep Name | wc -l)"; + until [ ${bookieServiceNumber} -ge 1 ]; do + echo "bookkeeper cluster release-name-pulsar isn't ready yet ... check in 10 seconds ..."; + sleep 10; + bookieServiceNumber="$(nslookup -timeout=10 release-name-pulsar-bookie | grep Name | wc -l)"; + done; + echo "bookkeeper cluster is ready"; + envFrom: + - configMapRef: + name: "release-name-pulsar-bookie" + volumeMounts: + + containers: + - name: "release-name-pulsar-broker" + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + livenessProbe: + httpGet: + path: /status.html + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 10 + readinessProbe: + httpGet: + path: /status.html + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 10 + resources: + requests: + cpu: 0.2 + memory: 512Mi + command: ["sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/broker.conf; + bin/gen-yml-from-env.py conf/functions_worker.yml; + echo "OK" > "${statusFilePath:-status}"; + + timeout 15 bin/pulsar zookeeper-shell -server release-name-pulsar-zookeeper:2181 get /loadbalance/brokers/${HOSTNAME}.release-name-pulsar-broker.pulsar.svc.cluster.local:8080; + while [ $? -eq 0 ]; do + echo "broker ${HOSTNAME}.release-name-pulsar-broker.pulsar.svc.cluster.local znode still exists ... check in 10 seconds ..."; + sleep 10; + timeout 15 bin/pulsar zookeeper-shell -server release-name-pulsar-zookeeper:2181 get /loadbalance/brokers/${HOSTNAME}.release-name-pulsar-broker.pulsar.svc.cluster.local:8080; + done; + cat conf/pulsar_env.sh; + OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/pulsar broker; + ports: + # prometheus needs to access /metrics endpoint + - name: http + containerPort: 8080 + - name: "pulsar" + containerPort: 6650 + envFrom: + - configMapRef: + name: "release-name-pulsar-broker" + volumeMounts: + + env: + volumes: +--- +# Source: pulsar/templates/oxia-server-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/managed-by: Helm + name: "release-name-pulsar-oxia" + namespace: pulsar +spec: + replicas: 3 + selector: + matchLabels: + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name + serviceName: release-name-pulsar-oxia-svc + podManagementPolicy: Parallel + template: + metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scrape: "false" + labels: + oxia_cluster: "release-name-pulsar-oxia" + app.kubernetes.io/name: pulsar + app.kubernetes.io/component: server + app.kubernetes.io/instance: release-name + app.kubernetes.io/version: "4.0.0" + app.kubernetes.io/managed-by: Helm + name: "release-name-pulsar-oxia" + spec: + serviceAccountName: "release-name-pulsar-oxia" + containers: + - command: + - "oxia" + - "server" + - "--log-json" + - "--data-dir=/data/db" + - "--wal-dir=/data/wal" + - "--db-cache-size-mb=512" + image: "streamnative/oxia:0.11.3" + imagePullPolicy: Always + name: server + ports: + - containerPort: 6649 + name: internal + - containerPort: 8080 + name: metrics + - containerPort: 6648 + name: public + resources: + limits: + cpu: 1 + memory: 1Gi + volumeMounts: + - name: data + mountPath: /data + livenessProbe: + exec: + command: ["oxia", "health", "--port=6649"] + initialDelaySeconds: 10 + timeoutSeconds: 10 + readinessProbe: + exec: + command: ["oxia", "health", "--port=6649", "--service=oxia-readiness"] + initialDelaySeconds: 10 + timeoutSeconds: 10 + startupProbe: + exec: + command: ["oxia", "health", "--port=6649"] + initialDelaySeconds: 60 + timeoutSeconds: 10 + volumeClaimTemplates: + - metadata: + name: release-name-pulsar-oxia-data + spec: + accessModes: [ "ReadWriteOnce" ] + storageClassName: rook-ceph-block + resources: + requests: + storage: 8Gi +--- +# Source: pulsar/templates/toolset-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: "release-name-pulsar-toolset" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: toolset +spec: + serviceName: "release-name-pulsar-toolset" + replicas: 1 + updateStrategy: + type: RollingUpdate + podManagementPolicy: Parallel + selector: + matchLabels: + app: pulsar + release: release-name + component: toolset + template: + metadata: + labels: + app: pulsar + release: release-name + cluster: release-name-pulsar + component: toolset + annotations: + spec: + terminationGracePeriodSeconds: 30 + serviceAccountName: "release-name-pulsar-toolset" + containers: + - name: "release-name-pulsar-toolset" + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/client.conf; + bin/apply-config-from-env.py conf/bookkeeper.conf; + + sleep 10000000000 + envFrom: + - configMapRef: + name: "release-name-pulsar-toolset" + volumeMounts: + + volumes: +--- +# Source: pulsar/templates/bookkeeper-cluster-initialize.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: batch/v1 +kind: Job +metadata: + name: "release-name-pulsar-bookie-init" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: "bookie-init" +spec: +# This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond +# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ + template: + spec: + + serviceAccountName: "release-name-pulsar-bookie" + nodeSelector: + tolerations: + initContainers: + - name: wait-zookeeper-ready + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["timeout", "600", "sh", "-c"] + args: + - >- + until nslookup release-name-pulsar-zookeeper-2.release-name-pulsar-zookeeper.pulsar; do + sleep 3; + done; + containers: + - name: "release-name-pulsar-bookie-init" + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + command: ["timeout", "60", "sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/bookkeeper.conf; + + export BOOKIE_MEM="-Xmx128M"; + if timeout 15 bin/bookkeeper shell whatisinstanceid; then + echo "bookkeeper cluster already initialized"; + else + bin/bookkeeper shell initnewcluster; + fi + envFrom: + - configMapRef: + name: "release-name-pulsar-bookie" + volumeMounts: + + volumes: + + restartPolicy: OnFailure +--- +# Source: pulsar/templates/pulsar-cluster-initialize.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +apiVersion: batch/v1 +kind: Job +metadata: + name: "release-name-pulsar-pulsar-init" + namespace: pulsar + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm + cluster: release-name-pulsar + component: pulsar-init +spec: +# This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond +# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ + template: + spec: + + initContainers: + - name: wait-metastore-ready + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["timeout", "600", "sh", "-c"] + args: + - >- + untile nslookup release-name-pulsar-oxia-2.release-name-pulsar-oxia.pulsar; do + sleep 3; + done; + # This initContainer will wait for bookkeeper initnewcluster to complete + # before initializing pulsar metadata + - name: pulsar-bookkeeper-verify-clusterid + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + resources: + requests: + cpu: 0.1 + memory: 256Mi + command: ["timeout", "120", "sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/bookkeeper.conf; + echo Default BOOKIE_MEM settings are set very high, which can cause the init container to fail.; + echo Setting the memory to a lower value to avoid OOM as operations below are not memory intensive.; + export BOOKIE_MEM="-Xmx128M"; + + until timeout 15 bin/bookkeeper shell whatisinstanceid; do + sleep 3; + done; + envFrom: + - configMapRef: + name: "release-name-pulsar-bookie" + volumeMounts: + + containers: + - name: "release-name-pulsar-pulsar-init" + image: "apachepulsar/pulsar-all:4.0.0" + imagePullPolicy: "IfNotPresent" + command: ["timeout", "60", "sh", "-c"] + args: + - | + bin/pulsar initialize-cluster-metadata \ + --cluster release-name-pulsar \ + --metadata-store release-name-pulsar-oxia:\ + --configuration-store release-name-pulsar-zookeeper:2181 \ + --web-service-url http://release-name-pulsar-broker.pulsar.svc.cluster.local:8080/ \ + --web-service-url-tls https://release-name-pulsar-broker.pulsar.svc.cluster.local:8443/ \ + --broker-service-url pulsar://release-name-pulsar-broker.pulsar.svc.cluster.local:6650/ \ + --broker-service-url-tls pulsar+ssl://release-name-pulsar-broker.pulsar.svc.cluster.local:6651/ ; + volumeMounts: + + volumes: + + restartPolicy: OnFailure +--- +# Source: pulsar/templates/autorecovery-psp.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/bookkeeper-psp.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/bookkeeper-storageclass.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/broker-hpa.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/broker-psp.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/broker-rbac.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/check_helm_version.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/keytool.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# script to process key/cert to keystore and truststore +--- +# Source: pulsar/templates/namespace.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/oxia-coordinator-servicemonitor.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/oxia-server-servicemonitor.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-hpa.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-ingress.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-pdb.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-psp.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-service-account.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/proxy-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/pulsar-manager-admin-secret.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/pulsar-manager-cluster-initialize.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/pulsar-manager-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/pulsar-manager-ingress.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/pulsar-manager-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/pulsar-manager-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/tls-cert-internal-issuer.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/tls-certs-internal.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/toolset-psp.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/zookeeper-configmap.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy zookeeper only when `components.zookeeper` is true +--- +# Source: pulsar/templates/zookeeper-pdb.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy zookeeper only when `components.zookeeper` is true +--- +# Source: pulsar/templates/zookeeper-psp.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/zookeeper-service-account.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +--- +# Source: pulsar/templates/zookeeper-service.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy zookeeper only when `components.zookeeper` is true +--- +# Source: pulsar/templates/zookeeper-statefulset.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy zookeeper only when `components.zookeeper` is true +--- +# Source: pulsar/templates/zookeeper-storageclass.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy zookeeper only when `components.zookeeper` is true +--- +# Source: pulsar/templates/autorecovery-podmonitor.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy broker PodMonitor only when `$.Values.broker.podMonitor.enabled` is true +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: pulsar-recovery + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm +spec: + jobLabel: recovery + podMetricsEndpoints: + - port: http + path: /metrics + scheme: http + interval: 60s + scrapeTimeout: 60s + relabelings: + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: kubernetes_namespace + - sourceLabels: [__meta_kubernetes_pod_label_component] + action: replace + targetLabel: job + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: kubernetes_pod_name + selector: + matchLabels: + app: pulsar + release: release-name + component: recovery +--- +# Source: pulsar/templates/bookkeeper-podmonitor.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy bookkeeper PodMonitor only when `$.Values.bookkeeper.podMonitor.enabled` is true +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: release-name-pulsar-bookie + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm +spec: + jobLabel: bookie + podMetricsEndpoints: + - port: http + path: /metrics + scheme: http + interval: 60s + scrapeTimeout: 60s + relabelings: + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: kubernetes_namespace + - sourceLabels: [__meta_kubernetes_pod_label_component] + action: replace + targetLabel: job + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: kubernetes_pod_name + selector: + matchLabels: + app: pulsar + release: release-name + component: bookie +--- +# Source: pulsar/templates/broker-podmonitor.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy broker PodMonitor only when `$.Values.broker.podMonitor.enabled` is true +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: release-name-pulsar-broker + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm +spec: + jobLabel: broker + podMetricsEndpoints: + - port: http + path: /metrics + scheme: http + interval: 60s + scrapeTimeout: 60s + relabelings: + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: kubernetes_namespace + - sourceLabels: [__meta_kubernetes_pod_label_component] + action: replace + targetLabel: job + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: kubernetes_pod_name + selector: + matchLabels: + app: pulsar + release: release-name + component: broker +--- +# Source: pulsar/templates/proxy-podmonitor.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy proxy PodMonitor only when `$.Values.proxy.podMonitor.enabled` is true +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: release-name-pulsar-proxy + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm +spec: + jobLabel: proxy + podMetricsEndpoints: + - port: http + path: /metrics + scheme: http + interval: 60s + scrapeTimeout: 60s + relabelings: + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: kubernetes_namespace + - sourceLabels: [__meta_kubernetes_pod_label_component] + action: replace + targetLabel: job + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: kubernetes_pod_name + selector: + matchLabels: + app: pulsar + release: release-name + component: proxy +--- +# Source: pulsar/templates/zookeeper-podmonitor.yaml +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy zookeeper PodMonitor only when `$.Values.zookeeper.podMonitor.enabled` is true +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: release-name-pulsar-zookeeper + labels: + app: pulsar + chart: pulsar-3.7.0 + release: release-name + heritage: Helm +spec: + jobLabel: zookeeper + podMetricsEndpoints: + - port: http + path: /metrics + scheme: http + interval: 60s + scrapeTimeout: 60s + relabelings: + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: kubernetes_namespace + - sourceLabels: [__meta_kubernetes_pod_label_component] + action: replace + targetLabel: job + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: kubernetes_pod_name + selector: + matchLabels: + app: pulsar + release: release-name + component: zookeeper diff --git a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml index 77a93977..1eb1f255 100644 --- a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml @@ -24,7 +24,7 @@ kind: ServiceMonitor metadata: labels: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}"-coordinator + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} spec: endpoints: diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml index a2b6df45..31d774c6 100644 --- a/charts/pulsar/templates/oxia-server-service-public.yaml +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -22,9 +22,9 @@ apiVersion: v1 kind: Service metadata: labels: - oxia_cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} spec: ports: diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index 92a8bdd7..4a3ef992 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -21,9 +21,9 @@ apiVersion: v1 kind: Service metadata: labels: - oxia_cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc namespace: {{ template "pulsar.namespace" . }} spec: clusterIP: None diff --git a/charts/pulsar/templates/oxia-server-serviceaccount.yaml b/charts/pulsar/templates/oxia-server-serviceaccount.yaml index 876a3ef8..dba1b688 100644 --- a/charts/pulsar/templates/oxia-server-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-server-serviceaccount.yaml @@ -22,7 +22,7 @@ kind: ServiceAccount metadata: labels: {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} {{- if .Values.images.imagePullSecrets }} imagePullSecrets: diff --git a/charts/pulsar/templates/oxia-server-servicemonitor.yaml b/charts/pulsar/templates/oxia-server-servicemonitor.yaml index 8c653a29..69b4deb7 100644 --- a/charts/pulsar/templates/oxia-server-servicemonitor.yaml +++ b/charts/pulsar/templates/oxia-server-servicemonitor.yaml @@ -24,7 +24,7 @@ kind: ServiceMonitor metadata: labels: {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} spec: endpoints: diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index c5473cd7..9f58807d 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -23,7 +23,7 @@ kind: StatefulSet metadata: labels: {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} spec: replicas: {{ .Values.oxia.server.replicas }} @@ -38,11 +38,11 @@ spec: prometheus.io/port: "{{ .Values.oxia.server.ports.metrics }}" prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}" labels: - oxia_cluster: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.server.labels" . | nindent 8 }} name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" spec: - serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} containers: - command: - "oxia" From 5f6fcd3a0daf074efff51d4e6150cacf3413a3fe Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Tue, 12 Nov 2024 18:48:42 -0600 Subject: [PATCH 11/67] remove outputfile --- charts/pulsar/output.yml | 2913 -------------------------------------- 1 file changed, 2913 deletions(-) delete mode 100644 charts/pulsar/output.yml diff --git a/charts/pulsar/output.yml b/charts/pulsar/output.yml deleted file mode 100644 index 568f5fad..00000000 --- a/charts/pulsar/output.yml +++ /dev/null @@ -1,2913 +0,0 @@ ---- -# Source: pulsar/templates/bookkeeper-pdb.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# pdb version detection -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: "release-name-pulsar-bookie" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: bookie -spec: - selector: - matchLabels: - app: pulsar - release: release-name - component: bookie - maxUnavailable: 1 ---- -# Source: pulsar/templates/broker-pdb.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# pdb version detection -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: "release-name-pulsar-broker" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: broker -spec: - selector: - matchLabels: - app: pulsar - release: release-name - component: broker - maxUnavailable: 1 ---- -# Source: pulsar/templates/autorecovery-service-account.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ServiceAccount -metadata: - name: "release-name-pulsar-recovery" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: recovery - annotations: ---- -# Source: pulsar/templates/bookkeeper-service-account.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ServiceAccount -metadata: - name: "release-name-pulsar-bookie" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: bookie - annotations: ---- -# Source: pulsar/templates/broker-service-account.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ServiceAccount -metadata: - name: "release-name-pulsar-broker-acct" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: broker - annotations: ---- -# Source: pulsar/templates/oxia-coordinator-serviceaccount.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/part-of: oxia - app.kubernetes.io/managed-by: Helm - name: release-name-pulsar-oxia-coordinator - namespace: pulsar ---- -# Source: pulsar/templates/oxia-server-serviceaccount.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/managed-by: Helm - name: "release-name-pulsar-oxia" - namespace: pulsar ---- -# Source: pulsar/templates/toolset-service-account.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ServiceAccount -metadata: - name: "release-name-pulsar-toolset" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: toolset - annotations: ---- -# Source: pulsar/templates/autorecovery-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ConfigMap -metadata: - name: "release-name-pulsar-recovery" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: recovery -data: - # common config - zkServers: "release-name-pulsar-zookeeper:2181" - zkLedgersRootPath: "/ledgers" - # enable bookkeeper http server - httpServerEnabled: "true" - httpServerPort: "8000" - # config the stats provider - statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider - # use hostname as the bookie id - useHostNameAsBookieID: "true" - BOOKIE_MEM: | - -Xms64m -Xmx64m - PULSAR_PREFIX_useV2WireProtocol: "true" ---- -# Source: pulsar/templates/bookkeeper-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ConfigMap -metadata: - name: "release-name-pulsar-bookie" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: bookie -data: - # common config - zkServers: "release-name-pulsar-zookeeper:2181" - zkLedgersRootPath: "/ledgers" - # enable bookkeeper http server - httpServerEnabled: "true" - httpServerPort: "8000" - # config the stats provider - statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider - # use hostname as the bookie id - useHostNameAsBookieID: "true" - # disable auto recovery on bookies since we will start AutoRecovery in separated pods - autoRecoveryDaemonEnabled: "false" - # Do not retain journal files as it increase the disk utilization - journalMaxBackups: "0" - journalDirectories: "/pulsar/data/bookkeeper/journal" - PULSAR_PREFIX_journalDirectories: "/pulsar/data/bookkeeper/journal" - ledgerDirectories: "/pulsar/data/bookkeeper/ledgers" - # TLS config - - PULSAR_GC: | - -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem - PULSAR_MEM: | - -Xms128m -Xmx256m -XX:MaxDirectMemorySize=256m - diskCheckInterval: "1800" - diskUsageLwmThreshold: "0.85" - diskUsageThreshold: "0.95" - diskUsageWarnThreshold: "0.9" - gcWaitTime: "300000" - isForceGCAllowWhenNoSpace: "true" - majorCompactionInterval: "10800" - majorCompactionThreshold: "0.8" - minorCompactionInterval: "360" - minorCompactionThreshold: "0.2" ---- -# Source: pulsar/templates/broker-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ConfigMap -metadata: - name: "release-name-pulsar-broker" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: broker -data: - # Metadata settings - zookeeperServers: "release-name-pulsar-zookeeper:2181" - configurationStoreServers: "release-name-pulsar-zookeeper:2181" - - # Broker settings - clusterName: release-name-pulsar - exposeTopicLevelMetricsInPrometheus: "true" - numHttpServerThreads: "8" - zooKeeperSessionTimeoutMillis: "30000" - statusFilePath: "/pulsar/logs/status" - - # Tiered storage settings - - # Function Worker Settings - # function worker configuration - functionsWorkerEnabled: "false" - - # prometheus needs to access /metrics endpoint - webServicePort: "8080" - brokerServicePort: "6650" - - # Authentication Settings - PULSAR_GC: | - -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem - PULSAR_MEM: | - -Xms128m -Xmx256m -XX:MaxDirectMemorySize=256m - managedLedgerDefaultAckQuorum: "1" - managedLedgerDefaultEnsembleSize: "1" - managedLedgerDefaultWriteQuorum: "1" ---- -# Source: pulsar/templates/oxia-coordinator-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/part-of: oxia - app.kubernetes.io/managed-by: Helm - name: release-name-pulsar-oxia-coordinator - namespace: pulsar -data: - config.yaml: | - namespaces: - - name: "release-name-pulsar-oxia" - initialShardCount: 3 - replicationFactor: 3 - servers: - - public: release-name-pulsar-oxia-svc.pulsar.svc.cluster.local:6648 - internal: release-name-pulsar-oxia-svc.pulsar.svc:6649 ---- -# Source: pulsar/templates/toolset-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: ConfigMap -metadata: - name: "release-name-pulsar-toolset" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: toolset -data: - BOOKIE_LOG_APPENDER: "RollingFile" - zkServers: "release-name-pulsar-zookeeper:2181" - zkLedgersRootPath: "/ledgers" - # enable bookkeeper http server - httpServerEnabled: "true" - httpServerPort: "8000" - # config the stats provider - statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider - # use hostname as the bookie id - useHostNameAsBookieID: "true" - # talk to proxy - webServiceUrl: "http://release-name-pulsar-proxy:80/" - brokerServiceUrl: "pulsar://release-name-pulsar-proxy:6650/" - # Authentication Settings - PULSAR_MEM: | - -Xms64M -Xmx128M -XX:MaxDirectMemorySize=128M ---- -# Source: pulsar/templates/broker-cluster-role-binding.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: "release-name-pulsar-broker-role" - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar -rules: -- apiGroups: [""] - resources: - - configmaps - verbs: ["get", "list", "watch"] -- apiGroups: [""] - resources: - - pods - - services - - secrets - verbs: - - list - - watch - - get - - update - - create - - delete - - patch -- apiGroups: ["apps"] - resources: - - deployments - - statefulsets - verbs: - - list - - watch - - get - - update - - create - - delete - - patch ---- -# Source: pulsar/templates/oxia-coordinator-role.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/part-of: oxia - app.kubernetes.io/managed-by: Helm - name: release-name-pulsar-oxia-coordinator - namespace: pulsar -rules: - - apiGroups: [ "" ] - resources: [ "configmaps" ] - verbs: [ "*" ] - - apiGroups: [ "oxia.streamnative.io" ] - resources: [ "oxiaclusters" ] - verbs: [ "get", "update" ] ---- -# Source: pulsar/templates/broker-cluster-role-binding.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -## TODO create our own cluster role with less privledges than admin -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: "release-name-pulsar-broker-rolebinding" - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: "release-name-pulsar-broker-role" -subjects: -- kind: ServiceAccount - name: "release-name-pulsar-broker-acct" - namespace: pulsar ---- -# Source: pulsar/templates/oxia-coordinator-rolebinding.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/part-of: oxia - app.kubernetes.io/managed-by: Helm - name: release-name-pulsar-oxia-coordinator - namespace: pulsar -subjects: - - kind: ServiceAccount - name: release-name-pulsar-oxia-coordinator - namespace: pulsar -roleRef: - apiGroup: "" - kind: Role - name: release-name-pulsar-oxia-coordinator ---- -# Source: pulsar/templates/autorecovery-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: Service -metadata: - name: "release-name-pulsar-recovery" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: recovery -spec: - ports: - - name: http - port: 8000 - clusterIP: None - selector: - app: pulsar - release: release-name - component: recovery ---- -# Source: pulsar/templates/bookkeeper-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: Service -metadata: - name: "release-name-pulsar-bookie" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: bookie -spec: - ports: - - name: "bookie" - port: 3181 - - name: http - port: 8000 - clusterIP: None - selector: - app: pulsar - release: release-name - component: bookie - publishNotReadyAddresses: true ---- -# Source: pulsar/templates/broker-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: Service -metadata: - name: "release-name-pulsar-broker" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: broker - annotations: - {} -spec: - type: ClusterIP - ports: - # prometheus needs to access /metrics endpoint - - name: http - port: 8080 - - name: "pulsar" - port: 6650 - clusterIP: "None" - selector: - app: pulsar - release: release-name - component: broker ---- -# Source: pulsar/templates/oxia-coordinator-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: Service -metadata: - labels: - oxia_cluster: release-name-pulsar-oxia - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/part-of: oxia - app.kubernetes.io/managed-by: Helm - name: release-name-pulsar-oxia-coordinator - namespace: pulsar -spec: - ports: - - name: internal - port: 6649 - targetPort: internal - - name: metrics - port: 8080 - targetPort: metrics - selector: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name ---- -# Source: pulsar/templates/oxia-server-service-public.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: Service -metadata: - labels: - oxia_cluster: "release-name-pulsar-oxia" - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/managed-by: Helm - name: "release-name-pulsar-oxia" - namespace: pulsar -spec: - ports: - - name: internal - port: 6649 - targetPort: internal - - name: metrics - port: 8080 - targetPort: metrics - - name: public - port: 6648 - targetPort: public - selector: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name ---- -# Source: pulsar/templates/oxia-server-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: Service -metadata: - labels: - oxia_cluster: "release-name-pulsar-oxia" - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/managed-by: Helm - name: "release-name-pulsar-oxia" - namespace: pulsar -spec: - clusterIP: None - publishNotReadyAddresses: true - ports: - - name: internal - port: 6649 - targetPort: internal - - name: metrics - port: 8080 - targetPort: metrics - - name: public - port: 6648 - targetPort: public - selector: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name ---- -# Source: pulsar/templates/toolset-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: v1 -kind: Service -metadata: - name: "release-name-pulsar-toolset" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: toolset -spec: - clusterIP: None - selector: - app: pulsar - release: release-name - component: toolset ---- -# Source: pulsar/templates/oxia-coordinator-deployment.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/part-of: oxia - app.kubernetes.io/managed-by: Helm - name: release-name-pulsar-oxia-coordinator - namespace: pulsar -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - strategy: - type: Recreate - template: - metadata: - annotations: - prometheus.io/port: "8080" - prometheus.io/scrape: "false" - labels: - oxia_cluster: release-name-pulsar-oxia - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: coordinator - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/part-of: oxia - app.kubernetes.io/managed-by: Helm - name: release-name-pulsar-oxia-coordinator - spec: - serviceAccountName: release-name-pulsar-oxia-coordinator - containers: - - command: - - "oxia" - - "coordinator" - - "--conf=configmap:pulsar/release-name-pulsar-oxia-coordinator" - - "--log-json" - - "--metadata=configmap" - - "--k8s-namespace=pulsar" - - "--k8s-configmap-name=release-name-pulsar-oxia-coordinator-status" - image: "streamnative/oxia:0.11.3" - imagePullPolicy: Always - name: coordinator - ports: - - containerPort: 6649 - name: internal - - containerPort: 8080 - name: metrics - resources: - limits: - cpu: 100m - memory: 128Mi - livenessProbe: - exec: - command: ["oxia", "health", "--port=6649"] - initialDelaySeconds: 10 - timeoutSeconds: 10 - readinessProbe: - exec: - command: ["oxia", "health", "--port=6649"] - initialDelaySeconds: 10 - timeoutSeconds: 10 ---- -# Source: pulsar/templates/autorecovery-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: "release-name-pulsar-recovery" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: recovery -spec: - serviceName: "release-name-pulsar-recovery" - replicas: 1 - updateStrategy: - type: RollingUpdate - podManagementPolicy: Parallel - # nodeSelector: - selector: - matchLabels: - app: pulsar - release: release-name - component: recovery - template: - metadata: - labels: - app: pulsar - release: release-name - cluster: release-name-pulsar - component: recovery - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "8000" - spec: - affinity: - podAntiAffinity: - - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: "app" - operator: In - values: - - "pulsar" - - key: "release" - operator: In - values: - - release-name - - key: "component" - operator: In - values: - - recovery - topologyKey: kubernetes.io/hostname - - terminationGracePeriodSeconds: 30 - serviceAccountName: "release-name-pulsar-recovery" - initContainers: - # This initContainer will wait for bookkeeper initnewcluster to complete - # before deploying the bookies - - name: pulsar-bookkeeper-verify-clusterid - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["timeout", "120", "sh", "-c"] - args: - - > - bin/apply-config-from-env.py conf/bookkeeper.conf;until timeout 15 bin/bookkeeper shell whatisinstanceid; do - sleep 3; - done; - envFrom: - - configMapRef: - name: "release-name-pulsar-recovery" - volumeMounts: - - containers: - - name: "release-name-pulsar-recovery" - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.05 - memory: 64Mi - command: ["sh", "-c"] - args: - - > - bin/apply-config-from-env.py conf/bookkeeper.conf; - - OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/bookkeeper autorecovery - ports: - - name: http - containerPort: 8000 - envFrom: - - configMapRef: - name: "release-name-pulsar-recovery" - volumeMounts: - - volumes: ---- -# Source: pulsar/templates/bookkeeper-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: "release-name-pulsar-bookie" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: bookie -spec: - serviceName: "release-name-pulsar-bookie" - replicas: 4 - selector: - matchLabels: - app: pulsar - release: release-name - component: bookie - updateStrategy: - type: RollingUpdate - podManagementPolicy: Parallel - template: - metadata: - labels: - app: pulsar - release: release-name - cluster: release-name-pulsar - component: bookie - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "8000" - spec: - affinity: - podAntiAffinity: - - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: "app" - operator: In - values: - - "pulsar" - - key: "release" - operator: In - values: - - release-name - - key: "component" - operator: In - values: - - bookie - topologyKey: kubernetes.io/hostname - - terminationGracePeriodSeconds: 30 - serviceAccountName: "release-name-pulsar-bookie" - securityContext: - fsGroup: 0 - fsGroupChangePolicy: OnRootMismatch - initContainers: - # This initContainer will wait for bookkeeper initnewcluster to complete - # before deploying the bookies - - name: pulsar-bookkeeper-verify-clusterid - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["timeout", "600", "sh", "-c"] - args: - # only reformat bookie if bookkeeper is running without persistence - - > - - set -e; - bin/apply-config-from-env.py conf/bookkeeper.conf;until timeout 15 bin/bookkeeper shell whatisinstanceid; do - sleep 3; - done; - envFrom: - - configMapRef: - name: "release-name-pulsar-bookie" - volumeMounts: - - containers: - - name: "release-name-pulsar-bookie" - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - livenessProbe: - httpGet: - path: /api/v1/bookie/state - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 60 - readinessProbe: - httpGet: - path: /api/v1/bookie/is_ready - port: 8000 - initialDelaySeconds: 10 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 60 - resources: - requests: - cpu: 0.2 - memory: 512Mi - command: ["sh", "-c"] - args: - - > - bin/apply-config-from-env.py conf/bookkeeper.conf; - - OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/pulsar bookie; - ports: - - name: "bookie" - containerPort: 3181 - - name: http - containerPort: 8000 - envFrom: - - configMapRef: - name: "release-name-pulsar-bookie" - volumeMounts: - - name: "release-name-pulsar-bookie-journal" - mountPath: /pulsar/data/bookkeeper/journal - - name: "release-name-pulsar-bookie-ledgers" - mountPath: /pulsar/data/bookkeeper/ledgers - - volumes: - - - volumeClaimTemplates: - - metadata: - name: "release-name-pulsar-bookie-journal" - spec: - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 10Gi - storageClassName: "rook-ceph-block" - - metadata: - name: "release-name-pulsar-bookie-ledgers" - spec: - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 50Gi ---- -# Source: pulsar/templates/broker-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: "release-name-pulsar-broker" - namespace: "pulsar" - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: broker -spec: - serviceName: "release-name-pulsar-broker" - replicas: 3 - selector: - matchLabels: - app: pulsar - release: release-name - component: broker - updateStrategy: - type: RollingUpdate - podManagementPolicy: Parallel - template: - metadata: - labels: - app: pulsar - release: release-name - cluster: release-name-pulsar - component: broker - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "8080" - spec: - serviceAccountName: "release-name-pulsar-broker-acct" - affinity: - podAntiAffinity: - - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: "app" - operator: In - values: - - "pulsar" - - key: "release" - operator: In - values: - - release-name - - key: "component" - operator: In - values: - - broker - topologyKey: kubernetes.io/hostname - - terminationGracePeriodSeconds: 30 - initContainers: - # This init container will wait for zookeeper to be ready before - # deploying the bookies - - name: wait-zookeeper-ready - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["timeout", "600", "sh", "-c"] - args: - - >- - - export BOOKIE_MEM="-Xmx128M"; - until timeout 15 bin/pulsar zookeeper-shell -server release-name-pulsar-zookeeper:2181 get /admin/clusters/release-name-pulsar; do - echo "pulsar cluster release-name-pulsar isn't initialized yet ... check in 3 seconds ..." && sleep 3; - done; - volumeMounts: - - # This init container will wait for bookkeeper to be ready before - # deploying the broker - - name: wait-bookkeeper-ready - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["timeout", "120", "sh", "-c"] - args: - - > - - bin/apply-config-from-env.py conf/bookkeeper.conf; - export BOOKIE_MEM="-Xmx128M"; - until timeout 15 bin/bookkeeper shell whatisinstanceid; do - echo "bookkeeper cluster is not initialized yet. backoff for 3 seconds ..."; - sleep 3; - done; - echo "bookkeeper cluster is already initialized"; - bookieServiceNumber="$(nslookup -timeout=10 release-name-pulsar-bookie | grep Name | wc -l)"; - until [ ${bookieServiceNumber} -ge 1 ]; do - echo "bookkeeper cluster release-name-pulsar isn't ready yet ... check in 10 seconds ..."; - sleep 10; - bookieServiceNumber="$(nslookup -timeout=10 release-name-pulsar-bookie | grep Name | wc -l)"; - done; - echo "bookkeeper cluster is ready"; - envFrom: - - configMapRef: - name: "release-name-pulsar-bookie" - volumeMounts: - - containers: - - name: "release-name-pulsar-broker" - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - livenessProbe: - httpGet: - path: /status.html - port: 8080 - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 10 - readinessProbe: - httpGet: - path: /status.html - port: 8080 - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 10 - resources: - requests: - cpu: 0.2 - memory: 512Mi - command: ["sh", "-c"] - args: - - > - bin/apply-config-from-env.py conf/broker.conf; - bin/gen-yml-from-env.py conf/functions_worker.yml; - echo "OK" > "${statusFilePath:-status}"; - - timeout 15 bin/pulsar zookeeper-shell -server release-name-pulsar-zookeeper:2181 get /loadbalance/brokers/${HOSTNAME}.release-name-pulsar-broker.pulsar.svc.cluster.local:8080; - while [ $? -eq 0 ]; do - echo "broker ${HOSTNAME}.release-name-pulsar-broker.pulsar.svc.cluster.local znode still exists ... check in 10 seconds ..."; - sleep 10; - timeout 15 bin/pulsar zookeeper-shell -server release-name-pulsar-zookeeper:2181 get /loadbalance/brokers/${HOSTNAME}.release-name-pulsar-broker.pulsar.svc.cluster.local:8080; - done; - cat conf/pulsar_env.sh; - OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/pulsar broker; - ports: - # prometheus needs to access /metrics endpoint - - name: http - containerPort: 8080 - - name: "pulsar" - containerPort: 6650 - envFrom: - - configMapRef: - name: "release-name-pulsar-broker" - volumeMounts: - - env: - volumes: ---- -# Source: pulsar/templates/oxia-server-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: apps/v1 -kind: StatefulSet -metadata: - labels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/managed-by: Helm - name: "release-name-pulsar-oxia" - namespace: pulsar -spec: - replicas: 3 - selector: - matchLabels: - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name - serviceName: release-name-pulsar-oxia-svc - podManagementPolicy: Parallel - template: - metadata: - annotations: - prometheus.io/port: "8080" - prometheus.io/scrape: "false" - labels: - oxia_cluster: "release-name-pulsar-oxia" - app.kubernetes.io/name: pulsar - app.kubernetes.io/component: server - app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "4.0.0" - app.kubernetes.io/managed-by: Helm - name: "release-name-pulsar-oxia" - spec: - serviceAccountName: "release-name-pulsar-oxia" - containers: - - command: - - "oxia" - - "server" - - "--log-json" - - "--data-dir=/data/db" - - "--wal-dir=/data/wal" - - "--db-cache-size-mb=512" - image: "streamnative/oxia:0.11.3" - imagePullPolicy: Always - name: server - ports: - - containerPort: 6649 - name: internal - - containerPort: 8080 - name: metrics - - containerPort: 6648 - name: public - resources: - limits: - cpu: 1 - memory: 1Gi - volumeMounts: - - name: data - mountPath: /data - livenessProbe: - exec: - command: ["oxia", "health", "--port=6649"] - initialDelaySeconds: 10 - timeoutSeconds: 10 - readinessProbe: - exec: - command: ["oxia", "health", "--port=6649", "--service=oxia-readiness"] - initialDelaySeconds: 10 - timeoutSeconds: 10 - startupProbe: - exec: - command: ["oxia", "health", "--port=6649"] - initialDelaySeconds: 60 - timeoutSeconds: 10 - volumeClaimTemplates: - - metadata: - name: release-name-pulsar-oxia-data - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: rook-ceph-block - resources: - requests: - storage: 8Gi ---- -# Source: pulsar/templates/toolset-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: "release-name-pulsar-toolset" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: toolset -spec: - serviceName: "release-name-pulsar-toolset" - replicas: 1 - updateStrategy: - type: RollingUpdate - podManagementPolicy: Parallel - selector: - matchLabels: - app: pulsar - release: release-name - component: toolset - template: - metadata: - labels: - app: pulsar - release: release-name - cluster: release-name-pulsar - component: toolset - annotations: - spec: - terminationGracePeriodSeconds: 30 - serviceAccountName: "release-name-pulsar-toolset" - containers: - - name: "release-name-pulsar-toolset" - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["sh", "-c"] - args: - - > - bin/apply-config-from-env.py conf/client.conf; - bin/apply-config-from-env.py conf/bookkeeper.conf; - - sleep 10000000000 - envFrom: - - configMapRef: - name: "release-name-pulsar-toolset" - volumeMounts: - - volumes: ---- -# Source: pulsar/templates/bookkeeper-cluster-initialize.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: batch/v1 -kind: Job -metadata: - name: "release-name-pulsar-bookie-init" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: "bookie-init" -spec: -# This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond -# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ - template: - spec: - - serviceAccountName: "release-name-pulsar-bookie" - nodeSelector: - tolerations: - initContainers: - - name: wait-zookeeper-ready - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["timeout", "600", "sh", "-c"] - args: - - >- - until nslookup release-name-pulsar-zookeeper-2.release-name-pulsar-zookeeper.pulsar; do - sleep 3; - done; - containers: - - name: "release-name-pulsar-bookie-init" - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - command: ["timeout", "60", "sh", "-c"] - args: - - > - bin/apply-config-from-env.py conf/bookkeeper.conf; - - export BOOKIE_MEM="-Xmx128M"; - if timeout 15 bin/bookkeeper shell whatisinstanceid; then - echo "bookkeeper cluster already initialized"; - else - bin/bookkeeper shell initnewcluster; - fi - envFrom: - - configMapRef: - name: "release-name-pulsar-bookie" - volumeMounts: - - volumes: - - restartPolicy: OnFailure ---- -# Source: pulsar/templates/pulsar-cluster-initialize.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -apiVersion: batch/v1 -kind: Job -metadata: - name: "release-name-pulsar-pulsar-init" - namespace: pulsar - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm - cluster: release-name-pulsar - component: pulsar-init -spec: -# This feature was previously behind a feature gate for several Kubernetes versions and will default to true in 1.23 and beyond -# https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/ - template: - spec: - - initContainers: - - name: wait-metastore-ready - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["timeout", "600", "sh", "-c"] - args: - - >- - untile nslookup release-name-pulsar-oxia-2.release-name-pulsar-oxia.pulsar; do - sleep 3; - done; - # This initContainer will wait for bookkeeper initnewcluster to complete - # before initializing pulsar metadata - - name: pulsar-bookkeeper-verify-clusterid - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - resources: - requests: - cpu: 0.1 - memory: 256Mi - command: ["timeout", "120", "sh", "-c"] - args: - - > - bin/apply-config-from-env.py conf/bookkeeper.conf; - echo Default BOOKIE_MEM settings are set very high, which can cause the init container to fail.; - echo Setting the memory to a lower value to avoid OOM as operations below are not memory intensive.; - export BOOKIE_MEM="-Xmx128M"; - - until timeout 15 bin/bookkeeper shell whatisinstanceid; do - sleep 3; - done; - envFrom: - - configMapRef: - name: "release-name-pulsar-bookie" - volumeMounts: - - containers: - - name: "release-name-pulsar-pulsar-init" - image: "apachepulsar/pulsar-all:4.0.0" - imagePullPolicy: "IfNotPresent" - command: ["timeout", "60", "sh", "-c"] - args: - - | - bin/pulsar initialize-cluster-metadata \ - --cluster release-name-pulsar \ - --metadata-store release-name-pulsar-oxia:\ - --configuration-store release-name-pulsar-zookeeper:2181 \ - --web-service-url http://release-name-pulsar-broker.pulsar.svc.cluster.local:8080/ \ - --web-service-url-tls https://release-name-pulsar-broker.pulsar.svc.cluster.local:8443/ \ - --broker-service-url pulsar://release-name-pulsar-broker.pulsar.svc.cluster.local:6650/ \ - --broker-service-url-tls pulsar+ssl://release-name-pulsar-broker.pulsar.svc.cluster.local:6651/ ; - volumeMounts: - - volumes: - - restartPolicy: OnFailure ---- -# Source: pulsar/templates/autorecovery-psp.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/bookkeeper-psp.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/bookkeeper-storageclass.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/broker-hpa.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/broker-psp.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/broker-rbac.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/check_helm_version.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/keytool.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# script to process key/cert to keystore and truststore ---- -# Source: pulsar/templates/namespace.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/oxia-coordinator-servicemonitor.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/oxia-server-servicemonitor.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-hpa.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-ingress.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-pdb.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-psp.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-service-account.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/proxy-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/pulsar-manager-admin-secret.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/pulsar-manager-cluster-initialize.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/pulsar-manager-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/pulsar-manager-ingress.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/pulsar-manager-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/pulsar-manager-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/tls-cert-internal-issuer.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/tls-certs-internal.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/toolset-psp.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/zookeeper-configmap.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy zookeeper only when `components.zookeeper` is true ---- -# Source: pulsar/templates/zookeeper-pdb.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy zookeeper only when `components.zookeeper` is true ---- -# Source: pulsar/templates/zookeeper-psp.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/zookeeper-service-account.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---- -# Source: pulsar/templates/zookeeper-service.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy zookeeper only when `components.zookeeper` is true ---- -# Source: pulsar/templates/zookeeper-statefulset.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy zookeeper only when `components.zookeeper` is true ---- -# Source: pulsar/templates/zookeeper-storageclass.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy zookeeper only when `components.zookeeper` is true ---- -# Source: pulsar/templates/autorecovery-podmonitor.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy broker PodMonitor only when `$.Values.broker.podMonitor.enabled` is true -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: pulsar-recovery - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm -spec: - jobLabel: recovery - podMetricsEndpoints: - - port: http - path: /metrics - scheme: http - interval: 60s - scrapeTimeout: 60s - relabelings: - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - sourceLabels: [__meta_kubernetes_namespace] - action: replace - targetLabel: kubernetes_namespace - - sourceLabels: [__meta_kubernetes_pod_label_component] - action: replace - targetLabel: job - - sourceLabels: [__meta_kubernetes_pod_name] - action: replace - targetLabel: kubernetes_pod_name - selector: - matchLabels: - app: pulsar - release: release-name - component: recovery ---- -# Source: pulsar/templates/bookkeeper-podmonitor.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy bookkeeper PodMonitor only when `$.Values.bookkeeper.podMonitor.enabled` is true -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: release-name-pulsar-bookie - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm -spec: - jobLabel: bookie - podMetricsEndpoints: - - port: http - path: /metrics - scheme: http - interval: 60s - scrapeTimeout: 60s - relabelings: - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - sourceLabels: [__meta_kubernetes_namespace] - action: replace - targetLabel: kubernetes_namespace - - sourceLabels: [__meta_kubernetes_pod_label_component] - action: replace - targetLabel: job - - sourceLabels: [__meta_kubernetes_pod_name] - action: replace - targetLabel: kubernetes_pod_name - selector: - matchLabels: - app: pulsar - release: release-name - component: bookie ---- -# Source: pulsar/templates/broker-podmonitor.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy broker PodMonitor only when `$.Values.broker.podMonitor.enabled` is true -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: release-name-pulsar-broker - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm -spec: - jobLabel: broker - podMetricsEndpoints: - - port: http - path: /metrics - scheme: http - interval: 60s - scrapeTimeout: 60s - relabelings: - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - sourceLabels: [__meta_kubernetes_namespace] - action: replace - targetLabel: kubernetes_namespace - - sourceLabels: [__meta_kubernetes_pod_label_component] - action: replace - targetLabel: job - - sourceLabels: [__meta_kubernetes_pod_name] - action: replace - targetLabel: kubernetes_pod_name - selector: - matchLabels: - app: pulsar - release: release-name - component: broker ---- -# Source: pulsar/templates/proxy-podmonitor.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy proxy PodMonitor only when `$.Values.proxy.podMonitor.enabled` is true -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: release-name-pulsar-proxy - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm -spec: - jobLabel: proxy - podMetricsEndpoints: - - port: http - path: /metrics - scheme: http - interval: 60s - scrapeTimeout: 60s - relabelings: - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - sourceLabels: [__meta_kubernetes_namespace] - action: replace - targetLabel: kubernetes_namespace - - sourceLabels: [__meta_kubernetes_pod_label_component] - action: replace - targetLabel: job - - sourceLabels: [__meta_kubernetes_pod_name] - action: replace - targetLabel: kubernetes_pod_name - selector: - matchLabels: - app: pulsar - release: release-name - component: proxy ---- -# Source: pulsar/templates/zookeeper-podmonitor.yaml -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# deploy zookeeper PodMonitor only when `$.Values.zookeeper.podMonitor.enabled` is true -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: release-name-pulsar-zookeeper - labels: - app: pulsar - chart: pulsar-3.7.0 - release: release-name - heritage: Helm -spec: - jobLabel: zookeeper - podMetricsEndpoints: - - port: http - path: /metrics - scheme: http - interval: 60s - scrapeTimeout: 60s - relabelings: - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - sourceLabels: [__meta_kubernetes_namespace] - action: replace - targetLabel: kubernetes_namespace - - sourceLabels: [__meta_kubernetes_pod_label_component] - action: replace - targetLabel: job - - sourceLabels: [__meta_kubernetes_pod_name] - action: replace - targetLabel: kubernetes_pod_name - selector: - matchLabels: - app: pulsar - release: release-name - component: zookeeper From 8c091091f852a087d0579b46b12c74bc7159a2a0 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Tue, 12 Nov 2024 20:13:01 -0600 Subject: [PATCH 12/67] fix init container --- charts/pulsar/templates/_oxia.tpl | 13 +++---------- .../pulsar/templates/pulsar-cluster-initialize.yaml | 6 +++--- charts/pulsar/values.yaml | 3 ++- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index a12ab30c..8f0ac151 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -89,22 +89,15 @@ timeoutSeconds: 10 Define the pulsar oxia */}} {{- define "pulsar.oxia.server.service" -}} -{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} +{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc {{- end }} {{/* Define the pulsar oxia */}} {{- define "pulsar.oxia.connect" -}} -{{$oxia:=.Values.pulsar_metadata.userProvidedOxia}} -{{- if and (not .Values.components.zookeeper) $oxia }} -{{- $oxia -}} -{{ else }} -{{- if not (and .Values.tls.enabled .Values.tls.oxia.enabled) -}} -{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.client }} -{{- end -}} -{{- if and .Values.tls.enabled .Values.tls.oxia.enabled -}} -{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.clientTls }} +{{- if and (not .Values.components.zookeeper) .Values.components.oxia }} +oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }}/ {{- end -}} {{- end -}} {{- end -}} diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index b5a0cf0a..19b8a746 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -22,7 +22,7 @@ apiVersion: batch/v1 kind: Job metadata: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_metadata.component }}" + name: {{ template "pulsar.fullname" . }}-{{ .Values.pulsar_metadata.component }} namespace: {{ template "pulsar.namespace" . }} labels: {{- include "pulsar.standardLabels" . | nindent 4 }} @@ -58,7 +58,7 @@ spec: image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }}" resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} - command: ["timeout", "{{ .Values.pulsar_metadata.waitZookeeperTimeout }}", "sh", "-c"] + command: ["timeout", "{{ .Values.pulsar_metadata.waitMetadataTimeout }}", "sh", "-c"] args: - >- {{- if $zk:=.Values.pulsar_metadata.userProvidedZookeepers }} @@ -136,7 +136,7 @@ spec: {{- if .Values.pulsar_metadata.configurationStore }} --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ {{- else }} - --configuration-store {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ + --configuration-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ {{- end }} --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 547e5b40..1989b1b0 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -576,6 +576,7 @@ bookkeeper: gracePeriod: 30 ## Timeout for waiting for bookkeeper cluster metadata to be initialized before starting a bookie waitMetadataTimeout: 600 + waitZookeeperTimeout: 600 resources: requests: memory: 512Mi @@ -804,7 +805,7 @@ pulsar_metadata: # default: zk port. avaiable: zk 2181, oxia 6648 configurationStorePort: 2181 ## Timeout for waiting for zookeeper or oxia to become available before running metadata initialization - waitZookeeperTimeout: 600 + waitMetadataTimeout: 600 ## Timeout for waiting for bookkeeper to be initialized before running metadata initialization waitBookkeeperTimeout: 120 ## Timeout for running metadata initialization From 3b3280e29e07d2a590051b6cb7773b27cf0e8404 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Wed, 13 Nov 2024 20:57:52 -0600 Subject: [PATCH 13/67] fixing init job --- .gitignore | 5 +- charts/pulsar/templates/_oxia.tpl | 5 +- .../templates/pulsar-cluster-initialize.yaml | 90 +++++++++---------- 3 files changed, 51 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index 01bedb2a..5b1d59bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Intellij .idea +.gitignore + # Mac **/.DS_Store @@ -21,4 +23,5 @@ pulsarctl-*-*.tar.gz pulsarctl-*-*/ #test.yaml -charts/pulsar/test-values.yaml \ No newline at end of file +charts/pulsar/test-values.yaml +charts/pulsar/test1.yaml \ No newline at end of file diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 8f0ac151..be3352d5 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -32,7 +32,7 @@ Coordinator selector labels */}} {{- define "oxia-cluster.coordinator.selectorLabels" -}} app.kubernetes.io/name: {{ .Chart.Name }} -app.kubernetes.io/component: coordinator +app.kubernetes.io/component: oxia-coordinator app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} @@ -50,7 +50,7 @@ Server selector labels */}} {{- define "oxia-cluster.server.selectorLabels" -}} app.kubernetes.io/name: {{ .Chart.Name }} -app.kubernetes.io/component: server +app.kubernetes.io/component: oxia-server app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} @@ -100,7 +100,6 @@ Define the pulsar oxia oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }}/ {{- end -}} {{- end -}} -{{- end -}} {{/* Define coordinator configmap diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 19b8a746..fe92abcd 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -61,7 +61,7 @@ spec: command: ["timeout", "{{ .Values.pulsar_metadata.waitMetadataTimeout }}", "sh", "-c"] args: - >- - {{- if $zk:=.Values.pulsar_metadata.userProvidedZookeepers }} + {{- if $zk :=.Values.pulsar_metadata.userProvidedZookeepers }} export PULSAR_MEM="-Xmx128M"; until timeout 15 bin/pulsar zookeeper-shell -server {{ $zk }} ls {{ or .Values.metadataPrefix "/" }}; do echo "user provided zookeepers {{ $zk }} are unreachable... check in 3 seconds ..." && sleep 3; @@ -71,82 +71,82 @@ spec: sleep 3; done; {{ else }} - untile nslookup {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-{{ add (.Values.oxia.server.replicas | int) -1}}.{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}.{{template "pulsar.namespace" . }}; do + until nslookup {{- include "pulsar.oxia.server.service" . }}; do sleep 3; done; - {{- end}} + {{- end }} {{- end }} - {{- if and .Values.pulsar_metadata.waitBookkeeperTimeout (not (eq (.Values.pulsar_metadata.waitBookkeeperTimeout | toString) "0")) }} + {{- if and .Values.pulsar_metadata.waitBookkeeperTimeout (ne (.Values.pulsar_metadata.waitBookkeeperTimeout | toString) "0") }} # This initContainer will wait for bookkeeper initnewcluster to complete # before initializing pulsar metadata - name: pulsar-bookkeeper-verify-clusterid - image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" - imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }}" + image: {{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }} + imagePullPolicy: {{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }} resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} command: ["timeout", "{{ .Values.pulsar_metadata.waitBookkeeperTimeout }}", "sh", "-c"] args: - - > + - >- bin/apply-config-from-env.py conf/bookkeeper.conf; echo Default BOOKIE_MEM settings are set very high, which can cause the init container to fail.; echo Setting the memory to a lower value to avoid OOM as operations below are not memory intensive.; export BOOKIE_MEM="-Xmx128M"; - {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 10 }} + {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 8 }} until timeout 15 bin/bookkeeper shell whatisinstanceid; do sleep 3; done; envFrom: - configMapRef: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" + name: {{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }} volumeMounts: {{- include "pulsar.toolset.certs.volumeMounts" . | nindent 8 }} {{- end }} containers: - - name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_metadata.component }}" - image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" - imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }}" + - name: {{ template "pulsar.fullname" . }}-{{ .Values.pulsar_metadata.component }} + image: {{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }} + imagePullPolicy: {{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }} {{- if .Values.pulsar_metadata.resources }} resources: {{ toYaml .Values.pulsar_metadata.resources | indent 10 }} {{- end }} command: ["timeout", "{{ .Values.pulsar_metadata.initTimeout | default 60 }}", "sh", "-c"] args: - - | + - >- {{- if .Values.components.zookeeper }} - {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 12 }} - export PULSAR_MEM="-Xmx128M"; - bin/pulsar initialize-cluster-metadata \ - --cluster {{ template "pulsar.cluster.name" . }} \ - --zookeeper {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ - {{- if .Values.pulsar_metadata.configurationStore }} - --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ - {{- else }} - --configuration-store {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ - {{- end }} - --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ - --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ - --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ - --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; - {{- if .Values.extraInitCommand }} - {{ .Values.extraInitCommand }} - {{- end }} - {{- else if .Values.components.oxia }} - bin/pulsar initialize-cluster-metadata \ - --cluster {{ template "pulsar.cluster.name" . }} \ - --metadata-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}\ - {{- if .Values.pulsar_metadata.configurationStore }} - --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ - {{- else }} - --configuration-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ - {{- end }} - --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ - --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ - --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ - --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; + {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 12 }} + export PULSAR_MEM="-Xmx128M"; + bin/pulsar initialize-cluster-metadata \ + --cluster {{ template "pulsar.cluster.name" . }} \ + --zookeeper {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ + {{- if .Values.pulsar_metadata.configurationStore }} + --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ + {{- else }} + --configuration-store {{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }} \ + {{- end }} + --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ + --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ + --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ + --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; + {{- if .Values.extraInitCommand }} + {{ .Values.extraInitCommand }} + {{- end }} + {{- else }} + bin/pulsar initialize-cluster-metadata \ + --cluster {{ template "pulsar.cluster.name" . }} \ + --metadata-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}\ + {{- if .Values.pulsar_metadata.configurationStore }} + --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ + {{- else }} + --configuration-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ + {{- end }} + --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ + --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ + --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ + --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; {{- end }} volumeMounts: - {{- include "pulsar.toolset.certs.volumeMounts" . | nindent 8 }} + {{- include "pulsar.toolset.certs.volumeMounts" . | nindent 10 }} volumes: - {{- include "pulsar.toolset.certs.volumes" . | nindent 6 }} + {{- include "pulsar.toolset.certs.volumes" . | nindent 8 }} restartPolicy: OnFailure {{- if .Values.pulsar_metadata.nodeSelector }} nodeSelector: From 6d8ded4141c4e1239a6973533c4a814f407614bd Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Wed, 13 Nov 2024 21:32:03 -0600 Subject: [PATCH 14/67] fixing init job --- charts/pulsar/templates/_configurationstore.tpl | 4 +++- charts/pulsar/templates/_oxia.tpl | 2 +- .../templates/pulsar-cluster-initialize.yaml | 14 ++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/charts/pulsar/templates/_configurationstore.tpl b/charts/pulsar/templates/_configurationstore.tpl index dbf78d83..4a2c7e56 100644 --- a/charts/pulsar/templates/_configurationstore.tpl +++ b/charts/pulsar/templates/_configurationstore.tpl @@ -23,8 +23,10 @@ Define configuration store endpoint {{- define "pulsar.configurationStore.service" -}} {{- if .Values.pulsar_metadata.configurationStore }} {{- .Values.pulsar_metadata.configurationStore }} -{{- else -}} +{{- else if .Values.components.zookeeper -}} {{ template "pulsar.zookeeper.service" . }} +{{- else -}} +{{ template "pulsar.oxia.service" . }} {{- end -}} {{- end -}} diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index be3352d5..21daced1 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -97,7 +97,7 @@ Define the pulsar oxia */}} {{- define "pulsar.oxia.connect" -}} {{- if and (not .Values.components.zookeeper) .Values.components.oxia }} -oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }}/ +{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }} {{- end -}} {{- end -}} diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index fe92abcd..5a724236 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -109,9 +109,9 @@ spec: {{ toYaml .Values.pulsar_metadata.resources | indent 10 }} {{- end }} command: ["timeout", "{{ .Values.pulsar_metadata.initTimeout | default 60 }}", "sh", "-c"] + {{- if .Values.components.zookeeper }} args: - >- - {{- if .Values.components.zookeeper }} {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 12 }} export PULSAR_MEM="-Xmx128M"; bin/pulsar initialize-cluster-metadata \ @@ -129,20 +129,26 @@ spec: {{- if .Values.extraInitCommand }} {{ .Values.extraInitCommand }} {{- end }} - {{- else }} + {{- else if .Values.components.oxia }} + args: + - >- + export PULSAR_MEM="-Xmx128M"; bin/pulsar initialize-cluster-metadata \ --cluster {{ template "pulsar.cluster.name" . }} \ - --metadata-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}\ + --metadata-store oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ {{- if .Values.pulsar_metadata.configurationStore }} --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ {{- else }} - --configuration-store {{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ + --configuration-store oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ {{- end }} --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ --broker-service-url-tls pulsar+ssl://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsarssl }}/ ; + {{- if .Values.extraInitCommand }} + {{ .Values.extraInitCommand }} {{- end }} + {{- end }} volumeMounts: {{- include "pulsar.toolset.certs.volumeMounts" . | nindent 10 }} volumes: From 2cbedf5019cdb1646d1525a3ac4fd209f3dcfc37 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Thu, 14 Nov 2024 07:52:01 -0600 Subject: [PATCH 15/67] fixed init script --- charts/pulsar/templates/_oxia.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 21daced1..6bf5cbb5 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -89,14 +89,14 @@ timeoutSeconds: 10 Define the pulsar oxia */}} {{- define "pulsar.oxia.server.service" -}} -{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc +{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- end }} {{/* Define the pulsar oxia */}} {{- define "pulsar.oxia.connect" -}} -{{- if and (not .Values.components.zookeeper) .Values.components.oxia }} +{{- if and (not .Values.components.zookeeper) .Values.components.oxia -}} {{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }} {{- end -}} {{- end -}} From 6baf0c040c3e822dc0795f6f379e36451a0ec35d Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Thu, 14 Nov 2024 08:26:52 -0600 Subject: [PATCH 16/67] fix syntax --- charts/pulsar/templates/autorecovery-service-account.yaml | 2 +- charts/pulsar/templates/bookkeeper-cluster-initialize.yaml | 4 ++-- charts/pulsar/templates/bookkeeper-service-account.yaml | 2 +- charts/pulsar/templates/bookkeeper-statefulset.yaml | 4 ++-- charts/pulsar/templates/broker-service-account.yaml | 4 ++-- charts/pulsar/templates/broker-service.yaml | 4 +++- charts/pulsar/templates/broker-statefulset.yaml | 6 +++--- charts/pulsar/templates/oxia-coordinator-service.yaml | 4 ++++ charts/pulsar/templates/oxia-server-service-public.yaml | 4 ++++ charts/pulsar/templates/oxia-server-service.yaml | 4 ++++ charts/pulsar/templates/oxia-server-serviceaccount.yaml | 4 ++++ charts/pulsar/templates/toolset-service-account.yaml | 2 +- charts/pulsar/values.yaml | 3 ++- 13 files changed, 33 insertions(+), 14 deletions(-) diff --git a/charts/pulsar/templates/autorecovery-service-account.yaml b/charts/pulsar/templates/autorecovery-service-account.yaml index bbb66bb0..e72580b9 100644 --- a/charts/pulsar/templates/autorecovery-service-account.yaml +++ b/charts/pulsar/templates/autorecovery-service-account.yaml @@ -26,8 +26,8 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.autorecovery.component }} - annotations: {{- with .Values.autorecovery.service_account.annotations }} + annotations: {{ toYaml . | indent 4 }} {{- end }} {{- end }} diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index d76f25a3..bd9913ec 100755 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -36,12 +36,12 @@ spec: spec: {{- include "pulsar.imagePullSecrets" . | nindent 6 }} serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" + {{- with .Values.pulsar_metadata.nodeSelector }} nodeSelector: - {{- if .Values.pulsar_metadata.nodeSelector }} {{ toYaml .Values.pulsar_metadata.nodeSelector | indent 8 }} {{- end }} + {{- with .Values.pulsar_metadata.tolerations }} tolerations: - {{- if .Values.pulsar_metadata.tolerations }} {{ toYaml .Values.pulsar_metadata.tolerations | indent 8 }} {{- end }} initContainers: diff --git a/charts/pulsar/templates/bookkeeper-service-account.yaml b/charts/pulsar/templates/bookkeeper-service-account.yaml index 245284e5..5779fba3 100644 --- a/charts/pulsar/templates/bookkeeper-service-account.yaml +++ b/charts/pulsar/templates/bookkeeper-service-account.yaml @@ -26,8 +26,8 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.bookkeeper.component }} - annotations: {{- with .Values.bookkeeper.service_account.annotations }} + annotations: {{ toYaml . | indent 4 }} {{- end }} {{- end }} diff --git a/charts/pulsar/templates/bookkeeper-statefulset.yaml b/charts/pulsar/templates/bookkeeper-statefulset.yaml index 4c0e5099..5218ffb8 100644 --- a/charts/pulsar/templates/bookkeeper-statefulset.yaml +++ b/charts/pulsar/templates/bookkeeper-statefulset.yaml @@ -66,7 +66,7 @@ spec: affinity: {{- if and .Values.affinity.anti_affinity .Values.bookkeeper.affinity.anti_affinity}} podAntiAffinity: - {{ if eq .Values.bookkeeper.affinity.type "requiredDuringSchedulingIgnoredDuringExecution"}} + {{- if eq .Values.bookkeeper.affinity.type "requiredDuringSchedulingIgnoredDuringExecution"}} {{ .Values.bookkeeper.affinity.type }}: - labelSelector: matchExpressions: @@ -83,7 +83,7 @@ spec: values: - {{ .Values.bookkeeper.component }} topologyKey: {{ .Values.bookkeeper.affinity.anti_affinity_topology_key }} - {{ else }} + {{- else }} {{ .Values.bookkeeper.affinity.type }}: - weight: 100 podAffinityTerm: diff --git a/charts/pulsar/templates/broker-service-account.yaml b/charts/pulsar/templates/broker-service-account.yaml index a63c67bf..5e239762 100644 --- a/charts/pulsar/templates/broker-service-account.yaml +++ b/charts/pulsar/templates/broker-service-account.yaml @@ -26,8 +26,8 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.broker.component }} - annotations: {{- with .Values.broker.service_account.annotations }} + annotations: {{ toYaml . | indent 4 }} {{- end }} --- @@ -42,8 +42,8 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.functions.component }} - annotations: {{- with .Values.functions.service_account.annotations }} + annotations: {{ toYaml . | indent 4 }} {{- end }} --- diff --git a/charts/pulsar/templates/broker-service.yaml b/charts/pulsar/templates/broker-service.yaml index f9cd1c74..0c683c4b 100644 --- a/charts/pulsar/templates/broker-service.yaml +++ b/charts/pulsar/templates/broker-service.yaml @@ -26,8 +26,10 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.broker.component }} +{{- with .Values.broker.service_account.annotations }} annotations: -{{ toYaml .Values.broker.service.annotations | indent 4 }} +{{ toYaml . | indent 4 }} +{{- end }} spec: type: ClusterIP ports: diff --git a/charts/pulsar/templates/broker-statefulset.yaml b/charts/pulsar/templates/broker-statefulset.yaml index c494c202..5158151d 100644 --- a/charts/pulsar/templates/broker-statefulset.yaml +++ b/charts/pulsar/templates/broker-statefulset.yaml @@ -87,7 +87,7 @@ spec: affinity: {{- if and .Values.affinity.anti_affinity .Values.broker.affinity.anti_affinity}} podAntiAffinity: - {{ if eq .Values.broker.affinity.type "requiredDuringSchedulingIgnoredDuringExecution"}} + {{- if eq .Values.broker.affinity.type "requiredDuringSchedulingIgnoredDuringExecution"}} {{ .Values.broker.affinity.type }}: - labelSelector: matchExpressions: @@ -104,7 +104,7 @@ spec: values: - {{ .Values.broker.component }} topologyKey: {{ .Values.broker.affinity.anti_affinity_topology_key }} - {{ else }} + {{- else }} {{ .Values.broker.affinity.type }}: - weight: 100 podAffinityTerm: @@ -123,7 +123,7 @@ spec: values: - {{ .Values.broker.component }} topologyKey: {{ .Values.broker.affinity.anti_affinity_topology_key }} - {{ end }} + {{- end }} {{- end }} terminationGracePeriodSeconds: {{ .Values.broker.gracePeriod }} initContainers: diff --git a/charts/pulsar/templates/oxia-coordinator-service.yaml b/charts/pulsar/templates/oxia-coordinator-service.yaml index 8c70f670..e71d300e 100644 --- a/charts/pulsar/templates/oxia-coordinator-service.yaml +++ b/charts/pulsar/templates/oxia-coordinator-service.yaml @@ -26,6 +26,10 @@ metadata: {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} +{{- with .Values.oxia.service_account.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: ports: {{- range $key, $value := .Values.oxia.coordinator.ports }} diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml index 31d774c6..225f4bd7 100644 --- a/charts/pulsar/templates/oxia-server-service-public.yaml +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -26,6 +26,10 @@ metadata: {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} +{{- with .Values.oxia.service_account.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: ports: {{- range $key, $value := .Values.oxia.server.ports }} diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index 4a3ef992..322b3bde 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -25,6 +25,10 @@ metadata: {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc namespace: {{ template "pulsar.namespace" . }} +{{- with .Values.oxia.service_account.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: clusterIP: None publishNotReadyAddresses: true diff --git a/charts/pulsar/templates/oxia-server-serviceaccount.yaml b/charts/pulsar/templates/oxia-server-serviceaccount.yaml index dba1b688..a990e497 100644 --- a/charts/pulsar/templates/oxia-server-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-server-serviceaccount.yaml @@ -24,6 +24,10 @@ metadata: {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} +{{- with .Values.oxia.service_account.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} {{- if .Values.images.imagePullSecrets }} imagePullSecrets: - name: {{ .Values.images.imagePullSecrets.secretName }} diff --git a/charts/pulsar/templates/toolset-service-account.yaml b/charts/pulsar/templates/toolset-service-account.yaml index 32b0b044..290076f1 100644 --- a/charts/pulsar/templates/toolset-service-account.yaml +++ b/charts/pulsar/templates/toolset-service-account.yaml @@ -26,8 +26,8 @@ metadata: labels: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.toolset.component }} - annotations: {{- with .Values.toolset.service_account.annotations }} + annotations: {{ toYaml . | indent 4 }} {{- end }} {{- end }} diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 1989b1b0..f767c9b9 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -501,7 +501,8 @@ oxia: metrics: 8080 pprofEnabled: false monitoringEnabled: false - + service_account: + annotations: {} ## Pulsar: Bookkeeper cluster ## templates/bookkeeper-statefulset.yaml ## From 1a2437ac0ab99fdc3880b5c5eccede60ad7b32e2 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Thu, 14 Nov 2024 08:28:30 -0600 Subject: [PATCH 17/67] add oxia values example --- examples/values-oxia.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/values-oxia.yaml diff --git a/examples/values-oxia.yaml b/examples/values-oxia.yaml new file mode 100644 index 00000000..b9355cd3 --- /dev/null +++ b/examples/values-oxia.yaml @@ -0,0 +1,16 @@ +namespace: pulsar +initialize: true +kube-prometheus-stack: + enabled: false + +components: + zookeeper: false + oxia: true + proxy: false + +zookeeper: + +oxia: + +pulsar_metadata: + configurationStorePort: 6648 \ No newline at end of file From c8750a1005efc8653dc96496b4a9bf59c51f8d4e Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Thu, 14 Nov 2024 08:30:49 -0600 Subject: [PATCH 18/67] rollback gitignore --- .gitignore | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5b1d59bd..abd9ae1e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,4 @@ PRIVATEKEY PUBLICKEY .vagrant/ pulsarctl-*-*.tar.gz -pulsarctl-*-*/ - -#test.yaml -charts/pulsar/test-values.yaml -charts/pulsar/test1.yaml \ No newline at end of file +pulsarctl-*-*/ \ No newline at end of file From 989172f4bbf27a3ec1f4227334ca028d09d63c3e Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Thu, 14 Nov 2024 08:46:43 -0600 Subject: [PATCH 19/67] fix bookie common tpl --- charts/pulsar/templates/_bookkeeper.tpl | 2 ++ charts/pulsar/templates/_oxia.tpl | 2 +- charts/pulsar/templates/zookeeper-podmonitor.yaml | 2 ++ examples/values-oxia.yaml | 4 ---- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/pulsar/templates/_bookkeeper.tpl b/charts/pulsar/templates/_bookkeeper.tpl index 6cef3437..4c70edbf 100644 --- a/charts/pulsar/templates/_bookkeeper.tpl +++ b/charts/pulsar/templates/_bookkeeper.tpl @@ -92,6 +92,7 @@ Define bookie tls certs volumes Define bookie common config */}} {{- define "pulsar.bookkeeper.config.common" -}} +{{- if .Values.components.zookeeper }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}" zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" # enable bookkeeper http server @@ -102,6 +103,7 @@ statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProv # use hostname as the bookie id useHostNameAsBookieID: "true" {{- end }} +{{- end }} {{/* Define bookie tls config diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 6bf5cbb5..0289c559 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -89,7 +89,7 @@ timeoutSeconds: 10 Define the pulsar oxia */}} {{- define "pulsar.oxia.server.service" -}} -{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} +{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc {{- end }} {{/* diff --git a/charts/pulsar/templates/zookeeper-podmonitor.yaml b/charts/pulsar/templates/zookeeper-podmonitor.yaml index f2de68b1..15929037 100644 --- a/charts/pulsar/templates/zookeeper-podmonitor.yaml +++ b/charts/pulsar/templates/zookeeper-podmonitor.yaml @@ -18,6 +18,7 @@ # # deploy zookeeper PodMonitor only when `$.Values.zookeeper.podMonitor.enabled` is true +{{- if .Values.components.zookeeper }} {{- if $.Values.zookeeper.podMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: PodMonitor @@ -56,3 +57,4 @@ spec: {{- include "pulsar.matchLabels" . | nindent 6 }} component: zookeeper {{- end }} +{{- end }} \ No newline at end of file diff --git a/examples/values-oxia.yaml b/examples/values-oxia.yaml index b9355cd3..1a1f5474 100644 --- a/examples/values-oxia.yaml +++ b/examples/values-oxia.yaml @@ -8,9 +8,5 @@ components: oxia: true proxy: false -zookeeper: - -oxia: - pulsar_metadata: configurationStorePort: 6648 \ No newline at end of file From 24fa4569d948dbd16bfba92bbd85e076d3b3b201 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Thu, 14 Nov 2024 08:53:13 -0600 Subject: [PATCH 20/67] add metastore timeout --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index f767c9b9..e1bac604 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -476,7 +476,6 @@ zookeeper: maxUnavailable: 1 ## Pulsar: Oxia cluster - oxia: component: oxia initialShardCount: 3 @@ -807,6 +806,7 @@ pulsar_metadata: configurationStorePort: 2181 ## Timeout for waiting for zookeeper or oxia to become available before running metadata initialization waitMetadataTimeout: 600 + waitZookeeperTimeout: 600 ## Timeout for waiting for bookkeeper to be initialized before running metadata initialization waitBookkeeperTimeout: 120 ## Timeout for running metadata initialization From 817803e397ff34078cd7ee8277d991163ae808e7 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 18:43:20 +0200 Subject: [PATCH 21/67] Test Oxia in CI --- .ci/clusters/values-oxia.yaml | 33 +++++++++++++++++++++ .github/workflows/pulsar-helm-chart-ci.yaml | 3 ++ 2 files changed, 36 insertions(+) create mode 100644 .ci/clusters/values-oxia.yaml diff --git a/.ci/clusters/values-oxia.yaml b/.ci/clusters/values-oxia.yaml new file mode 100644 index 00000000..13688583 --- /dev/null +++ b/.ci/clusters/values-oxia.yaml @@ -0,0 +1,33 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +components: + zookeeper: false + oxia: true + +pulsar_metadata: + configurationStorePort: 6648 + +oxia: + initialShardCount: 1 + replicationFactor: 1 + server: + replicas: 1 + memory: 256Mi + storage: 8Gi \ No newline at end of file diff --git a/.github/workflows/pulsar-helm-chart-ci.yaml b/.github/workflows/pulsar-helm-chart-ci.yaml index f9fdf1b7..b19e1abf 100644 --- a/.github/workflows/pulsar-helm-chart-ci.yaml +++ b/.github/workflows/pulsar-helm-chart-ci.yaml @@ -208,6 +208,9 @@ jobs: - name: Pulsar Manager values_file: .ci/clusters/values-pulsar-manager.yaml shortname: pulsar-manager + - name: Oxia + values_file: .ci/clusters/values-oxia.yaml + shortname: oxia include: - k8sVersion: version: "1.23.17" From c94546da31b460280e9007f87213a754acb0b0fa Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 18:51:56 +0200 Subject: [PATCH 22/67] Make the default for configurationStorePort to be 6648 when oxia is enabled --- .ci/clusters/values-oxia.yaml | 3 --- charts/pulsar/templates/_configurationstore.tpl | 2 +- charts/pulsar/values.yaml | 4 ++-- examples/values-oxia.yaml | 5 +---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.ci/clusters/values-oxia.yaml b/.ci/clusters/values-oxia.yaml index 13688583..e253f0d0 100644 --- a/.ci/clusters/values-oxia.yaml +++ b/.ci/clusters/values-oxia.yaml @@ -21,9 +21,6 @@ components: zookeeper: false oxia: true -pulsar_metadata: - configurationStorePort: 6648 - oxia: initialShardCount: 1 replicationFactor: 1 diff --git a/charts/pulsar/templates/_configurationstore.tpl b/charts/pulsar/templates/_configurationstore.tpl index 4a2c7e56..d3cf5d4e 100644 --- a/charts/pulsar/templates/_configurationstore.tpl +++ b/charts/pulsar/templates/_configurationstore.tpl @@ -35,7 +35,7 @@ Define configuration store connection string */}} {{- define "pulsar.configurationStore.connect" -}} {{- if .Values.pulsar_metadata.configurationStore }} -{{- template "pulsar.configurationStore.service" . }}:{{ .Values.pulsar_metadata.configurationStorePort }} +{{- template "pulsar.configurationStore.service" . }}:{{ .Values.pulsar_metadata.configurationStorePort | default (ternary 6648 2181 .Values.components.oxia) }} {{- end -}} {{- end -}} diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index e1bac604..20439fb3 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -802,8 +802,8 @@ pulsar_metadata: ## set an existing configuration store # configurationStore: default zk. available: zk or oxia configurationStoreMetadataPrefix: "" - # default: zk port. avaiable: zk 2181, oxia 6648 - configurationStorePort: 2181 + # default: zk port (2181), or oxia port (6648) when oxia is enabled. + configurationStorePort: ## Timeout for waiting for zookeeper or oxia to become available before running metadata initialization waitMetadataTimeout: 600 waitZookeeperTimeout: 600 diff --git a/examples/values-oxia.yaml b/examples/values-oxia.yaml index 1a1f5474..9a8fdadb 100644 --- a/examples/values-oxia.yaml +++ b/examples/values-oxia.yaml @@ -6,7 +6,4 @@ kube-prometheus-stack: components: zookeeper: false oxia: true - proxy: false - -pulsar_metadata: - configurationStorePort: 6648 \ No newline at end of file + proxy: false \ No newline at end of file From 31579ff83428501cb0f303c69d50ba1630f90c69 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 18:59:13 +0200 Subject: [PATCH 23/67] Add license header and minimize the example --- examples/values-oxia.yaml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/examples/values-oxia.yaml b/examples/values-oxia.yaml index 9a8fdadb..7c1ecb73 100644 --- a/examples/values-oxia.yaml +++ b/examples/values-oxia.yaml @@ -1,9 +1,22 @@ -namespace: pulsar -initialize: true -kube-prometheus-stack: - enabled: false +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# components: zookeeper: false - oxia: true - proxy: false \ No newline at end of file + oxia: true \ No newline at end of file From 1ee80a284d029953b8f1e3494050187737d1e2b8 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 19:14:58 +0200 Subject: [PATCH 24/67] Disable wait-zookeeper-ready init containers when zookeeper isn't enabled --- charts/pulsar/templates/bookkeeper-cluster-initialize.yaml | 2 +- charts/pulsar/templates/broker-statefulset.yaml | 2 +- charts/pulsar/templates/proxy-statefulset.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index bd9913ec..2c6dab79 100755 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -45,7 +45,7 @@ spec: {{ toYaml .Values.pulsar_metadata.tolerations | indent 8 }} {{- end }} initContainers: - {{- if and .Values.bookkeeper.metadata.waitZookeeperTimeout (not (eq (.Values.bookkeeper.metadata.waitZookeeperTimeout | toString) "0")) }} + {{- if and .Values.components.zookeeper .Values.bookkeeper.metadata.waitZookeeperTimeout (not (eq (.Values.bookkeeper.metadata.waitZookeeperTimeout | toString) "0")) }} - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.images.bookie "root" .) }}" diff --git a/charts/pulsar/templates/broker-statefulset.yaml b/charts/pulsar/templates/broker-statefulset.yaml index 5158151d..78e89712 100644 --- a/charts/pulsar/templates/broker-statefulset.yaml +++ b/charts/pulsar/templates/broker-statefulset.yaml @@ -127,7 +127,7 @@ spec: {{- end }} terminationGracePeriodSeconds: {{ .Values.broker.gracePeriod }} initContainers: - {{- if and .Values.broker.waitZookeeperTimeout (not (eq (.Values.broker.waitZookeeperTimeout | toString) "0")) }} + {{- if and .Values.components.zookeeper .Values.broker.waitZookeeperTimeout (not (eq (.Values.broker.waitZookeeperTimeout | toString) "0")) }} # This init container will wait for zookeeper to be ready before # deploying the bookies - name: wait-zookeeper-ready diff --git a/charts/pulsar/templates/proxy-statefulset.yaml b/charts/pulsar/templates/proxy-statefulset.yaml index 6a585121..597d8a9f 100644 --- a/charts/pulsar/templates/proxy-statefulset.yaml +++ b/charts/pulsar/templates/proxy-statefulset.yaml @@ -109,7 +109,7 @@ spec: terminationGracePeriodSeconds: {{ .Values.proxy.gracePeriod }} serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}" initContainers: - {{- if and .Values.proxy.waitZookeeperTimeout (not (eq (.Values.proxy.waitZookeeperTimeout | toString) "0")) }} + {{- if and .Values.components.zookeeper .Values.proxy.waitZookeeperTimeout (not (eq (.Values.proxy.waitZookeeperTimeout | toString) "0")) }} # This init container will wait for zookeeper to be ready before # deploying the bookies - name: wait-zookeeper-ready From 27e4d7369882f70e4654314e40ca47c88e5b0035 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 19:15:37 +0200 Subject: [PATCH 25/67] Fix template name --- charts/pulsar/templates/_configurationstore.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/_configurationstore.tpl b/charts/pulsar/templates/_configurationstore.tpl index d3cf5d4e..3dfc3a9c 100644 --- a/charts/pulsar/templates/_configurationstore.tpl +++ b/charts/pulsar/templates/_configurationstore.tpl @@ -26,7 +26,7 @@ Define configuration store endpoint {{- else if .Values.components.zookeeper -}} {{ template "pulsar.zookeeper.service" . }} {{- else -}} -{{ template "pulsar.oxia.service" . }} +{{ template "pulsar.oxia.server.service" . }} {{- end -}} {{- end -}} From 826eaff0f1640802384be0cb7126470d4b1bb54a Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 19:41:21 +0200 Subject: [PATCH 26/67] Fix TLS issue in pulsar-cluster-initialize.yaml template --- charts/pulsar/templates/pulsar-cluster-initialize.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 5a724236..da4227c7 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -61,7 +61,7 @@ spec: command: ["timeout", "{{ .Values.pulsar_metadata.waitMetadataTimeout }}", "sh", "-c"] args: - >- - {{- if $zk :=.Values.pulsar_metadata.userProvidedZookeepers }} + {{- if $zk := .Values.pulsar_metadata.userProvidedZookeepers }} export PULSAR_MEM="-Xmx128M"; until timeout 15 bin/pulsar zookeeper-shell -server {{ $zk }} ls {{ or .Values.metadataPrefix "/" }}; do echo "user provided zookeepers {{ $zk }} are unreachable... check in 3 seconds ..." && sleep 3; @@ -90,7 +90,7 @@ spec: echo Default BOOKIE_MEM settings are set very high, which can cause the init container to fail.; echo Setting the memory to a lower value to avoid OOM as operations below are not memory intensive.; export BOOKIE_MEM="-Xmx128M"; - {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 8 }} + {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 10 }} until timeout 15 bin/bookkeeper shell whatisinstanceid; do sleep 3; done; From b094b1af20f243ba57984e253a67da0a5684ee2b Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 19:54:55 +0200 Subject: [PATCH 27/67] Fix oxia-server-statefulset volume name --- charts/pulsar/templates/oxia-server-statefulset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index 9f58807d..5001d178 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -67,7 +67,7 @@ spec: cpu: {{ .Values.oxia.server.cpu }} memory: {{ .Values.oxia.server.memory }} volumeMounts: - - name: data + - name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-data mountPath: /data livenessProbe: {{- include "oxia-cluster.probe" .Values.oxia.server.ports.internal | nindent 12 }} From 5476ee2c6f57d2d7c015413285761e4adf438fd6 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 20:07:04 +0200 Subject: [PATCH 28/67] Fix issue: sh: nslookuppulsar-ci-oxia-svc: not found --- charts/pulsar/templates/pulsar-cluster-initialize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index da4227c7..962fda50 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -71,7 +71,7 @@ spec: sleep 3; done; {{ else }} - until nslookup {{- include "pulsar.oxia.server.service" . }}; do + until nslookup {{ include "pulsar.oxia.server.service" . }}; do sleep 3; done; {{- end }} From c7b44063b14209f1b6f9ab66d96ef96f70af286b Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 21:32:22 +0200 Subject: [PATCH 29/67] Don't run zookeeper-shell in bookkeeper-cluster-initialize unless zookeeper is enabled --- charts/pulsar/templates/bookkeeper-cluster-initialize.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index 2c6dab79..c5ec9fe1 100755 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -81,7 +81,7 @@ spec: if timeout 15 bin/bookkeeper shell whatisinstanceid; then echo "bookkeeper cluster already initialized"; else - {{- if not (eq .Values.metadataPrefix "") }} + {{- if and .Values.components.zookeeper (not (eq .Values.metadataPrefix "")) }} bin/pulsar zookeeper-shell -server {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }} create {{ .Values.metadataPrefix }} && echo 'created for pulsar cluster "{{ template "pulsar.cluster.name" . }}"' && {{- end }} bin/bookkeeper shell initnewcluster; From 02ce2f0dc0e58bb085d8a6bf88df65a640ac0227 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 21:43:37 +0200 Subject: [PATCH 30/67] Set export BOOKIE_MEM="-Xmx128M" in all verify_cluster_id init containers --- charts/pulsar/templates/_autorecovery.tpl | 1 + charts/pulsar/templates/_bookkeeper.tpl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/charts/pulsar/templates/_autorecovery.tpl b/charts/pulsar/templates/_autorecovery.tpl index 1279fbca..8ba78c84 100644 --- a/charts/pulsar/templates/_autorecovery.tpl +++ b/charts/pulsar/templates/_autorecovery.tpl @@ -92,6 +92,7 @@ Define autorecovery init container : verify cluster id */}} {{- define "pulsar.autorecovery.init.verify_cluster_id" -}} bin/apply-config-from-env.py conf/bookkeeper.conf; +export BOOKIE_MEM="-Xmx128M"; {{- include "pulsar.autorecovery.zookeeper.tls.settings" . -}} until timeout 15 bin/bookkeeper shell whatisinstanceid; do sleep 3; diff --git a/charts/pulsar/templates/_bookkeeper.tpl b/charts/pulsar/templates/_bookkeeper.tpl index 4c70edbf..d74b088e 100644 --- a/charts/pulsar/templates/_bookkeeper.tpl +++ b/charts/pulsar/templates/_bookkeeper.tpl @@ -125,6 +125,7 @@ Define bookie init container : verify cluster id {{- define "pulsar.bookkeeper.init.verify_cluster_id" -}} {{- if not (and .Values.volumes.persistence .Values.bookkeeper.volumes.persistence) }} bin/apply-config-from-env.py conf/bookkeeper.conf; +export BOOKIE_MEM="-Xmx128M"; {{- include "pulsar.bookkeeper.zookeeper.tls.settings" . -}} until timeout 15 bin/bookkeeper shell whatisinstanceid; do sleep 3; @@ -134,6 +135,7 @@ bin/bookkeeper shell bookieformat -nonInteractive -force -deleteCookie || true {{- if and .Values.volumes.persistence .Values.bookkeeper.volumes.persistence }} set -e; bin/apply-config-from-env.py conf/bookkeeper.conf; +export BOOKIE_MEM="-Xmx128M"; {{- include "pulsar.bookkeeper.zookeeper.tls.settings" . -}} until timeout 15 bin/bookkeeper shell whatisinstanceid; do sleep 3; From e02ca57dff2d08b56aa7a869a3862678f12024a9 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 22:05:45 +0200 Subject: [PATCH 31/67] Configure Oxia for BookKeeper --- charts/pulsar/templates/_bookkeeper.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/pulsar/templates/_bookkeeper.tpl b/charts/pulsar/templates/_bookkeeper.tpl index d74b088e..42aac705 100644 --- a/charts/pulsar/templates/_bookkeeper.tpl +++ b/charts/pulsar/templates/_bookkeeper.tpl @@ -95,6 +95,9 @@ Define bookie common config {{- if .Values.components.zookeeper }} zkServers: "{{ template "pulsar.zookeeper.connect" . }}" zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" +{{- else if .Values.components.oxia }} +metadataServiceUri: "metadata-store:oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/ledgers" +{{- end }} # enable bookkeeper http server httpServerEnabled: "true" httpServerPort: "{{ .Values.bookkeeper.ports.http }}" @@ -103,7 +106,6 @@ statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProv # use hostname as the bookie id useHostNameAsBookieID: "true" {{- end }} -{{- end }} {{/* Define bookie tls config From 2a549a1b0d15e509f0825e3ffee4d8f6cb5f2ae5 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 22:33:54 +0200 Subject: [PATCH 32/67] Start adding Oxia config for broker and bookkeeper --- charts/pulsar/templates/_bookkeeper.tpl | 2 +- charts/pulsar/templates/broker-configmap.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/pulsar/templates/_bookkeeper.tpl b/charts/pulsar/templates/_bookkeeper.tpl index 42aac705..4ac507dc 100644 --- a/charts/pulsar/templates/_bookkeeper.tpl +++ b/charts/pulsar/templates/_bookkeeper.tpl @@ -96,7 +96,7 @@ Define bookie common config zkServers: "{{ template "pulsar.zookeeper.connect" . }}" zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" {{- else if .Values.components.oxia }} -metadataServiceUri: "metadata-store:oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/ledgers" +metadataServiceUri: "metadata-store:oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/bookkeeper" {{- end }} # enable bookkeeper http server httpServerEnabled: "true" diff --git a/charts/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml index 1f348752..cfe11e75 100644 --- a/charts/pulsar/templates/broker-configmap.yaml +++ b/charts/pulsar/templates/broker-configmap.yaml @@ -28,6 +28,7 @@ metadata: component: {{ .Values.broker.component }} data: # Metadata settings + {{- if .Values.components.zookeeper }} zookeeperServers: "{{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }}" {{- if .Values.pulsar_metadata.configurationStore }} configurationStoreServers: "{{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }}" @@ -35,6 +36,11 @@ data: {{- if not .Values.pulsar_metadata.configurationStore }} configurationStoreServers: "{{ template "pulsar.zookeeper.connect" . }}{{ .Values.metadataPrefix }}" {{- end }} + {{- end }} + {{- if .Values.components.oxia }} + metadataStoreUrl: "oxia://{{ template "pulsar.oxia.server.service" . }}{{ .Values.metadataPrefix }}/broker" + bookkeeperMetadataServiceUri: "metadata-store:oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/bookkeeper" + {{- end }} # Broker settings clusterName: {{ template "pulsar.cluster.name" . }} From e501e204221f6e3d32c5ef0c944cec3324e1ae9e Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 20 Nov 2024 22:39:31 +0200 Subject: [PATCH 33/67] Use pulsar.oxia.connect template --- charts/pulsar/templates/broker-configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml index cfe11e75..c172179f 100644 --- a/charts/pulsar/templates/broker-configmap.yaml +++ b/charts/pulsar/templates/broker-configmap.yaml @@ -38,7 +38,7 @@ data: {{- end }} {{- end }} {{- if .Values.components.oxia }} - metadataStoreUrl: "oxia://{{ template "pulsar.oxia.server.service" . }}{{ .Values.metadataPrefix }}/broker" + metadataStoreUrl: "oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/broker" bookkeeperMetadataServiceUri: "metadata-store:oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/bookkeeper" {{- end }} From 4e0b4c28601951af80fd253036c831b383bf39e9 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 08:56:54 +0200 Subject: [PATCH 34/67] Configure broker and bookkeeper namespaces in Oxia --- charts/pulsar/templates/_oxia.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 0289c559..e338abab 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -106,7 +106,10 @@ Define coordinator configmap */}} {{- define "oxia.coordinator.CMProperties" -}} namespaces: - - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + - name: broker + initialShardCount: {{ .Values.oxia.initialShardCount }} + replicationFactor: {{ .Values.oxia.replicationFactor }} + - name: bookkeeper initialShardCount: {{ .Values.oxia.initialShardCount }} replicationFactor: {{ .Values.oxia.replicationFactor }} servers: From 491dae9b2668143c9f697d11fdcca5716120aaed Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 09:01:28 +0200 Subject: [PATCH 35/67] Rename template oxia.coordinator.CMProperties to oxia.coordinator.config.yaml --- charts/pulsar/templates/_oxia.tpl | 2 +- charts/pulsar/templates/oxia-coordinator-configmap.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index e338abab..938fa88d 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -104,7 +104,7 @@ Define the pulsar oxia {{/* Define coordinator configmap */}} -{{- define "oxia.coordinator.CMProperties" -}} +{{- define "oxia.coordinator.config.yaml" -}} namespaces: - name: broker initialShardCount: {{ .Values.oxia.initialShardCount }} diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml index 17959f49..53742efd 100644 --- a/charts/pulsar/templates/oxia-coordinator-configmap.yaml +++ b/charts/pulsar/templates/oxia-coordinator-configmap.yaml @@ -26,6 +26,6 @@ metadata: namespace: {{ template "pulsar.namespace" . }} data: config.yaml: | - {{- include "oxia.coordinator.CMProperties" . | nindent 4 }} + {{- include "oxia.coordinator.config.yaml" . | nindent 4 }} {{- end }} \ No newline at end of file From bc7fe2e67893532fb3b1048f346aaa57d56216b9 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 11:41:08 +0200 Subject: [PATCH 36/67] Improve oxia configuration --- charts/pulsar/templates/_bookkeeper.tpl | 2 +- charts/pulsar/templates/_oxia.tpl | 17 +++++++++++++---- charts/pulsar/templates/broker-configmap.yaml | 4 ++-- .../templates/pulsar-cluster-initialize.yaml | 7 +------ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/charts/pulsar/templates/_bookkeeper.tpl b/charts/pulsar/templates/_bookkeeper.tpl index 4ac507dc..d7a57029 100644 --- a/charts/pulsar/templates/_bookkeeper.tpl +++ b/charts/pulsar/templates/_bookkeeper.tpl @@ -96,7 +96,7 @@ Define bookie common config zkServers: "{{ template "pulsar.zookeeper.connect" . }}" zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" {{- else if .Values.components.oxia }} -metadataServiceUri: "metadata-store:oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/bookkeeper" +metadataServiceUri: "{{ template "pulsar.oxia.metadata.url.bookkeeper" . }}" {{- end }} # enable bookkeeper http server httpServerEnabled: "true" diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 938fa88d..552ecbbf 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -93,11 +93,20 @@ Define the pulsar oxia {{- end }} {{/* -Define the pulsar oxia +oxia url for broker metadata +*/}} +{{- define "pulsar.oxia.metadata.url.broker" -}} +{{- if .Values.components.oxia -}} +oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }}/broker +{{- end -}} +{{- end -}} + +{{/* +oxia url for bookkeeper metadata */}} -{{- define "pulsar.oxia.connect" -}} -{{- if and (not .Values.components.zookeeper) .Values.components.oxia -}} -{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }} +{{- define "pulsar.oxia.metadata.url.bookkeeper" -}} +{{- if .Values.components.oxia -}} +metadata-store:oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }}/bookkeeper {{- end -}} {{- end -}} diff --git a/charts/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml index c172179f..f03d0d3c 100644 --- a/charts/pulsar/templates/broker-configmap.yaml +++ b/charts/pulsar/templates/broker-configmap.yaml @@ -38,8 +38,8 @@ data: {{- end }} {{- end }} {{- if .Values.components.oxia }} - metadataStoreUrl: "oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/broker" - bookkeeperMetadataServiceUri: "metadata-store:oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }}/bookkeeper" + metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url.broker" . }}" + bookkeeperMetadataServiceUri: "{{ template "pulsar.oxia.metadata.url.bookkeeper" . }}" {{- end }} # Broker settings diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 962fda50..0deb9caf 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -135,12 +135,7 @@ spec: export PULSAR_MEM="-Xmx128M"; bin/pulsar initialize-cluster-metadata \ --cluster {{ template "pulsar.cluster.name" . }} \ - --metadata-store oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ - {{- if .Values.pulsar_metadata.configurationStore }} - --configuration-store {{ template "pulsar.configurationStore.connect" . }}{{ .Values.pulsar_metadata.configurationStoreMetadataPrefix }} \ - {{- else }} - --configuration-store oxia://{{ template "pulsar.oxia.connect" . }}{{ .Values.metadataPrefix }} \ - {{- end }} + --metadata-store "{{ template "pulsar.oxia.metadata.url.broker" . }}" \ --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ From 491ecd2fc6c2fbd3e0d0f263f0688deacbd260a2 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 12:57:33 +0200 Subject: [PATCH 37/67] Limit configurationStore, configurationStoreMetadataPrefix and configurationStorePort to zookeeper --- charts/pulsar/values.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 20439fb3..06890fc2 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -799,13 +799,15 @@ pulsar_metadata: tag: # uses defaultPullPolicy when unspecified pullPolicy: - ## set an existing configuration store - # configurationStore: default zk. available: zk or oxia + ## set an existing configuration store. This setting applies only when zookeeper is enabled. + # configurationStore: + # the prefix for the configuration store metadata. This setting applies only when zookeeper is enabled. configurationStoreMetadataPrefix: "" - # default: zk port (2181), or oxia port (6648) when oxia is enabled. - configurationStorePort: + # the configuration store port. This setting applies only when zookeeper is enabled. + configurationStorePort: 2181 ## Timeout for waiting for zookeeper or oxia to become available before running metadata initialization waitMetadataTimeout: 600 + # the zookeeper timeout. This setting applies only when zookeeper is enabled. waitZookeeperTimeout: 600 ## Timeout for waiting for bookkeeper to be initialized before running metadata initialization waitBookkeeperTimeout: 120 @@ -827,11 +829,10 @@ pulsar_metadata: # nodeSelector: {} # cloud.google.com/gke-nodepool: default-pool - ## optional, you can provide your own zookeeper metadata store or oxia metadata store for other components + ## optional, you can provide your own zookeeper metadata store for other components # to use this, you should explicit set components.zookeeper to false # # userProvidedZookeepers: "zk01.example.com:2181,zk02.example.com:2181" - # userProvidedOxia: "" # Can be used to run extra commands in the initialization jobs e.g. to quit istio sidecars etc. extraInitCommand: "" From a9fa703dba6386c949b73a1524f4eb992e3f405e Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 13:27:25 +0200 Subject: [PATCH 38/67] Improve condition for wait timeout --- charts/pulsar/templates/autorecovery-statefulset.yaml | 2 +- .../templates/bookkeeper-cluster-initialize.yaml | 2 +- charts/pulsar/templates/bookkeeper-statefulset.yaml | 2 +- charts/pulsar/templates/broker-statefulset.yaml | 4 ++-- charts/pulsar/templates/proxy-statefulset.yaml | 4 ++-- charts/pulsar/templates/pulsar-cluster-initialize.yaml | 10 +++++----- charts/pulsar/values.yaml | 1 - 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/charts/pulsar/templates/autorecovery-statefulset.yaml b/charts/pulsar/templates/autorecovery-statefulset.yaml index 81327e16..6d43ae89 100644 --- a/charts/pulsar/templates/autorecovery-statefulset.yaml +++ b/charts/pulsar/templates/autorecovery-statefulset.yaml @@ -110,7 +110,7 @@ spec: terminationGracePeriodSeconds: {{ .Values.autorecovery.gracePeriod }} serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.autorecovery.component }}" initContainers: - {{- if and .Values.autorecovery.waitBookkeeperTimeout (not (eq (.Values.autorecovery.waitBookkeeperTimeout | toString) "0")) }} + {{- if and .Values.autorecovery.waitBookkeeperTimeout(gt (.Values.autorecovery.waitBookkeeperTimeout | int) 0) }} # This initContainer will wait for bookkeeper initnewcluster to complete # before deploying the bookies - name: pulsar-bookkeeper-verify-clusterid diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index c5ec9fe1..48b6d8c4 100755 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -45,7 +45,7 @@ spec: {{ toYaml .Values.pulsar_metadata.tolerations | indent 8 }} {{- end }} initContainers: - {{- if and .Values.components.zookeeper .Values.bookkeeper.metadata.waitZookeeperTimeout (not (eq (.Values.bookkeeper.metadata.waitZookeeperTimeout | toString) "0")) }} + {{- if and .Values.components.zookeeper .Values.bookkeeper.metadata.waitZookeeperTimeout (gt (.Values.bookkeeper.metadata.waitZookeeperTimeout | int) 0) }} - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.images.bookie "root" .) }}" diff --git a/charts/pulsar/templates/bookkeeper-statefulset.yaml b/charts/pulsar/templates/bookkeeper-statefulset.yaml index 5218ffb8..16799bc1 100644 --- a/charts/pulsar/templates/bookkeeper-statefulset.yaml +++ b/charts/pulsar/templates/bookkeeper-statefulset.yaml @@ -110,7 +110,7 @@ spec: securityContext: {{ toYaml .Values.bookkeeper.securityContext | indent 8 }} {{- end }} - {{- if and .Values.bookkeeper.waitMetadataTimeout (not (eq (.Values.bookkeeper.waitMetadataTimeout | toString) "0")) }} + {{- if and .Values.bookkeeper.waitMetadataTimeout (gt (.Values.bookkeeper.waitMetadataTimeout | int) 0) }} initContainers: # This initContainer will wait for bookkeeper initnewcluster to complete # before deploying the bookies diff --git a/charts/pulsar/templates/broker-statefulset.yaml b/charts/pulsar/templates/broker-statefulset.yaml index 78e89712..4278a91d 100644 --- a/charts/pulsar/templates/broker-statefulset.yaml +++ b/charts/pulsar/templates/broker-statefulset.yaml @@ -127,7 +127,7 @@ spec: {{- end }} terminationGracePeriodSeconds: {{ .Values.broker.gracePeriod }} initContainers: - {{- if and .Values.components.zookeeper .Values.broker.waitZookeeperTimeout (not (eq (.Values.broker.waitZookeeperTimeout | toString) "0")) }} + {{- if and .Values.components.zookeeper .Values.broker.waitZookeeperTimeout (gt (.Values.broker.waitZookeeperTimeout | int) 0) }} # This init container will wait for zookeeper to be ready before # deploying the bookies - name: wait-zookeeper-ready @@ -154,7 +154,7 @@ spec: volumeMounts: {{- include "pulsar.broker.certs.volumeMounts" . | nindent 8 }} {{- end }} - {{- if and .Values.broker.waitBookkeeperTimeout (not (eq (.Values.broker.waitBookkeeperTimeout | toString) "0")) }} + {{- if and .Values.broker.waitBookkeeperTimeout (gt (.Values.broker.waitBookkeeperTimeout | int) 0) }} # This init container will wait for bookkeeper to be ready before # deploying the broker - name: wait-bookkeeper-ready diff --git a/charts/pulsar/templates/proxy-statefulset.yaml b/charts/pulsar/templates/proxy-statefulset.yaml index 5d33c1d6..42d49d35 100644 --- a/charts/pulsar/templates/proxy-statefulset.yaml +++ b/charts/pulsar/templates/proxy-statefulset.yaml @@ -109,7 +109,7 @@ spec: terminationGracePeriodSeconds: {{ .Values.proxy.gracePeriod }} serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}" initContainers: - {{- if and .Values.components.zookeeper .Values.proxy.waitZookeeperTimeout (not (eq (.Values.proxy.waitZookeeperTimeout | toString) "0")) }} + {{- if and .Values.components.zookeeper .Values.proxy.waitZookeeperTimeout (gt (.Values.proxy.waitZookeeperTimeout | int) 0) }} # This init container will wait for zookeeper to be ready before # deploying the bookies - name: wait-zookeeper-ready @@ -130,7 +130,7 @@ spec: done; {{- end}} {{- end}} - {{- if and .Values.proxy.waitBrokerTimeout (not (eq (.Values.proxy.waitBrokerTimeout | toString) "0")) }} + {{- if and .Values.proxy.waitBrokerTimeout (gt (.Values.proxy.waitBrokerTimeout | int) 0) }} # This init container will wait for at least one broker to be ready before # deploying the proxy - name: wait-broker-ready diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 0deb9caf..2fb61938 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -41,9 +41,9 @@ spec: {{ toYaml .Values.pulsar_metadata.nodeSelector | indent 8 }} {{- end }} initContainers: - {{- if and .Values.pulsar_metadata.waitZookeeperTimeout (ne (.Values.pulsar_metadata.waitZookeeperTimeout | toString) "0") }} + {{- if and .Values.components.zookeeper .Values.pulsar_metadata.waitZookeeperTimeout (gt (.Values.pulsar_metadata.waitZookeeperTimeout | int) 0) }} {{- if .Values.pulsar_metadata.configurationStore }} - - name: wait-cs-ready + - name: wait-zk-cs-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }}" resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} @@ -54,11 +54,11 @@ spec: sleep 3; done; {{- end }} - - name: wait-metastore-ready + - name: wait-zk-metastore-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }}" resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} - command: ["timeout", "{{ .Values.pulsar_metadata.waitMetadataTimeout }}", "sh", "-c"] + command: ["timeout", "{{ .Values.pulsar_metadata.waitZookeeperTimeout }}", "sh", "-c"] args: - >- {{- if $zk := .Values.pulsar_metadata.userProvidedZookeepers }} @@ -76,7 +76,7 @@ spec: done; {{- end }} {{- end }} - {{- if and .Values.pulsar_metadata.waitBookkeeperTimeout (ne (.Values.pulsar_metadata.waitBookkeeperTimeout | toString) "0") }} + {{- if and .Values.pulsar_metadata.waitBookkeeperTimeout (gt (.Values.pulsar_metadata.waitBookkeeperTimeout | int) 0) }} # This initContainer will wait for bookkeeper initnewcluster to complete # before initializing pulsar metadata - name: pulsar-bookkeeper-verify-clusterid diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 05bf37d3..e670237a 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -577,7 +577,6 @@ bookkeeper: gracePeriod: 30 ## Timeout for waiting for bookkeeper cluster metadata to be initialized before starting a bookie waitMetadataTimeout: 600 - waitZookeeperTimeout: 600 resources: requests: memory: 512Mi From e525de2c67ca4e533292f437fec75d4c7045e8ac Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 13:41:31 +0200 Subject: [PATCH 39/67] Improve clarity of Oxia configuration for memory limits --- .ci/clusters/values-oxia.yaml | 5 +++-- .../pulsar/templates/oxia-server-statefulset.yaml | 8 ++++---- charts/pulsar/values.yaml | 14 ++++++++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.ci/clusters/values-oxia.yaml b/.ci/clusters/values-oxia.yaml index e253f0d0..c7aca12c 100644 --- a/.ci/clusters/values-oxia.yaml +++ b/.ci/clusters/values-oxia.yaml @@ -26,5 +26,6 @@ oxia: replicationFactor: 1 server: replicas: 1 - memory: 256Mi - storage: 8Gi \ No newline at end of file + memoryLimit: 256Mi + dbCacheSizeMb: 128 + storageSize: 1Gi diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index 5001d178..20335379 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -50,7 +50,7 @@ spec: - "--log-json" - "--data-dir=/data/db" - "--wal-dir=/data/wal" - - "--db-cache-size-mb=512" + - "--db-cache-size-mb={{ .Values.oxia.server.dbCacheSizeMb }}" {{- if .Values.oxia.pprofEnabled }} - "--profile" {{- end}} @@ -64,8 +64,8 @@ spec: {{- end}} resources: limits: - cpu: {{ .Values.oxia.server.cpu }} - memory: {{ .Values.oxia.server.memory }} + cpu: {{ .Values.oxia.server.cpuLimit }} + memory: {{ .Values.oxia.server.memoryLimit }} volumeMounts: - name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-data mountPath: /data @@ -85,5 +85,5 @@ spec: {{- end}} resources: requests: - storage: {{ .Values.oxia.server.storage }} + storage: {{ .Values.oxia.server.storageSize }} {{- end}} \ No newline at end of file diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index e670237a..ef72b312 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -491,10 +491,16 @@ oxia: ## templates/server-statefulset.yaml server: replicas: 3 - cpu: 1 - memory: 1Gi - storage: 8Gi - # storageClassName: xxx + # CPU limit for the server pod + cpuLimit: 1 + # Memory limit for the server pod + memoryLimit: 1Gi + # Oxia database cache size in MB + dbCacheSizeMb: 512 + # Storage size for the PVC of the server pod + storageSize: 8Gi + # Storage class name for the PVC of the server pod + # storageClassName: existent-storage-class ports: public: 6648 internal: 6649 From 8cad5382d06c76d519a37118c2735e5d1b2d2353 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 13:47:30 +0200 Subject: [PATCH 40/67] Revert changes to _configurationstore.tpl --- charts/pulsar/templates/_configurationstore.tpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/charts/pulsar/templates/_configurationstore.tpl b/charts/pulsar/templates/_configurationstore.tpl index 3dfc3a9c..dbf78d83 100644 --- a/charts/pulsar/templates/_configurationstore.tpl +++ b/charts/pulsar/templates/_configurationstore.tpl @@ -23,10 +23,8 @@ Define configuration store endpoint {{- define "pulsar.configurationStore.service" -}} {{- if .Values.pulsar_metadata.configurationStore }} {{- .Values.pulsar_metadata.configurationStore }} -{{- else if .Values.components.zookeeper -}} -{{ template "pulsar.zookeeper.service" . }} {{- else -}} -{{ template "pulsar.oxia.server.service" . }} +{{ template "pulsar.zookeeper.service" . }} {{- end -}} {{- end -}} @@ -35,7 +33,7 @@ Define configuration store connection string */}} {{- define "pulsar.configurationStore.connect" -}} {{- if .Values.pulsar_metadata.configurationStore }} -{{- template "pulsar.configurationStore.service" . }}:{{ .Values.pulsar_metadata.configurationStorePort | default (ternary 6648 2181 .Values.components.oxia) }} +{{- template "pulsar.configurationStore.service" . }}:{{ .Values.pulsar_metadata.configurationStorePort }} {{- end -}} {{- end -}} From 330827407f1f27f56399597eae3c9480d12f4478 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 13:48:44 +0200 Subject: [PATCH 41/67] Add missing space --- charts/pulsar/templates/autorecovery-statefulset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/autorecovery-statefulset.yaml b/charts/pulsar/templates/autorecovery-statefulset.yaml index 6d43ae89..811b2404 100644 --- a/charts/pulsar/templates/autorecovery-statefulset.yaml +++ b/charts/pulsar/templates/autorecovery-statefulset.yaml @@ -110,7 +110,7 @@ spec: terminationGracePeriodSeconds: {{ .Values.autorecovery.gracePeriod }} serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.autorecovery.component }}" initContainers: - {{- if and .Values.autorecovery.waitBookkeeperTimeout(gt (.Values.autorecovery.waitBookkeeperTimeout | int) 0) }} + {{- if and .Values.autorecovery.waitBookkeeperTimeout (gt (.Values.autorecovery.waitBookkeeperTimeout | int) 0) }} # This initContainer will wait for bookkeeper initnewcluster to complete # before deploying the bookies - name: pulsar-bookkeeper-verify-clusterid From 598d5d40930f1fa9e2912a30d5c7d3b5a793b987 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 13:54:08 +0200 Subject: [PATCH 42/67] Make broker startup work for Oxia --- charts/pulsar/templates/broker-statefulset.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/pulsar/templates/broker-statefulset.yaml b/charts/pulsar/templates/broker-statefulset.yaml index 4278a91d..e13e6d38 100644 --- a/charts/pulsar/templates/broker-statefulset.yaml +++ b/charts/pulsar/templates/broker-statefulset.yaml @@ -239,6 +239,7 @@ spec: bin/apply-config-from-env.py conf/broker.conf; bin/gen-yml-from-env.py conf/functions_worker.yml; echo "OK" > "${statusFilePath:-status}"; + {{- if .Values.components.zookeeper }} {{- include "pulsar.broker.zookeeper.tls.settings" . | nindent 10 }} timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.zookeeper.connect" . }} get {{ template "pulsar.broker.znode" . }}; while [ $? -eq 0 ]; do @@ -246,6 +247,7 @@ spec: sleep 10; timeout 15 bin/pulsar zookeeper-shell -server {{ template "pulsar.zookeeper.connect" . }} get {{ template "pulsar.broker.znode" . }}; done; + {{- end }} cat conf/pulsar_env.sh; OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/pulsar broker; ports: From 21fd39da4da57e4a8a5f4636bd9a92c010b2bcfc Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 13:56:44 +0200 Subject: [PATCH 43/67] Revert changes to .gitignore --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index abd9ae1e..8f642984 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ # Intellij .idea -.gitignore - # Mac **/.DS_Store @@ -20,4 +18,4 @@ PRIVATEKEY PUBLICKEY .vagrant/ pulsarctl-*-*.tar.gz -pulsarctl-*-*/ \ No newline at end of file +pulsarctl-*-*/ From fc319c934e7a5be7239fdf5b929e70559f365da8 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 14:02:53 +0200 Subject: [PATCH 44/67] Remove invalid rules in oxia-coordinator-role --- charts/pulsar/templates/oxia-coordinator-role.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/charts/pulsar/templates/oxia-coordinator-role.yaml b/charts/pulsar/templates/oxia-coordinator-role.yaml index 067045f5..1ecb868d 100644 --- a/charts/pulsar/templates/oxia-coordinator-role.yaml +++ b/charts/pulsar/templates/oxia-coordinator-role.yaml @@ -29,7 +29,4 @@ rules: - apiGroups: [ "" ] resources: [ "configmaps" ] verbs: [ "*" ] - - apiGroups: [ "oxia.streamnative.io" ] - resources: [ "oxiaclusters" ] - verbs: [ "get", "update" ] {{- end }} \ No newline at end of file From 650cdfe711d233474d2e67afb7dc2a6f1545f62f Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 14:06:52 +0200 Subject: [PATCH 45/67] Add "Limit" postfix to coordinator limits in values.yaml --- charts/pulsar/templates/oxia-coordinator-deployment.yaml | 4 ++-- charts/pulsar/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index bef99f32..d4daeee2 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -56,8 +56,8 @@ spec: {{- end}} resources: limits: - cpu: {{ .Values.oxia.coordinator.cpu }} - memory: {{ .Values.oxia.coordinator.memory }} + cpu: {{ .Values.oxia.coordinator.cpuLimit }} + memory: {{ .Values.oxia.coordinator.memoryLimit }} livenessProbe: {{- include "oxia-cluster.probe" .Values.oxia.coordinator.ports.internal | nindent 12 }} readinessProbe: diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index ef72b312..76f7c8b5 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -483,8 +483,8 @@ oxia: replicationFactor: 3 ## templates/coordinator-deployment.yaml coordinator: - cpu: 100m - memory: 128Mi + cpuLimit: 100m + memoryLimit: 128Mi ports: internal: 6649 metrics: 8080 From 50d4986528743e0e460ea9bbf2ebcd1d7f1c893c Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 14:25:24 +0200 Subject: [PATCH 46/67] Use podmonitor to enable metrics for Oxia coordinator and server components --- .ci/values-common.yaml | 8 +++ .../oxia-coordinator-deployment.yaml | 4 +- .../oxia-coordinator-podmonitor.yaml | 58 +++++++++++++++++++ .../templates/oxia-server-podmonitor.yaml | 58 +++++++++++++++++++ .../templates/oxia-server-statefulset.yaml | 4 +- charts/pulsar/values.yaml | 17 +++++- 6 files changed, 142 insertions(+), 7 deletions(-) create mode 100644 charts/pulsar/templates/oxia-coordinator-podmonitor.yaml create mode 100644 charts/pulsar/templates/oxia-server-podmonitor.yaml diff --git a/.ci/values-common.yaml b/.ci/values-common.yaml index 65f23248..c8b99131 100644 --- a/.ci/values-common.yaml +++ b/.ci/values-common.yaml @@ -86,3 +86,11 @@ proxy: toolset: useProxy: false + +oxia: + coordinator: + podMonitor: + enabled: false + server: + podMonitor: + enabled: false diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index d4daeee2..f379d66e 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -34,10 +34,8 @@ spec: type: Recreate template: metadata: - annotations: - prometheus.io/port: "{{ .Values.oxia.coordinator.ports.metrics }}" - prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}" labels: + {{- include "pulsar.template.labels" . | nindent 8 }} oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.coordinator.labels" . | nindent 8 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator diff --git a/charts/pulsar/templates/oxia-coordinator-podmonitor.yaml b/charts/pulsar/templates/oxia-coordinator-podmonitor.yaml new file mode 100644 index 00000000..fa3c8cb6 --- /dev/null +++ b/charts/pulsar/templates/oxia-coordinator-podmonitor.yaml @@ -0,0 +1,58 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy oxia-coordinator PodMonitor only when `$.Values.oxia.podMonitor.enabled` is true +{{- if $.Values.oxia.coordinator.podMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ template "pulsar.fullname" . }}-oxia-coordinator + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + jobLabel: oxia-coordinator + podMetricsEndpoints: + - port: metrics + path: /metrics + scheme: http + interval: {{ $.Values.oxia.coordinator.podMonitor.interval }} + scrapeTimeout: {{ $.Values.oxia.coordinator.podMonitor.scrapeTimeout }} + relabelings: + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: kubernetes_namespace + - sourceLabels: [__meta_kubernetes_pod_label_component] + action: replace + targetLabel: job + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: kubernetes_pod_name + {{- if $.Values.oxia.coordinator.podMonitor.metricRelabelings }} + metricRelabelings: {{ toYaml $.Values.oxia.coordinator.podMonitor.metricRelabelings | nindent 8 }} + {{- end }} + selector: + matchLabels: + {{- include "pulsar.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: oxia-coordinator +{{- end }} diff --git a/charts/pulsar/templates/oxia-server-podmonitor.yaml b/charts/pulsar/templates/oxia-server-podmonitor.yaml new file mode 100644 index 00000000..6cb40010 --- /dev/null +++ b/charts/pulsar/templates/oxia-server-podmonitor.yaml @@ -0,0 +1,58 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# deploy oxia-server PodMonitor only when `$.Values.oxia.podMonitor.enabled` is true +{{- if $.Values.oxia.server.podMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ template "pulsar.fullname" . }}-oxia-server + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + jobLabel: oxia-server + podMetricsEndpoints: + - port: metrics + path: /metrics + scheme: http + interval: {{ $.Values.oxia.server.podMonitor.interval }} + scrapeTimeout: {{ $.Values.oxia.server.podMonitor.scrapeTimeout }} + relabelings: + - action: labelmap + regex: __meta_kubernetes_pod_label_(.+) + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: kubernetes_namespace + - sourceLabels: [__meta_kubernetes_pod_label_component] + action: replace + targetLabel: job + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: kubernetes_pod_name + {{- if $.Values.oxia.server.podMonitor.metricRelabelings }} + metricRelabelings: {{ toYaml $.Values.oxia.server.podMonitor.metricRelabelings | nindent 8 }} + {{- end }} + selector: + matchLabels: + {{- include "pulsar.matchLabels" . | nindent 6 }} + app.kubernetes.io/component: oxia-server +{{- end }} diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index 20335379..c7f58777 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -34,10 +34,8 @@ spec: podManagementPolicy: Parallel template: metadata: - annotations: - prometheus.io/port: "{{ .Values.oxia.server.ports.metrics }}" - prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}" labels: + {{- include "pulsar.template.labels" . | nindent 8 }} oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.server.labels" . | nindent 8 }} name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 76f7c8b5..7b8b1f52 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -483,6 +483,14 @@ oxia: replicationFactor: 3 ## templates/coordinator-deployment.yaml coordinator: + # This is how prometheus discovers this component + podMonitor: + enabled: true + interval: 60s + scrapeTimeout: 60s + metricRelabelings: + # - action: labeldrop + # regex: cluster cpuLimit: 100m memoryLimit: 128Mi ports: @@ -490,6 +498,14 @@ oxia: metrics: 8080 ## templates/server-statefulset.yaml server: + # This is how prometheus discovers this component + podMonitor: + enabled: true + interval: 60s + scrapeTimeout: 60s + metricRelabelings: + # - action: labeldrop + # regex: cluster replicas: 3 # CPU limit for the server pod cpuLimit: 1 @@ -506,7 +522,6 @@ oxia: internal: 6649 metrics: 8080 pprofEnabled: false - monitoringEnabled: false service_account: annotations: {} ## Pulsar: Bookkeeper cluster From 682a51f9c2a4be50389a92ea16cdb1d8b32f2ee2 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 14:38:19 +0200 Subject: [PATCH 47/67] Remove redundant servicemonitor templates --- .../oxia-coordinator-servicemonitor.yaml | 38 ------------------- .../templates/oxia-server-servicemonitor.yaml | 38 ------------------- 2 files changed, 76 deletions(-) delete mode 100644 charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml delete mode 100644 charts/pulsar/templates/oxia-server-servicemonitor.yaml diff --git a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml b/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml deleted file mode 100644 index 1eb1f255..00000000 --- a/charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -{{- if .Values.components.oxia }} -{{- if .Values.monitoringEnabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} - name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator - namespace: {{ template "pulsar.namespace" . }} -spec: - endpoints: - - port: metrics - selector: - matchLabels: - {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 6 }} - targetLabels: - - oxia_cluster -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-servicemonitor.yaml b/charts/pulsar/templates/oxia-server-servicemonitor.yaml deleted file mode 100644 index 69b4deb7..00000000 --- a/charts/pulsar/templates/oxia-server-servicemonitor.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -{{- if .Values.components.oxia }} -{{- if .Values.monitoringEnabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} - namespace: {{ template "pulsar.namespace" . }} -spec: - endpoints: - - port: metrics - selector: - matchLabels: - {{- include "oxia-cluster.server.selectorLabels" . | nindent 6 }} - targetLabels: - - oxia_cluster -{{- end }} -{{- end }} \ No newline at end of file From e57c0504868dc8d7bd9d20952f4214f5be683a7a Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 14:41:07 +0200 Subject: [PATCH 48/67] Enable oxia podmonitors only when oxia is enabled --- charts/pulsar/templates/oxia-coordinator-podmonitor.yaml | 2 +- charts/pulsar/templates/oxia-server-podmonitor.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pulsar/templates/oxia-coordinator-podmonitor.yaml b/charts/pulsar/templates/oxia-coordinator-podmonitor.yaml index fa3c8cb6..cddcba38 100644 --- a/charts/pulsar/templates/oxia-coordinator-podmonitor.yaml +++ b/charts/pulsar/templates/oxia-coordinator-podmonitor.yaml @@ -18,7 +18,7 @@ # # deploy oxia-coordinator PodMonitor only when `$.Values.oxia.podMonitor.enabled` is true -{{- if $.Values.oxia.coordinator.podMonitor.enabled }} +{{- if and $.Values.components.oxia $.Values.oxia.coordinator.podMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: diff --git a/charts/pulsar/templates/oxia-server-podmonitor.yaml b/charts/pulsar/templates/oxia-server-podmonitor.yaml index 6cb40010..6f2f6122 100644 --- a/charts/pulsar/templates/oxia-server-podmonitor.yaml +++ b/charts/pulsar/templates/oxia-server-podmonitor.yaml @@ -18,7 +18,7 @@ # # deploy oxia-server PodMonitor only when `$.Values.oxia.podMonitor.enabled` is true -{{- if $.Values.oxia.server.podMonitor.enabled }} +{{- if and $.Values.components.oxia $.Values.oxia.server.podMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: From cd4b293f2c1e5127ceb228d6069415e52e186f46 Mon Sep 17 00:00:00 2001 From: Yuwei Sung Date: Thu, 21 Nov 2024 07:29:55 -0600 Subject: [PATCH 49/67] fix oxia tpl --- charts/pulsar/templates/_oxia.tpl | 8 +------- charts/pulsar/templates/oxia-coordinator-deployment.yaml | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 552ecbbf..414ea355 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -31,9 +31,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} Coordinator selector labels */}} {{- define "oxia-cluster.coordinator.selectorLabels" -}} -app.kubernetes.io/name: {{ .Chart.Name }} app.kubernetes.io/component: oxia-coordinator -app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* @@ -41,17 +39,13 @@ Server labels */}} {{- define "oxia-cluster.server.labels" -}} {{ include "oxia-cluster.server.selectorLabels" . }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* Server selector labels */}} {{- define "oxia-cluster.server.selectorLabels" -}} -app.kubernetes.io/name: {{ .Chart.Name }} -app.kubernetes.io/component: oxia-server -app.kubernetes.io/instance: {{ .Release.Name }} +component: oxia-server {{- end }} {{/* diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index f379d66e..7e3b7a80 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -30,6 +30,8 @@ spec: selector: matchLabels: {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 6 }} + {{- include "pulsar.matchLabels" . | nindent 6 }} + component: {{ .Values.oxia.component }} strategy: type: Recreate template: @@ -38,6 +40,8 @@ spec: {{- include "pulsar.template.labels" . | nindent 8 }} oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} {{- include "oxia-cluster.coordinator.labels" . | nindent 8 }} + {{- include "pulsar.matchLabels" . | nindent 8 }} + component: {{ .Values.oxia.component }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator spec: serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator From 2ec9cd5248e07b250bd9bc9958186b7e0b773f9d Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 22:25:38 +0200 Subject: [PATCH 50/67] Use similar solution for matchLabels and labels in Oxia components as there are in other components --- charts/pulsar/templates/_oxia.tpl | 31 ------------------- .../templates/oxia-coordinator-configmap.yaml | 5 +-- .../oxia-coordinator-deployment.yaml | 17 +++++----- .../templates/oxia-coordinator-role.yaml | 5 +-- .../oxia-coordinator-rolebinding.yaml | 5 +-- .../templates/oxia-coordinator-service.yaml | 11 ++++--- .../oxia-coordinator-serviceaccount.yaml | 9 ++++-- .../templates/oxia-server-service-public.yaml | 13 ++++---- .../pulsar/templates/oxia-server-service.yaml | 11 ++++--- .../templates/oxia-server-serviceaccount.yaml | 7 +++-- .../templates/oxia-server-statefulset.yaml | 17 +++++----- charts/pulsar/values.yaml | 13 ++++++-- 12 files changed, 68 insertions(+), 76 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 414ea355..6b9b5916 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -17,37 +17,6 @@ specific language governing permissions and limitations under the License. */}} -{{/* -Coordinator labels -*/}} -{{- define "oxia-cluster.coordinator.labels" -}} -{{ include "oxia-cluster.coordinator.selectorLabels" . }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -app.kubernetes.io/part-of: oxia -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Coordinator selector labels -*/}} -{{- define "oxia-cluster.coordinator.selectorLabels" -}} -app.kubernetes.io/component: oxia-coordinator -{{- end }} - -{{/* -Server labels -*/}} -{{- define "oxia-cluster.server.labels" -}} -{{ include "oxia-cluster.server.selectorLabels" . }} -{{- end }} - -{{/* -Server selector labels -*/}} -{{- define "oxia-cluster.server.selectorLabels" -}} -component: oxia-server -{{- end }} - {{/* Probe */}} diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml index 53742efd..577dac0b 100644 --- a/charts/pulsar/templates/oxia-coordinator-configmap.yaml +++ b/charts/pulsar/templates/oxia-coordinator-configmap.yaml @@ -20,10 +20,11 @@ apiVersion: v1 kind: ConfigMap metadata: - labels: - {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-coordinator data: config.yaml: | {{- include "oxia.coordinator.config.yaml" . | nindent 4 }} diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index 7e3b7a80..ef2d9818 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -21,28 +21,27 @@ apiVersion: apps/v1 kind: Deployment metadata: - labels: - {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-coordinator spec: replicas: 1 selector: matchLabels: - {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 6 }} {{- include "pulsar.matchLabels" . | nindent 6 }} - component: {{ .Values.oxia.component }} + component: {{ .Values.oxia.component }}-coordinator strategy: type: Recreate template: metadata: labels: {{- include "pulsar.template.labels" . | nindent 8 }} - oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} - {{- include "oxia-cluster.coordinator.labels" . | nindent 8 }} - {{- include "pulsar.matchLabels" . | nindent 8 }} - component: {{ .Values.oxia.component }} - name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator + component: {{ .Values.oxia.component }}-coordinator + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "{{ .Values.oxia.coordinator.ports.metrics }}" spec: serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator containers: diff --git a/charts/pulsar/templates/oxia-coordinator-role.yaml b/charts/pulsar/templates/oxia-coordinator-role.yaml index 1ecb868d..39cfbbd8 100644 --- a/charts/pulsar/templates/oxia-coordinator-role.yaml +++ b/charts/pulsar/templates/oxia-coordinator-role.yaml @@ -21,10 +21,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - labels: - {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-coordinator rules: - apiGroups: [ "" ] resources: [ "configmaps" ] diff --git a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml index 686ccb90..354d8df1 100644 --- a/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml +++ b/charts/pulsar/templates/oxia-coordinator-rolebinding.yaml @@ -21,10 +21,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - labels: - {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-coordinator subjects: - kind: ServiceAccount name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator diff --git a/charts/pulsar/templates/oxia-coordinator-service.yaml b/charts/pulsar/templates/oxia-coordinator-service.yaml index e71d300e..3e3cc59b 100644 --- a/charts/pulsar/templates/oxia-coordinator-service.yaml +++ b/charts/pulsar/templates/oxia-coordinator-service.yaml @@ -21,12 +21,12 @@ apiVersion: v1 kind: Service metadata: - labels: - oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} - {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} -{{- with .Values.oxia.service_account.annotations }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-coordinator +{{- with .Values.oxia.coordinator.service.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} @@ -38,5 +38,6 @@ spec: targetPort: {{ $key }} {{- end}} selector: - {{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 4 }} + {{- include "pulsar.matchLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-coordinator {{- end }} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml index 66de1394..fbed0041 100644 --- a/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml @@ -20,10 +20,15 @@ apiVersion: v1 kind: ServiceAccount metadata: - labels: - {{- include "oxia-cluster.coordinator.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-coordinator +{{- with .Values.oxia.coordinator.service_account.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} {{- if .Values.images.imagePullSecrets }} imagePullSecrets: - name: {{ .Values.images.imagePullSecrets.secretName }} diff --git a/charts/pulsar/templates/oxia-server-service-public.yaml b/charts/pulsar/templates/oxia-server-service-public.yaml index 225f4bd7..ff328af1 100644 --- a/charts/pulsar/templates/oxia-server-service-public.yaml +++ b/charts/pulsar/templates/oxia-server-service-public.yaml @@ -21,12 +21,12 @@ apiVersion: v1 kind: Service metadata: - labels: - oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} - {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} -{{- with .Values.oxia.service_account.annotations }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-server +{{- with .Values.oxia.server.service.public.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} @@ -38,5 +38,6 @@ spec: targetPort: {{ $key }} {{- end}} selector: - {{- include "oxia-cluster.server.selectorLabels" . | nindent 4 }} -{{- end}} \ No newline at end of file + {{- include "pulsar.matchLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-server +{{- end}} diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index 322b3bde..0af506b6 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -20,12 +20,12 @@ apiVersion: v1 kind: Service metadata: - labels: - oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} - {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc namespace: {{ template "pulsar.namespace" . }} -{{- with .Values.oxia.service_account.annotations }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-server +{{- with .Values.oxia.server.service.internal.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} @@ -39,5 +39,6 @@ spec: targetPort: {{ $key }} {{- end}} selector: - {{- include "oxia-cluster.server.selectorLabels" . | nindent 4 }} + {{- include "pulsar.matchLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-server {{- end}} \ No newline at end of file diff --git a/charts/pulsar/templates/oxia-server-serviceaccount.yaml b/charts/pulsar/templates/oxia-server-serviceaccount.yaml index a990e497..3158a9d4 100644 --- a/charts/pulsar/templates/oxia-server-serviceaccount.yaml +++ b/charts/pulsar/templates/oxia-server-serviceaccount.yaml @@ -20,11 +20,12 @@ apiVersion: v1 kind: ServiceAccount metadata: - labels: - {{- include "oxia-cluster.server.labels" . | nindent 4 }} name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} namespace: {{ template "pulsar.namespace" . }} -{{- with .Values.oxia.service_account.annotations }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-server +{{- with .Values.oxia.server.service_account.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index c7f58777..bc2387ee 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -21,24 +21,27 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - labels: - {{- include "oxia-cluster.server.labels" . | nindent 4 }} - name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} + name: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-server namespace: {{ template "pulsar.namespace" . }} + labels: + {{- include "pulsar.standardLabels" . | nindent 4 }} + component: {{ .Values.oxia.component }}-server spec: replicas: {{ .Values.oxia.server.replicas }} selector: matchLabels: - {{- include "oxia-cluster.server.selectorLabels" . | nindent 6 }} + {{- include "pulsar.matchLabels" . | nindent 6 }} + component: {{ .Values.oxia.component }}-server serviceName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-svc podManagementPolicy: Parallel template: metadata: labels: {{- include "pulsar.template.labels" . | nindent 8 }} - oxia_cluster: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} - {{- include "oxia-cluster.server.labels" . | nindent 8 }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}" + component: {{ .Values.oxia.component }}-server + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "{{ .Values.oxia.server.ports.metrics }}" spec: serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} containers: diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 7b8b1f52..6c6c9f78 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -496,6 +496,10 @@ oxia: ports: internal: 6649 metrics: 8080 + service: + annotations: {} + service_account: + annotations: {} ## templates/server-statefulset.yaml server: # This is how prometheus discovers this component @@ -521,9 +525,14 @@ oxia: public: 6648 internal: 6649 metrics: 8080 + service: + public: + annotations: {} + internal: + annotations: {} + service_account: + annotations: {} pprofEnabled: false - service_account: - annotations: {} ## Pulsar: Bookkeeper cluster ## templates/bookkeeper-statefulset.yaml ## From 456433206a29d6c02675a13b7631ecc68c5d39dd Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 22:55:11 +0200 Subject: [PATCH 51/67] Validate Oxia templates with kubeconform --- .github/workflows/pulsar-helm-chart-ci.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pulsar-helm-chart-ci.yaml b/.github/workflows/pulsar-helm-chart-ci.yaml index b19e1abf..04354776 100644 --- a/.github/workflows/pulsar-helm-chart-ci.yaml +++ b/.github/workflows/pulsar-helm-chart-ci.yaml @@ -140,15 +140,22 @@ jobs: helm dependency build charts/pulsar validate_helm_template_with_k8s_version() { local kube_version=$1 - echo "Validating helm template with kubeconform for k8s version $kube_version" - helm template charts/pulsar --set kube-prometheus-stack.enabled=false --set components.pulsar_manager=true --kube-version $kube_version | \ + shift + echo -n "Validating helm template with kubeconform for k8s version $kube_version" + if [ -n "$@" ]; then + echo " Extra args: $@" + else + echo "" + fi + helm template charts/pulsar --set kube-prometheus-stack.enabled=false --set components.pulsar_manager=true --kube-version $kube_version "$@" | \ kubeconform -schema-location default -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' -strict -kubernetes-version $kube_version -summary } set -o pipefail for k8s_version_part in {23..30}; do k8s_version="1.${k8s_version_part}.0" - echo "Validating helm template with kubeconform for k8s version $k8s_version" validate_helm_template_with_k8s_version $k8s_version + echo "Validating with Oxia enabled" + validate_helm_template_with_k8s_version $k8s_version --set components.zookeeper=false --set components.oxia=true done - name: Wait for ssh connection when build fails # ssh access is enabled for builds in own forks From 12550184dde9a37c21a0083bc7db22a50290e889 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 23:05:03 +0200 Subject: [PATCH 52/67] Fix extra args logging --- .github/workflows/pulsar-helm-chart-ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pulsar-helm-chart-ci.yaml b/.github/workflows/pulsar-helm-chart-ci.yaml index 04354776..027647e9 100644 --- a/.github/workflows/pulsar-helm-chart-ci.yaml +++ b/.github/workflows/pulsar-helm-chart-ci.yaml @@ -142,8 +142,8 @@ jobs: local kube_version=$1 shift echo -n "Validating helm template with kubeconform for k8s version $kube_version" - if [ -n "$@" ]; then - echo " Extra args: $@" + if [ $# -gt 0 ]; then + echo " Extra args: $*" else echo "" fi From 3d9abca185772e483b2735ed6b82503f19159847 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 23:17:48 +0200 Subject: [PATCH 53/67] Wait for Oxia in initialization --- .../templates/pulsar-cluster-initialize.yaml | 14 +++++++++++--- charts/pulsar/values.yaml | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 2fb61938..066b5fc7 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -70,11 +70,19 @@ spec: until nslookup {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ add (.Values.zookeeper.replicaCount | int) -1 }}.{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}.{{ template "pulsar.namespace" . }}; do sleep 3; done; - {{ else }} - until nslookup {{ include "pulsar.oxia.server.service" . }}; do + {{- end }} + {{- end }} + {{- if and .Values.components.oxia .Values.pulsar_metadata.waitOxiaTimeout (gt (.Values.pulsar_metadata.waitOxiaTimeout | int) 0) }} + - name: wait-oxia-ready + image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" + imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.pulsar_metadata.image "root" .) }}" + resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} + command: ["timeout", "{{ .Values.pulsar_metadata.waitOxiaTimeout }}", "sh", "-c"] + args: + - >- + until nslookup {{ template "pulsar.oxia.server.service" . }}; do sleep 3; done; - {{- end }} {{- end }} {{- if and .Values.pulsar_metadata.waitBookkeeperTimeout (gt (.Values.pulsar_metadata.waitBookkeeperTimeout | int) 0) }} # This initContainer will wait for bookkeeper initnewcluster to complete diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 6c6c9f78..cd11b73e 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -835,10 +835,10 @@ pulsar_metadata: configurationStoreMetadataPrefix: "" # the configuration store port. This setting applies only when zookeeper is enabled. configurationStorePort: 2181 - ## Timeout for waiting for zookeeper or oxia to become available before running metadata initialization - waitMetadataTimeout: 600 # the zookeeper timeout. This setting applies only when zookeeper is enabled. waitZookeeperTimeout: 600 + ## Timeout for waiting for oxia to be available before running metadata initialization. This setting applies only when oxia is enabled. + waitOxiaTimeout: 600 ## Timeout for waiting for bookkeeper to be initialized before running metadata initialization waitBookkeeperTimeout: 120 ## Timeout for running metadata initialization From ea2f387b449957a8b574fe7869c16101be22c993 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 23:20:42 +0200 Subject: [PATCH 54/67] Wait for Oxia before bookkeeper initialization --- .../templates/bookkeeper-cluster-initialize.yaml | 12 ++++++++++++ charts/pulsar/values.yaml | 2 ++ 2 files changed, 14 insertions(+) diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index 48b6d8c4..bfee3a6b 100755 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -64,6 +64,18 @@ spec: done; {{- end}} {{- end}} + {{- if and .Values.components.oxia .Values.bookkeeper.metadata.waitOxiaTimeout (gt (.Values.bookkeeper.metadata.waitOxiaTimeout | int) 0) }} + - name: wait-oxia-ready + image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" + imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.images.bookie "root" .) }}" + resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} + command: ["timeout", "{{ .Values.bookkeeper.metadata.waitOxiaTimeout }}", "sh", "-c"] + args: + - >- + until nslookup {{ template "pulsar.oxia.server.service" . }}; do + sleep 3; + done; + {{- end }} containers: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-init" image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index cd11b73e..38b42e5b 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -547,6 +547,8 @@ bookkeeper: waitZookeeperTimeout: 600 ## Timeout for running metadata initialization initTimeout: 60 + ## Timeout for waiting for oxia to be available before running metadata initialization. This setting applies only when oxia is enabled. + waitOxiaTimeout: 600 ## Set the resources used for running `bin/bookkeeper shell initnewcluster` ## resources: From c26126b54c0d6b8575d935bb11fd52ff23909658 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 23:25:34 +0200 Subject: [PATCH 55/67] Add waiting for Oxia before broker and proxy get started --- charts/pulsar/templates/broker-statefulset.yaml | 12 ++++++++++++ charts/pulsar/templates/proxy-statefulset.yaml | 12 ++++++++++++ charts/pulsar/values.yaml | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/charts/pulsar/templates/broker-statefulset.yaml b/charts/pulsar/templates/broker-statefulset.yaml index e13e6d38..45915ffe 100644 --- a/charts/pulsar/templates/broker-statefulset.yaml +++ b/charts/pulsar/templates/broker-statefulset.yaml @@ -154,6 +154,18 @@ spec: volumeMounts: {{- include "pulsar.broker.certs.volumeMounts" . | nindent 8 }} {{- end }} + {{- if and .Values.components.oxia .Values.broker.waitOxiaTimeout (gt (.Values.broker.waitOxiaTimeout | int) 0) }} + - name: wait-oxia-ready + image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.broker "root" .) }}" + imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.images.broker "root" .) }}" + resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} + command: ["timeout", "{{ .Values.broker.waitOxiaTimeout }}", "sh", "-c"] + args: + - >- + until nslookup {{ template "pulsar.oxia.server.service" . }}; do + sleep 3; + done; + {{- end }} {{- if and .Values.broker.waitBookkeeperTimeout (gt (.Values.broker.waitBookkeeperTimeout | int) 0) }} # This init container will wait for bookkeeper to be ready before # deploying the broker diff --git a/charts/pulsar/templates/proxy-statefulset.yaml b/charts/pulsar/templates/proxy-statefulset.yaml index 42d49d35..d2728d82 100644 --- a/charts/pulsar/templates/proxy-statefulset.yaml +++ b/charts/pulsar/templates/proxy-statefulset.yaml @@ -130,6 +130,18 @@ spec: done; {{- end}} {{- end}} + {{- if and .Values.components.oxia .Values.proxy.waitOxiaTimeout (gt (.Values.proxy.waitOxiaTimeout | int) 0) }} + - name: wait-oxia-ready + image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.proxy "root" .) }}" + imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.images.proxy "root" .) }}" + resources: {{ toYaml .Values.initContainer.resources | nindent 10 }} + command: ["timeout", "{{ .Values.proxy.waitOxiaTimeout }}", "sh", "-c"] + args: + - >- + until nslookup {{ template "pulsar.oxia.server.service" . }}; do + sleep 3; + done; + {{- end }} {{- if and .Values.proxy.waitBrokerTimeout (gt (.Values.proxy.waitBrokerTimeout | int) 0) }} # This init container will wait for at least one broker to be ready before # deploying the proxy diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 38b42e5b..d5973cf8 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -936,6 +936,8 @@ broker: gracePeriod: 30 ## Timeout for waiting for zookeeper to become available before starting a broker waitZookeeperTimeout: 600 + ## Timeout for waiting for oxia to be available before starting a broker. This setting applies only when oxia is enabled. + waitOxiaTimeout: 600 ## Timeout for waiting for bookkeeper to become available before starting a broker waitBookkeeperTimeout: 120 resources: @@ -1176,6 +1178,8 @@ proxy: gracePeriod: 30 ## Timeout for waiting for zookeeper to become available before starting a proxy waitZookeeperTimeout: 600 + ## Timeout for waiting for oxia to be available before starting a proxy. This setting applies only when oxia is enabled. + waitOxiaTimeout: 600 ## Timeout for waiting for brokers to become available before starting a proxy waitBrokerTimeout: 120 resources: From c4ec6bf4b7efaadc8e5212baa609ae712f11f7ba Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 21 Nov 2024 23:31:27 +0200 Subject: [PATCH 56/67] Use most recent Oxia version --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index d5973cf8..49eeea8a 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -206,7 +206,7 @@ images: hasCommand: false oxia: repository: streamnative/oxia - tag: 0.11.3 + tag: 0.11.9 pullPolicy: Always ## TLS From f1bbc4f570fd639e4d69505583f4395917ea09f8 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 00:18:18 +0200 Subject: [PATCH 57/67] Add default shard Attempt to fix io.grpc.StatusRuntimeException: UNIMPLEMENTED: unknown service io.streamnative.oxia.proto.OxiaClient Since found this error in the logs: rpc error: code = Code(110) desc = oxia: namespace not found Failed to add client for shards assignments notifications --- charts/pulsar/templates/_oxia.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 6b9b5916..05cb115e 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -78,6 +78,9 @@ Define coordinator configmap */}} {{- define "oxia.coordinator.config.yaml" -}} namespaces: + - name: default + initialShardCount: {{ .Values.oxia.initialShardCount }} + replicationFactor: {{ .Values.oxia.replicationFactor }} - name: broker initialShardCount: {{ .Values.oxia.initialShardCount }} replicationFactor: {{ .Values.oxia.replicationFactor }} From 39319b55cdc2685da97cde92b22adfa771f746e1 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 00:37:01 +0200 Subject: [PATCH 58/67] Downgrade Oxia to 0.8.0 to match oxia-java 0.4.5 --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 49eeea8a..b1b71608 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -206,7 +206,7 @@ images: hasCommand: false oxia: repository: streamnative/oxia - tag: 0.11.9 + tag: 0.8.0 pullPolicy: Always ## TLS From 7f2909f318e6754dff0c78e12428afa5fbcb446c Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 00:58:07 +0200 Subject: [PATCH 59/67] Use public port for connecting --- charts/pulsar/templates/_oxia.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 05cb115e..95afc5f7 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -60,7 +60,7 @@ oxia url for broker metadata */}} {{- define "pulsar.oxia.metadata.url.broker" -}} {{- if .Values.components.oxia -}} -oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }}/broker +oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.public }}/broker {{- end -}} {{- end -}} @@ -69,7 +69,7 @@ oxia url for bookkeeper metadata */}} {{- define "pulsar.oxia.metadata.url.bookkeeper" -}} {{- if .Values.components.oxia -}} -metadata-store:oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.internal }}/bookkeeper +metadata-store:oxia://{{ template "pulsar.oxia.server.service" . }}:{{ .Values.oxia.server.ports.public }}/bookkeeper {{- end -}} {{- end -}} From d58676cc6293ee7abcf2aecf9196be1cdfdc9bbb Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 01:06:22 +0200 Subject: [PATCH 60/67] Add mandatory configuration-store parameter to initialization --- charts/pulsar/templates/pulsar-cluster-initialize.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 066b5fc7..ad3a53d2 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -144,6 +144,7 @@ spec: bin/pulsar initialize-cluster-metadata \ --cluster {{ template "pulsar.cluster.name" . }} \ --metadata-store "{{ template "pulsar.oxia.metadata.url.broker" . }}" \ + --configuration-store "{{ template "pulsar.oxia.metadata.url.broker" . }}" \ --web-service-url http://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.http }}/ \ --web-service-url-tls https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.https }}/ \ --broker-service-url pulsar://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}:{{ .Values.broker.ports.pulsar }}/ \ From 8a0bd8f8ee7fd85808f497aecea55d38d05f0890 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 01:06:43 +0200 Subject: [PATCH 61/67] Revert "Downgrade Oxia to 0.8.0 to match oxia-java 0.4.5" This reverts commit 39319b55cdc2685da97cde92b22adfa771f746e1. --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index b1b71608..49eeea8a 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -206,7 +206,7 @@ images: hasCommand: false oxia: repository: streamnative/oxia - tag: 0.8.0 + tag: 0.11.9 pullPolicy: Always ## TLS From 214a8b07f74dbe9b8755d0803076818a9b3977dc Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 01:30:35 +0200 Subject: [PATCH 62/67] Add support for nodeSelector, tolerations, topologySpreadConstraints, affinity and securityContext --- .../oxia-coordinator-deployment.yaml | 8 +++ .../pulsar/templates/oxia-server-service.yaml | 1 + .../templates/oxia-server-statefulset.yaml | 57 +++++++++++++++++++ charts/pulsar/values.yaml | 18 ++++++ 4 files changed, 84 insertions(+) diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index ef2d9818..3739c412 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -43,6 +43,14 @@ spec: prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.oxia.coordinator.ports.metrics }}" spec: + {{- if .Values.oxia.server.nodeSelector }} + nodeSelector: +{{ toYaml .Values.oxia.server.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.oxia.server.tolerations }} + tolerations: +{{ toYaml .Values.oxia.server.tolerations | indent 8 }} + {{- end }} serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator containers: - command: diff --git a/charts/pulsar/templates/oxia-server-service.yaml b/charts/pulsar/templates/oxia-server-service.yaml index 0af506b6..2daccd6f 100644 --- a/charts/pulsar/templates/oxia-server-service.yaml +++ b/charts/pulsar/templates/oxia-server-service.yaml @@ -16,6 +16,7 @@ # specific language governing permissions and limitations # under the License. # + {{- if .Values.components.oxia }} apiVersion: v1 kind: Service diff --git a/charts/pulsar/templates/oxia-server-statefulset.yaml b/charts/pulsar/templates/oxia-server-statefulset.yaml index bc2387ee..d6d7f418 100644 --- a/charts/pulsar/templates/oxia-server-statefulset.yaml +++ b/charts/pulsar/templates/oxia-server-statefulset.yaml @@ -43,7 +43,64 @@ spec: prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.oxia.server.ports.metrics }}" spec: + {{- if .Values.oxia.server.nodeSelector }} + nodeSelector: +{{ toYaml .Values.oxia.server.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.oxia.server.tolerations }} + tolerations: +{{ toYaml .Values.oxia.server.tolerations | indent 8 }} + {{- end }} + {{- if .Values.oxia.server.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml .Values.oxia.server.topologySpreadConstraints | nindent 8 }} + {{- end }} + affinity: + {{- if and .Values.affinity.anti_affinity .Values.oxia.server.affinity.anti_affinity}} + podAntiAffinity: + {{ if eq .Values.oxia.server.affinity.type "requiredDuringSchedulingIgnoredDuringExecution"}} + {{ .Values.oxia.server.affinity.type }}: + - labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - "{{ template "pulsar.name" . }}" + - key: "release" + operator: In + values: + - {{ .Release.Name }} + - key: "component" + operator: In + values: + - {{ .Values.oxia.component }}-server + topologyKey: {{ .Values.oxia.server.affinity.anti_affinity_topology_key }} + {{ else }} + {{ .Values.oxia.server.affinity.type }}: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - "{{ template "pulsar.name" . }}" + - key: "release" + operator: In + values: + - {{ .Release.Name }} + - key: "component" + operator: In + values: + - {{ .Values.oxia.component }}-server + topologyKey: {{ .Values.oxia.server.affinity.anti_affinity_topology_key }} + {{ end }} + {{- end }} serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }} + {{- if .Values.oxia.server.securityContext }} + securityContext: +{{ toYaml .Values.oxia.server.securityContext | indent 8 }} + {{- end }} containers: - command: - "oxia" diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 49eeea8a..f038713b 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -500,6 +500,9 @@ oxia: annotations: {} service_account: annotations: {} + tolerations: [] + # nodeSelector: + # cloud.google.com/gke-nodepool: default-pool ## templates/server-statefulset.yaml server: # This is how prometheus discovers this component @@ -532,6 +535,21 @@ oxia: annotations: {} service_account: annotations: {} + securityContext: + fsGroup: 0 + fsGroupChangePolicy: "OnRootMismatch" + affinity: + anti_affinity: true + anti_affinity_topology_key: kubernetes.io/hostname + # Set the anti affinity type. Valid values: + # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica + # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee + type: requiredDuringSchedulingIgnoredDuringExecution + # set topologySpreadConstraint to deploy pods across different zones + topologySpreadConstraints: [] + tolerations: [] + # nodeSelector: + # cloud.google.com/gke-nodepool: default-pool pprofEnabled: false ## Pulsar: Bookkeeper cluster ## templates/bookkeeper-statefulset.yaml From 02c7f98908a755d4cdbdf34ebc0595f0183855f6 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 01:38:31 +0200 Subject: [PATCH 63/67] Trim trailing whitespace --- charts/pulsar/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index f038713b..401d0894 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -537,7 +537,7 @@ oxia: annotations: {} securityContext: fsGroup: 0 - fsGroupChangePolicy: "OnRootMismatch" + fsGroupChangePolicy: "OnRootMismatch" affinity: anti_affinity: true anti_affinity_topology_key: kubernetes.io/hostname From 053a4e3dd122fb1055999ce44ad8f75372eb0eeb Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 01:45:50 +0200 Subject: [PATCH 64/67] Specify configurationMetadataStoreUrl --- charts/pulsar/templates/broker-configmap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml index f03d0d3c..60fbf96f 100644 --- a/charts/pulsar/templates/broker-configmap.yaml +++ b/charts/pulsar/templates/broker-configmap.yaml @@ -39,6 +39,7 @@ data: {{- end }} {{- if .Values.components.oxia }} metadataStoreUrl: "{{ template "pulsar.oxia.metadata.url.broker" . }}" + configurationMetadataStoreUrl: "{{ template "pulsar.oxia.metadata.url.broker" . }}" bookkeeperMetadataServiceUri: "{{ template "pulsar.oxia.metadata.url.bookkeeper" . }}" {{- end }} From 7740a2d68a366fd937c61aaadde0a1536b483fe9 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 02:05:57 +0200 Subject: [PATCH 65/67] Don't enable state store unless Zookeeper is used - org.apache.bookkeeper.stream.storage.impl.cluster.ZkClusterInitializer is the only implementation --- charts/pulsar/templates/broker-configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml index 60fbf96f..ebfdb4d0 100644 --- a/charts/pulsar/templates/broker-configmap.yaml +++ b/charts/pulsar/templates/broker-configmap.yaml @@ -109,7 +109,7 @@ data: {{- end }} {{- if .Values.components.functions }} functionsWorkerEnabled: "true" - {{- if .Values.functions.useBookieAsStateStore }} + {{- if and .Values.components.zookeeper .Values.functions.useBookieAsStateStore }} PF_stateStorageServiceUrl: "bk://{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}:{{ .Values.bookkeeper.ports.statestore }}" {{- end }} PF_functionRuntimeFactoryClassName: "org.apache.pulsar.functions.runtime.kubernetes.KubernetesRuntimeFactory" From bf3ee75964af7f0a30423174e7c487b4ebc1ee0f Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 02:37:50 +0200 Subject: [PATCH 66/67] Revert "Don't enable state store unless Zookeeper is used" This reverts commit 7740a2d68a366fd937c61aaadde0a1536b483fe9. --- charts/pulsar/templates/broker-configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml index ebfdb4d0..60fbf96f 100644 --- a/charts/pulsar/templates/broker-configmap.yaml +++ b/charts/pulsar/templates/broker-configmap.yaml @@ -109,7 +109,7 @@ data: {{- end }} {{- if .Values.components.functions }} functionsWorkerEnabled: "true" - {{- if and .Values.components.zookeeper .Values.functions.useBookieAsStateStore }} + {{- if .Values.functions.useBookieAsStateStore }} PF_stateStorageServiceUrl: "bk://{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}:{{ .Values.bookkeeper.ports.statestore }}" {{- end }} PF_functionRuntimeFactoryClassName: "org.apache.pulsar.functions.runtime.kubernetes.KubernetesRuntimeFactory" From 9c78dfbb87a769461a9c0bf5fffd35e9dadfead2 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Fri, 22 Nov 2024 02:35:32 +0200 Subject: [PATCH 67/67] Disable testing functions with Oxia --- .ci/clusters/values-oxia.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/clusters/values-oxia.yaml b/.ci/clusters/values-oxia.yaml index c7aca12c..51afd8c5 100644 --- a/.ci/clusters/values-oxia.yaml +++ b/.ci/clusters/values-oxia.yaml @@ -20,6 +20,9 @@ components: zookeeper: false oxia: true + # disable functions for oxia tests since there's no support for Oxia in + # BookKeeperPackagesStorage which requires Zookeeper + functions: false oxia: initialShardCount: 1