From bd6d21e882d2ab6d3c6b9f8ce672e02af3ee7165 Mon Sep 17 00:00:00 2001 From: Arnob kumar saha Date: Fri, 18 Sep 2026 19:51:32 +0600 Subject: [PATCH] Fix MaxScale securityContext UID and widen ProxySQL backend AppBinding filter MaxScale runs as uid 997, not 999; give it its own container securityContext helper and pod fsGroup default. ProxySQL can route to MariaDB and PerconaXtraDB backends, so the backend AppBinding dropdown now accepts those types in addition to MySQL. Signed-off-by: Arnob kumar saha --- .../templates/_helpers.tpl | 12 ++++++++++++ .../templates/db.yaml | 4 ++-- .../ui/functions.js | 6 +++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/charts/kubedbcom-mariadb-editor-options/templates/_helpers.tpl b/charts/kubedbcom-mariadb-editor-options/templates/_helpers.tpl index 495cac143b..3e9774d860 100644 --- a/charts/kubedbcom-mariadb-editor-options/templates/_helpers.tpl +++ b/charts/kubedbcom-mariadb-editor-options/templates/_helpers.tpl @@ -130,6 +130,18 @@ seccompProfile: type: RuntimeDefault {{- end }} +{{- define "maxscale.container.securityContext" -}} +allowPrivilegeEscalation: false +capabilities: + drop: + - ALL +runAsGroup: 0 +runAsNonRoot: true +runAsUser: {{ $.Values.spec.openshift.securityContext.runAsUser | default 997 }} +seccompProfile: + type: RuntimeDefault +{{- end }} + {{- define "resource-profiles" -}} {{- $machines := .Files.Get "data/machines.yaml" | fromYaml -}} {{- $profiles := "" -}} diff --git a/charts/kubedbcom-mariadb-editor-options/templates/db.yaml b/charts/kubedbcom-mariadb-editor-options/templates/db.yaml index edccebc779..8b4be82d83 100644 --- a/charts/kubedbcom-mariadb-editor-options/templates/db.yaml +++ b/charts/kubedbcom-mariadb-editor-options/templates/db.yaml @@ -110,13 +110,13 @@ spec: podTemplate: spec: securityContext: - fsGroup: {{ .Values.spec.openshift.securityContext.runAsUser | default 999 }} + fsGroup: {{ .Values.spec.openshift.securityContext.runAsUser | default 997 }} containers: - name: maxscale resources: {{- toYaml .maxscale_res | nindent 16 }} securityContext: - {{- include "container.securityContext" . | nindent 16 }} + {{- include "maxscale.container.securityContext" . | nindent 16 }} {{- include "common.placement" . | nindent 10 }} {{- end }} storage: diff --git a/charts/kubedbcom-proxysql-editor-options/ui/functions.js b/charts/kubedbcom-proxysql-editor-options/ui/functions.js index f2104f47fb..9f082d3484 100644 --- a/charts/kubedbcom-proxysql-editor-options/ui/functions.js +++ b/charts/kubedbcom-proxysql-editor-options/ui/functions.js @@ -360,7 +360,11 @@ export const useFunc = (model) => { const resources = (resp && resp.data && resp.data.items) || [] const fileredResources = resources - .filter((item) => item.spec?.type === 'kubedb.com/mysql') + .filter((item) => + ['kubedb.com/mysql', 'kubedb.com/mariadb', 'kubedb.com/perconaxtradb'].includes( + item.spec?.type, + ), + ) .map((item) => { const name = (item.metadata && item.metadata.name) || '' return {