From fa1456ea4def92da706ae3a0d0d46f0d87205d67 Mon Sep 17 00:00:00 2001 From: Artem Nosulchyk Date: Mon, 19 May 2025 09:16:40 -0400 Subject: [PATCH] configurable oxia coordinator configmap and entrypoint (#606) --- charts/pulsar/templates/_oxia.tpl | 4 ++++ .../pulsar/templates/oxia-coordinator-configmap.yaml | 4 ++-- .../templates/oxia-coordinator-deployment.yaml | 12 ++++++++---- charts/pulsar/values.yaml | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/charts/pulsar/templates/_oxia.tpl b/charts/pulsar/templates/_oxia.tpl index 0f0fe25..3e0dbf2 100644 --- a/charts/pulsar/templates/_oxia.tpl +++ b/charts/pulsar/templates/_oxia.tpl @@ -106,7 +106,11 @@ Define coordinator entrypoint {{- define "oxia.coordinator.entrypoint" -}} - "oxia" - "coordinator" +{{- if .Values.oxia.coordinator.customConfigMapName }} +- "--conf=configmap:{{ template "pulsar.namespace" . }}/{{ .Values.oxia.coordinator.customConfigMapName }}" +{{- else }} - "--conf=configmap:{{ template "pulsar.namespace" . }}/{{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator" +{{- end }} - "--log-json" - "--metadata=configmap" - "--k8s-namespace={{ template "pulsar.namespace" . }}" diff --git a/charts/pulsar/templates/oxia-coordinator-configmap.yaml b/charts/pulsar/templates/oxia-coordinator-configmap.yaml index 577dac0..bbdbb80 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 }} +{{- if and .Values.components.oxia (not .Values.oxia.coordinator.customConfigMapName) }} apiVersion: v1 kind: ConfigMap metadata: @@ -29,4 +29,4 @@ data: config.yaml: | {{- include "oxia.coordinator.config.yaml" . | nindent 4 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/pulsar/templates/oxia-coordinator-deployment.yaml b/charts/pulsar/templates/oxia-coordinator-deployment.yaml index b8c1594..9a3553a 100644 --- a/charts/pulsar/templates/oxia-coordinator-deployment.yaml +++ b/charts/pulsar/templates/oxia-coordinator-deployment.yaml @@ -49,18 +49,22 @@ spec: {{ toYaml . | indent 8 }} {{- end }} spec: - {{- if .Values.oxia.server.nodeSelector }} + {{- if .Values.oxia.coordinator.nodeSelector }} nodeSelector: -{{ toYaml .Values.oxia.server.nodeSelector | indent 8 }} +{{ toYaml .Values.oxia.coordinator.nodeSelector | indent 8 }} {{- end }} - {{- if .Values.oxia.server.tolerations }} + {{- if .Values.oxia.coordinator.tolerations }} tolerations: -{{ toYaml .Values.oxia.server.tolerations | indent 8 }} +{{ toYaml .Values.oxia.coordinator.tolerations | indent 8 }} {{- end }} serviceAccountName: {{ template "pulsar.fullname" . }}-{{ .Values.oxia.component }}-coordinator containers: - command: +{{- if .Values.oxia.coordinator.entrypoint }} +{{ toYaml .Values.oxia.coordinator.entrypoint | indent 12 }} +{{- else }} {{- include "oxia.coordinator.entrypoint" . | nindent 12 }} +{{- end }} image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag }}" imagePullPolicy: "{{ template "pulsar.imagePullPolicy" (dict "image" .Values.images.oxia "root" .) }}" name: coordinator diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index c933330..c8f25e6 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -525,6 +525,8 @@ oxia: tolerations: [] # nodeSelector: # cloud.google.com/gke-nodepool: default-pool + # customConfigMapName: "" + # entrypoint: [] ## templates/server-statefulset.yaml server: # annotations for the app (statefulset/deployment)