From 25049a9e5adc2c0dc58e1e09c1bb8ae770367f2b Mon Sep 17 00:00:00 2001 From: Samiul Date: Mon, 13 Jul 2026 18:36:20 +0600 Subject: [PATCH 1/4] add expose binding support to milvus, qdrant, weaviate Signed-off-by: Samiul --- .../ui/create-ui.yaml | 6 +++ .../kubedbcom-milvus-editor/ui/edit-ui.yaml | 14 +++++ .../kubedbcom-milvus-editor/ui/functions.js | 53 ++++++++++++++++--- .../ui/create-ui.yaml | 6 +++ .../ui/create-ui.yaml | 9 ++-- .../kubedbcom-weaviate-editor/ui/edit-ui.yaml | 14 +++++ .../kubedbcom-weaviate-editor/ui/functions.js | 41 ++++++++++++++ 7 files changed, 132 insertions(+), 11 deletions(-) diff --git a/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml b/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml index c3d5b6688f..1907e3713b 100644 --- a/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml @@ -604,6 +604,12 @@ step: name: isToggleOn|tls type: function type: block-layout + - if: + name: isToggleOn|expose + type: function + label: Expose via Gateway? + schema: schema/properties/spec/properties/admin/properties/expose/properties/enable/properties/default + type: switch if: name: showAdditionalSettings type: function diff --git a/charts/kubedbcom-milvus-editor/ui/edit-ui.yaml b/charts/kubedbcom-milvus-editor/ui/edit-ui.yaml index 58329a0105..16011a830d 100644 --- a/charts/kubedbcom-milvus-editor/ui/edit-ui.yaml +++ b/charts/kubedbcom-milvus-editor/ui/edit-ui.yaml @@ -1024,4 +1024,18 @@ step: id: monitoring loader: initMonitoring type: single-step-form +- elements: + - fullwidth: true + init: + type: func + value: isBindingAlreadyOn + label: Expose Database + schema: temp/properties/binding + type: switch + watcher: + func: addOrRemoveBinding + paths: + - temp/properties/binding + id: binding + type: single-step-form type: multi-step-form diff --git a/charts/kubedbcom-milvus-editor/ui/functions.js b/charts/kubedbcom-milvus-editor/ui/functions.js index 09ed811475..bdbf7937ad 100644 --- a/charts/kubedbcom-milvus-editor/ui/functions.js +++ b/charts/kubedbcom-milvus-editor/ui/functions.js @@ -116,10 +116,7 @@ export const useFunc = (model) => { async function getIssuerRefsName() { const owner = storeGet('/route/params/user') const cluster = storeGet('/route/params/cluster') - const kind = getValue( - model, - '/resources/kubedbComMilvus/spec/tls/issuerRef/kind', - ) + const kind = getValue(model, '/resources/kubedbComMilvus/spec/tls/issuerRef/kind') const namespace = getValue(model, '/metadata/release/namespace') if (kind === 'Issuer') { @@ -672,10 +669,8 @@ export const useFunc = (model) => { function showOpsRequestOptions() { if (isKubedb()) return true return ( - !!getValue( - model, - '/resources/autoscalingKubedbComMilvusAutoscaler/spec/databaseRef/name', - ) && !!getValue(discriminator, '/autoscalingType') + !!getValue(model, '/resources/autoscalingKubedbComMilvusAutoscaler/spec/databaseRef/name') && + !!getValue(discriminator, '/autoscalingType') ) } @@ -771,6 +766,45 @@ export const useFunc = (model) => { } } + function isBindingAlreadyOn() { + const value = getValue(model, '/resources') + const keys = Object.keys(value) + const isExposeBinding = !!keys.find((str) => str === 'catalogAppscodeComMariaDBBinding') + return isExposeBinding + } + + function addOrRemoveBinding() { + const value = getValue(discriminator, `/binding`) + const dbName = getValue(model, '/metadata/release/name') + const dbNamespace = getValue(model, '/metadata/release/namespace') + const labels = getValue(model, '/resources/kubedbComMariaDB/metadata/labels') + const bindingValues = { + apiVersion: 'catalog.appscode.com/v1alpha1', + kind: 'MariaDBBinding', + metadata: { + labels, + name: dbName, + namespace: dbNamespace, + }, + spec: { + sourceRef: { + name: dbName, + namespace: dbNamespace, + }, + }, + } + + if (value) { + commit('wizard/model$update', { + path: '/resources/catalogAppscodeComMariaDBBinding', + value: bindingValues, + force: true, + }) + } else { + commit('wizard/model$delete', '/resources/catalogAppscodeComMariaDBBinding') + } + } + return { returnFalse, returnTrue, @@ -837,5 +871,8 @@ export const useFunc = (model) => { setApplyToIfReady, handleUnit, setValueFromDbDetails, + + addOrRemoveBinding, + isBindingAlreadyOn, } } diff --git a/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml b/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml index 573a3def62..654870e11d 100644 --- a/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml @@ -327,6 +327,12 @@ step: name: isToggleOn|tls type: function type: block-layout + - if: + name: isToggleOn|expose + type: function + label: Expose via Gateway? + schema: schema/properties/spec/properties/admin/properties/expose/properties/enable/properties/default + type: switch if: name: showAdditionalSettings type: function diff --git a/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml b/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml index 2b2e6e35de..6751320069 100644 --- a/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml @@ -303,9 +303,12 @@ step: validation: type: required type: block-layout - if: - name: returnFalse - type: function + - if: + name: isToggleOn|expose + type: function + label: Expose via Gateway? + schema: schema/properties/spec/properties/admin/properties/expose/properties/enable/properties/default + type: switch label: Additional Options showLabels: true type: block-layout diff --git a/charts/kubedbcom-weaviate-editor/ui/edit-ui.yaml b/charts/kubedbcom-weaviate-editor/ui/edit-ui.yaml index 5404d69b7b..747ff2943e 100644 --- a/charts/kubedbcom-weaviate-editor/ui/edit-ui.yaml +++ b/charts/kubedbcom-weaviate-editor/ui/edit-ui.yaml @@ -302,4 +302,18 @@ step: type: block-layout id: storage-autoscaler type: single-step-form +- elements: + - fullwidth: true + init: + type: func + value: isBindingAlreadyOn + label: Expose Database + schema: temp/properties/binding + type: switch + watcher: + func: addOrRemoveBinding + paths: + - temp/properties/binding + id: binding + type: single-step-form type: multi-step-form diff --git a/charts/kubedbcom-weaviate-editor/ui/functions.js b/charts/kubedbcom-weaviate-editor/ui/functions.js index 0e871c63b8..55bd8e06fb 100644 --- a/charts/kubedbcom-weaviate-editor/ui/functions.js +++ b/charts/kubedbcom-weaviate-editor/ui/functions.js @@ -554,6 +554,45 @@ export const useFunc = (model) => { return showStoragememory } + function isBindingAlreadyOn() { + const value = getValue(model, '/resources') + const keys = Object.keys(value) + const isExposeBinding = !!keys.find((str) => str === 'catalogAppscodeComMariaDBBinding') + return isExposeBinding + } + + function addOrRemoveBinding() { + const value = getValue(discriminator, `/binding`) + const dbName = getValue(model, '/metadata/release/name') + const dbNamespace = getValue(model, '/metadata/release/namespace') + const labels = getValue(model, '/resources/kubedbComMariaDB/metadata/labels') + const bindingValues = { + apiVersion: 'catalog.appscode.com/v1alpha1', + kind: 'MariaDBBinding', + metadata: { + labels, + name: dbName, + namespace: dbNamespace, + }, + spec: { + sourceRef: { + name: dbName, + namespace: dbNamespace, + }, + }, + } + + if (value) { + commit('wizard/model$update', { + path: '/resources/catalogAppscodeComMariaDBBinding', + value: bindingValues, + force: true, + }) + } else { + commit('wizard/model$delete', '/resources/catalogAppscodeComMariaDBBinding') + } + } + return { isKubedb, isConsole, @@ -584,5 +623,7 @@ export const useFunc = (model) => { returnFalse, setValueFromDbDetails, showStorageMemoryOption, + isBindingAlreadyOn, + addOrRemoveBinding, } } From 36aab7fdaaf1e141b3f15e09a9568f3c3b042f43 Mon Sep 17 00:00:00 2001 From: Samiul Date: Mon, 13 Jul 2026 18:45:16 +0600 Subject: [PATCH 2/4] typo Signed-off-by: Samiul --- .../kubedbcom-mariadb-editor/ui/functions.js | 21 ++++++++++--------- .../kubedbcom-milvus-editor/ui/functions.js | 10 ++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/charts/kubedbcom-mariadb-editor/ui/functions.js b/charts/kubedbcom-mariadb-editor/ui/functions.js index fc648c3f89..5a777bc1c9 100644 --- a/charts/kubedbcom-mariadb-editor/ui/functions.js +++ b/charts/kubedbcom-mariadb-editor/ui/functions.js @@ -333,20 +333,21 @@ export const useFunc = (model) => { const stashPreset = storeGet('/backup/stashPresets') if (stashPreset) { const { retentionPolicy, encryptionSecret, schedule, storageRef } = stashPreset + console.log(valuesFromWizard) - const tempBackends = valuesFromWizard.spec?.backends - tempBackends[0]['storageRef'] = storageRef - tempBackends[0]['retentionPolicy'] = retentionPolicy + const tempBackends = valuesFromWizard.spec?.backends || [] + tempBackends[0]?.['storageRef'] = storageRef + tempBackends[0]?.['retentionPolicy'] = retentionPolicy valuesFromWizard.spec['backends'] = tempBackends - const tempSessions = valuesFromWizard.spec?.sessions - const tempRepositories = valuesFromWizard.spec?.sessions[0]?.repositories - tempRepositories[0]['encryptionSecret'] = encryptionSecret - tempRepositories[0].name = name - tempRepositories[0]['directory'] = `${namespace}/${name}` + const tempSessions = valuesFromWizard.spec?.sessions || [] + const tempRepositories = valuesFromWizard.spec?.sessions[0]?.repositories || [] + tempRepositories[0]?.['encryptionSecret'] = encryptionSecret + tempRepositories[0]?.name = name + tempRepositories[0]?.['directory'] = `${namespace}/${name}` - tempSessions[0]['repositories'] = tempRepositories - tempSessions[0]['scheduler']['schedule'] = schedule + tempSessions[0]?.['repositories'] = tempRepositories + tempSessions[0]?.['scheduler']['schedule'] = schedule valuesFromWizard.spec['sessions'] = tempSessions } diff --git a/charts/kubedbcom-milvus-editor/ui/functions.js b/charts/kubedbcom-milvus-editor/ui/functions.js index bdbf7937ad..2139a1b64d 100644 --- a/charts/kubedbcom-milvus-editor/ui/functions.js +++ b/charts/kubedbcom-milvus-editor/ui/functions.js @@ -769,7 +769,7 @@ export const useFunc = (model) => { function isBindingAlreadyOn() { const value = getValue(model, '/resources') const keys = Object.keys(value) - const isExposeBinding = !!keys.find((str) => str === 'catalogAppscodeComMariaDBBinding') + const isExposeBinding = !!keys.find((str) => str === 'catalogAppscodeComMilvusBinding') return isExposeBinding } @@ -777,10 +777,10 @@ export const useFunc = (model) => { const value = getValue(discriminator, `/binding`) const dbName = getValue(model, '/metadata/release/name') const dbNamespace = getValue(model, '/metadata/release/namespace') - const labels = getValue(model, '/resources/kubedbComMariaDB/metadata/labels') + const labels = getValue(model, '/resources/kubedbComMilvus/metadata/labels') const bindingValues = { apiVersion: 'catalog.appscode.com/v1alpha1', - kind: 'MariaDBBinding', + kind: 'MilvusBinding', metadata: { labels, name: dbName, @@ -796,12 +796,12 @@ export const useFunc = (model) => { if (value) { commit('wizard/model$update', { - path: '/resources/catalogAppscodeComMariaDBBinding', + path: '/resources/catalogAppscodeComMilvusBinding', value: bindingValues, force: true, }) } else { - commit('wizard/model$delete', '/resources/catalogAppscodeComMariaDBBinding') + commit('wizard/model$delete', '/resources/catalogAppscodeComMilvusBinding') } } From 21721648366c5d8ff4a0fe5a794f259e089fa0cf Mon Sep 17 00:00:00 2001 From: Samiul Date: Tue, 14 Jul 2026 11:54:48 +0600 Subject: [PATCH 3/4] typo Signed-off-by: Samiul --- .../kubedbcom-mariadb-editor/ui/functions.js | 21 +++++++++---------- .../kubedbcom-weaviate-editor/ui/functions.js | 10 ++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/charts/kubedbcom-mariadb-editor/ui/functions.js b/charts/kubedbcom-mariadb-editor/ui/functions.js index 5a777bc1c9..fc648c3f89 100644 --- a/charts/kubedbcom-mariadb-editor/ui/functions.js +++ b/charts/kubedbcom-mariadb-editor/ui/functions.js @@ -333,21 +333,20 @@ export const useFunc = (model) => { const stashPreset = storeGet('/backup/stashPresets') if (stashPreset) { const { retentionPolicy, encryptionSecret, schedule, storageRef } = stashPreset - console.log(valuesFromWizard) - const tempBackends = valuesFromWizard.spec?.backends || [] - tempBackends[0]?.['storageRef'] = storageRef - tempBackends[0]?.['retentionPolicy'] = retentionPolicy + const tempBackends = valuesFromWizard.spec?.backends + tempBackends[0]['storageRef'] = storageRef + tempBackends[0]['retentionPolicy'] = retentionPolicy valuesFromWizard.spec['backends'] = tempBackends - const tempSessions = valuesFromWizard.spec?.sessions || [] - const tempRepositories = valuesFromWizard.spec?.sessions[0]?.repositories || [] - tempRepositories[0]?.['encryptionSecret'] = encryptionSecret - tempRepositories[0]?.name = name - tempRepositories[0]?.['directory'] = `${namespace}/${name}` + const tempSessions = valuesFromWizard.spec?.sessions + const tempRepositories = valuesFromWizard.spec?.sessions[0]?.repositories + tempRepositories[0]['encryptionSecret'] = encryptionSecret + tempRepositories[0].name = name + tempRepositories[0]['directory'] = `${namespace}/${name}` - tempSessions[0]?.['repositories'] = tempRepositories - tempSessions[0]?.['scheduler']['schedule'] = schedule + tempSessions[0]['repositories'] = tempRepositories + tempSessions[0]['scheduler']['schedule'] = schedule valuesFromWizard.spec['sessions'] = tempSessions } diff --git a/charts/kubedbcom-weaviate-editor/ui/functions.js b/charts/kubedbcom-weaviate-editor/ui/functions.js index 55bd8e06fb..ff1e3ca91e 100644 --- a/charts/kubedbcom-weaviate-editor/ui/functions.js +++ b/charts/kubedbcom-weaviate-editor/ui/functions.js @@ -557,7 +557,7 @@ export const useFunc = (model) => { function isBindingAlreadyOn() { const value = getValue(model, '/resources') const keys = Object.keys(value) - const isExposeBinding = !!keys.find((str) => str === 'catalogAppscodeComMariaDBBinding') + const isExposeBinding = !!keys.find((str) => str === 'catalogAppscodeComWeaviateBinding') return isExposeBinding } @@ -565,10 +565,10 @@ export const useFunc = (model) => { const value = getValue(discriminator, `/binding`) const dbName = getValue(model, '/metadata/release/name') const dbNamespace = getValue(model, '/metadata/release/namespace') - const labels = getValue(model, '/resources/kubedbComMariaDB/metadata/labels') + const labels = getValue(model, '/resources/kubedbComWeaviate/metadata/labels') const bindingValues = { apiVersion: 'catalog.appscode.com/v1alpha1', - kind: 'MariaDBBinding', + kind: 'WeaviateBinding', metadata: { labels, name: dbName, @@ -584,12 +584,12 @@ export const useFunc = (model) => { if (value) { commit('wizard/model$update', { - path: '/resources/catalogAppscodeComMariaDBBinding', + path: '/resources/catalogAppscodeComWeaviateBinding', value: bindingValues, force: true, }) } else { - commit('wizard/model$delete', '/resources/catalogAppscodeComMariaDBBinding') + commit('wizard/model$delete', '/resources/catalogAppscodeComWeaviateBinding') } } From d1a8eb6fb1e957e70b81fec56a739c10c886a3be Mon Sep 17 00:00:00 2001 From: Samiul Date: Tue, 14 Jul 2026 12:13:58 +0600 Subject: [PATCH 4/4] binding template Signed-off-by: Samiul --- .../templates/binding.yaml | 16 ++++++++++++++++ .../templates/binding.yaml | 16 ++++++++++++++++ .../templates/binding.yaml | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 charts/kubedbcom-milvus-editor-options/templates/binding.yaml create mode 100644 charts/kubedbcom-qdrant-editor-options/templates/binding.yaml create mode 100644 charts/kubedbcom-weaviate-editor-options/templates/binding.yaml diff --git a/charts/kubedbcom-milvus-editor-options/templates/binding.yaml b/charts/kubedbcom-milvus-editor-options/templates/binding.yaml new file mode 100644 index 0000000000..fd8f5c8321 --- /dev/null +++ b/charts/kubedbcom-milvus-editor-options/templates/binding.yaml @@ -0,0 +1,16 @@ +{{- if .Values.spec.admin.expose.enable.default }} +apiVersion: catalog.appscode.com/v1alpha1 +kind: MilvusBinding +metadata: + name: {{ include "kubedbcom-milvus-editor-options.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "kubedbcom-milvus-editor-options.labels" . | nindent 4 }} +spec: + sourceRef: + name: {{ include "kubedbcom-milvus-editor-options.fullname" . }} + namespace: {{ .Release.Namespace }} + uiExposure: + disableUI: {{ .Values.spec.admin.expose.uiExposure.disableUI }} + disableCostEfficiency: {{ .Values.spec.admin.expose.uiExposure.disableCostEfficiency }} +{{- end }} \ No newline at end of file diff --git a/charts/kubedbcom-qdrant-editor-options/templates/binding.yaml b/charts/kubedbcom-qdrant-editor-options/templates/binding.yaml new file mode 100644 index 0000000000..1883e76f14 --- /dev/null +++ b/charts/kubedbcom-qdrant-editor-options/templates/binding.yaml @@ -0,0 +1,16 @@ +{{- if .Values.spec.admin.expose.enable.default }} +apiVersion: catalog.appscode.com/v1alpha1 +kind: QdrantBinding +metadata: + name: {{ include "kubedbcom-qdrant-editor.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "kubedbcom-qdrant-editor.labels" . | nindent 4 }} +spec: + sourceRef: + name: {{ include "kubedbcom-qdrant-editor.fullname" . }} + namespace: {{ .Release.Namespace }} + uiExposure: + disableUI: {{ .Values.spec.admin.expose.uiExposure.disableUI }} + disableCostEfficiency: {{ .Values.spec.admin.expose.uiExposure.disableCostEfficiency }} +{{- end }} \ No newline at end of file diff --git a/charts/kubedbcom-weaviate-editor-options/templates/binding.yaml b/charts/kubedbcom-weaviate-editor-options/templates/binding.yaml new file mode 100644 index 0000000000..8eb93701ae --- /dev/null +++ b/charts/kubedbcom-weaviate-editor-options/templates/binding.yaml @@ -0,0 +1,16 @@ +{{- if .Values.spec.admin.expose.enable.default }} +apiVersion: catalog.appscode.com/v1alpha1 +kind: WeaviateBinding +metadata: + name: {{ include "kubedbcom-weaviate-editor-options.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "kubedbcom-weaviate-editor-options.labels" . | nindent 4 }} +spec: + sourceRef: + name: {{ include "kubedbcom-weaviate-editor-options.fullname" . }} + namespace: {{ .Release.Namespace }} + uiExposure: + disableUI: {{ .Values.spec.admin.expose.uiExposure.disableUI }} + disableCostEfficiency: {{ .Values.spec.admin.expose.uiExposure.disableCostEfficiency }} +{{- end }} \ No newline at end of file