diff --git a/charts/kubedbcom-milvus-editor/ui/create-ui.yaml b/charts/kubedbcom-milvus-editor/ui/create-ui.yaml
new file mode 100644
index 0000000000..b2d9317041
--- /dev/null
+++ b/charts/kubedbcom-milvus-editor/ui/create-ui.yaml
@@ -0,0 +1,501 @@
+steps:
+- form:
+ discriminator:
+ createAuthSecret:
+ type: boolean
+ password:
+ type: string
+ elements:
+ - disabled: isVariantAvailable
+ label:
+ text: labels.database.name
+ onChange: onNameChange
+ schema:
+ $ref: schema#/properties/metadata/properties/release/properties/name
+ type: input
+ - add_new_button:
+ label: labels.add_new_namespace
+ target: _blank
+ url:
+ function: getCreateNameSpaceUrl
+ disabled: isVariantAvailable
+ fetch: getNamespaces
+ label:
+ text: labels.namespace
+ onChange: onNamespaceChange
+ refresh: true
+ schema:
+ $ref: schema#/properties/metadata/properties/release/properties/namespace
+ type: select
+ - fetch: getMilvusVersions
+ label:
+ text: labels.database.version
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/version
+ type: select
+ - individualItemDisabilityCheck: disableLableChecker
+ isArray: true
+ keys:
+ label:
+ text: labels.labels.key
+ label:
+ text: labels.labels.label
+ onChange: onLabelChange
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/metadata/properties/labels
+ type: key-value-input-form
+ values:
+ label:
+ text: labels.labels.value
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/metadata/properties/labels/additionalProperties
+ type: input
+ - isArray: true
+ keys:
+ label:
+ text: labels.annotations.key
+ label:
+ text: labels.annotations.label
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/metadata/properties/annotations
+ type: key-value-input-form
+ values:
+ label:
+ text: labels.annotations.value
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/metadata/properties/annotations/additionalProperties
+ type: input
+ - hasDescription: true
+ label:
+ text: labels.deletionPolicy
+ onChange: setStorageClass
+ options:
+ - description: options.deletionPolicy.delete.description
+ text: options.deletionPolicy.delete.label
+ value: Delete
+ - description: options.deletionPolicy.halt.description
+ text: options.deletionPolicy.halt.label
+ value: Halt
+ - description: options.deletionPolicy.wipeOut.description
+ text: options.deletionPolicy.wipeOut.label
+ value: WipeOut
+ - description: options.deletionPolicy.doNotTerminate.description
+ text: options.deletionPolicy.doNotTerminate.label
+ value: DoNotTerminate
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/deletionPolicy
+ type: radio
+ - label:
+ text: labels.database.secret
+ type: label-element
+ - computed: getCreateAuthSecret
+ onChange: onCreateAuthSecretChange
+ options:
+ - text: options.database.secret.existingSecret.label
+ value: false
+ - text: options.database.secret.customSecret.label
+ value: true
+ schema:
+ $ref: discriminator#/createAuthSecret
+ type: radio
+ - allowUserDefinedOption: true
+ fetch: getSecrets
+ if: showExistingSecretSection
+ label:
+ text: labels.secret
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/authSecret/properties/name
+ type: select
+ - computed: setAuthSecretPassword
+ hideValue: true
+ if: showPasswordSection
+ label:
+ text: Password
+ onChange: onAuthSecretPasswordChange
+ schema:
+ $ref: discriminator#/properties/password
+ type: input
+ type: single-step-form
+ id: basic
+ title: steps.0.label
+- form:
+ elements:
+ - alias: reusable_alert
+ chart:
+ name: uibytebuildersdev-component-alert
+ version: v0.30.0
+ moduleResolver: fetchJsons
+ schema:
+ $ref: schema#/properties/form/properties/alert
+ type: reusable-element
+ type: single-step-form
+ id: alert
+ title: labels.alert
+- form:
+ elements:
+ - elements:
+ - fetch: getStorageClassNames
+ label:
+ text: labels.storage.class
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/storage/properties/storageClassName
+ type: select
+ - label:
+ text: labels.storage.size
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/storage/properties/resources/properties/requests/properties/storage
+ type: input
+ type: single-step-form
+ type: single-step-form
+ id: topology
+ title: steps.1.label
+- form:
+ discriminator:
+ configureTLS:
+ default: true
+ type: boolean
+ elements:
+ - computed: returnTrue
+ label:
+ text: labels.enable_tls
+ onChange: onTlsConfigureChange
+ schema:
+ $ref: discriminator#/configureTLS
+ type: switch
+ - elements:
+ - elements:
+ - computed: setApiGroup
+ disabled: true
+ label:
+ text: labels.api_group
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/tls/properties/issuerRef/properties/apiGroup
+ type: input
+ - label:
+ text: labels.kind
+ options:
+ - text: Issuer
+ value: Issuer
+ - text: ClusterIssuer
+ value: ClusterIssuer
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/tls/properties/issuerRef/properties/kind
+ type: select
+ - allowUserDefinedOption: true
+ fetch: getIssuerRefsName
+ label:
+ text: labels.name
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/tls/properties/issuerRef/properties/name
+ type: select
+ label:
+ text: labels.issuer_ref
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/tls/properties/issuerRef
+ type: single-step-form
+ - alias: reusable_certificates
+ chart:
+ name: uibytebuildersdev-component-certificates
+ version: v0.30.0
+ functionCallbacks:
+ getAliasOptions:
+ $ref: functions#/getAliasOptions
+ moduleResolver: fetchJsons
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/tls/properties/certificates
+ type: reusable-element
+ if: showTlsConfigureSection
+ type: single-step-form
+ type: single-step-form
+ id: tls
+ title: steps.2.label
+- form:
+ discriminator:
+ enableMonitoring:
+ default: true
+ type: boolean
+ elements:
+ - computed: returnTrue
+ label:
+ text: labels.enable_monitoring
+ onChange: onEnableMonitoringChange
+ schema:
+ $ref: discriminator#/enableMonitoring
+ type: switch
+ - discriminator:
+ customizeExporter:
+ default: true
+ type: boolean
+ elements:
+ - hasDescription: true
+ label:
+ text: labels.agent
+ onChange: onAgentChange
+ options:
+ - description: options.agent.prometheus_operator.description
+ text: options.agent.prometheus_operator.label
+ value: prometheus.io/operator
+ - description: options.agent.prometheus.description
+ text: options.agent.prometheus.label
+ value: prometheus.io
+ - description: options.agent.prometheus_builtin.description
+ text: options.agent.prometheus_builtin.label
+ value: prometheus.io/builtin
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/agent
+ type: radio
+ - elements:
+ - label:
+ text: labels.scrapping_interval
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/serviceMonitor/properties/interval
+ type: input
+ if: isEqualToModelPathValue|prometheus.io/operator|/resources/kubedbComMilvus/spec/monitor/agent
+ label:
+ text: labels.service_monitor_configuration
+ show_label: true
+ type: single-step-form
+ - elements:
+ - elements:
+ - addFormLabel: labels.endpoint
+ element:
+ elements:
+ - label:
+ text: labels.honor_labels
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/endpoints/items/properties/honorLabels
+ type: switch
+ - label:
+ text: labels.interval
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/endpoints/items/properties/interval
+ type: input
+ - label:
+ text: labels.path
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/endpoints/items/properties/path
+ type: input
+ - label:
+ text: labels.port
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/endpoints/items/properties/port
+ type: input
+ type: single-step-form
+ label:
+ text: labels.endpoints
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/endpoints
+ tableContents:
+ - inTableColumn: true
+ label:
+ text: labels.honor_labels
+ path: honorLabels
+ type: value
+ typeOfValue: string
+ - inTableColumn: true
+ label:
+ text: labels.interval
+ path: interval
+ type: value
+ typeOfValue: string
+ - inTableColumn: true
+ label:
+ text: labels.path
+ path: path
+ type: value
+ typeOfValue: string
+ - inTableColumn: true
+ label:
+ text: labels.port
+ path: port
+ type: value
+ typeOfValue: string
+ type: single-step-form-array
+ - elements:
+ - fetch: getNamespaces
+ label:
+ text: labels.matchNames
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/namespaceSelector/properties/matchNames
+ type: multiselect
+ if: returnFalse
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/namespaceSelector
+ type: single-step-form
+ - elements:
+ - isArray: true
+ keys:
+ label:
+ text: labels.labels.key
+ label:
+ text: labels.labels.label
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/selector/properties/matchLabels
+ type: key-value-input-form
+ values:
+ label:
+ text: labels.labels.value
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/selector/properties/matchLabels/additionalProperties
+ type: input
+ if: returnFalse
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/selector
+ type: single-step-form
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec
+ type: single-step-form
+ if: isEqualToModelPathValue|prometheus.io|/resources/kubedbComMilvus/spec/monitor/agent
+ label:
+ text: labels.service_monitor
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor
+ show_label: true
+ type: single-step-form
+ - if: isEqualToModelPathValue|prometheus.io|/resources/kubedbComMilvus/spec/monitor/agent
+ individualItemDisabilityCheck: disableLableChecker
+ isArray: true
+ keys:
+ label:
+ text: labels.labels.key
+ label:
+ text: labels.labels.label
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/metadata/properties/labels
+ type: key-value-input-form
+ values:
+ label:
+ text: labels.labels.value
+ schema:
+ $ref: schema#/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/metadata/properties/labels/additionalProperties
+ type: input
+ - label:
+ text: labels.exporter_configuration
+ type: label-element
+ - label:
+ text: labels.customize_exporter
+ onChange: onCustomizeExporterChange
+ schema:
+ $ref: discriminator#/customizeExporter
+ type: switch
+ - elements:
+ - label:
+ text: labels.resources
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/resources
+ type: resource-input-form
+ - label:
+ text: labels.security_context
+ type: label-element
+ - label:
+ text: labels.run_as_user
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/securityContext/properties/runAsUser
+ type: input
+ - customClass: mb-0
+ label:
+ text: labels.run_as_group
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/securityContext/properties/runAsGroup
+ type: input
+ - label:
+ text: labels.port
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/port
+ type: input
+ if: showCustomizeExporterSection
+ type: single-step-form
+ if: showMonitoringSection
+ type: single-step-form
+ type: single-step-form
+ id: monitoring
+ title: steps.3.label
+- form:
+ elements:
+ - alias: pod_template_standalone
+ chart:
+ name: uibytebuildersdev-component-pod-template
+ version: v0.30.0
+ dataContext:
+ namespace:
+ $ref: schema#/properties/metadata/properties/release/properties/namespace
+ moduleResolver: fetchJsons
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/podTemplate
+ type: reusable-element
+ type: single-step-form
+ id: pod-template
+ title: steps.4.label
+- form:
+ elements:
+ - alias: reusable_service_templates
+ chart:
+ name: uibytebuildersdev-component-service-templates
+ version: v0.30.0
+ moduleResolver: fetchJsons
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/serviceTemplates
+ type: reusable-element
+ type: single-step-form
+ id: networking
+ title: steps.5.label
+- form:
+ elements:
+ - discriminator:
+ setCustomConfig:
+ type: string
+ elements:
+ - computed: returnStringYes
+ label:
+ text: labels.setCustomConfig
+ onChange: onSetCustomConfigChange
+ options:
+ - text: options.yesOrNo.yes.text
+ value: "yes"
+ - text: options.yesOrNo.no.text
+ value: "no"
+ schema:
+ $ref: discriminator#/properties/setCustomConfig
+ type: radio
+ - discriminator:
+ configuration:
+ type: string
+ configurationSource:
+ default: use-existing-config
+ type: string
+ elements:
+ - computed: setConfigurationSource
+ label:
+ text: labels.custom_config
+ onChange: onConfigurationSourceChange
+ options:
+ - text: options.configuration_source.use_existing_config.label
+ value: use-existing-config
+ - text: options.configuration_source.create_new_config.label
+ value: create-new-config
+ schema:
+ $ref: discriminator#/configurationSource
+ type: radio
+ - allowUserDefinedOption: true
+ fetch: getSecrets
+ if: isEqualToDiscriminatorPath|use-existing-config|/configurationSource
+ label:
+ text: labels.name
+ schema:
+ $ref: schema#/properties/resources/properties/kubedbComMilvus/properties/spec/properties/configuration/properties/secretName
+ type: select
+ - computed: setConfiguration
+ if: isEqualToDiscriminatorPath|create-new-config|/configurationSource
+ label:
+ text: labels.hanadb_cnf
+ onChange: onConfigurationChange
+ schema:
+ $ref: discriminator#/properties/configuration
+ type: editor
+ if: isEqualToDiscriminatorPath|yes|/setCustomConfig
+ type: single-step-form
+ type: single-step-form
+ type: single-step-form
+ id: custom-config
+ title: steps.6.label
+type: multi-step-form
diff --git a/charts/kubedbcom-milvus-editor/ui/edit-ui.yaml b/charts/kubedbcom-milvus-editor/ui/edit-ui.yaml
new file mode 100644
index 0000000000..58329a0105
--- /dev/null
+++ b/charts/kubedbcom-milvus-editor/ui/edit-ui.yaml
@@ -0,0 +1,1027 @@
+step:
+- elements:
+ - elements:
+ - label: Name
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/metadata/properties/name
+ type: input
+ - if:
+ name: isRancherManaged
+ type: function
+ label: Select Namespace
+ loader: getNamespaces
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/metadata/properties/namespace
+ type: select
+ watcher:
+ func: onNamespaceChange
+ paths:
+ - schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/metadata/properties/namespace
+ - label: Select Db
+ loader: getMilvusDbs
+ refresh: true
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/databaseRef/properties/name
+ type: select
+ validation:
+ type: required
+ if:
+ name: isConsole
+ type: function
+ type: block-layout
+ - if:
+ name: isConsole
+ type: function
+ label: Select Type
+ options:
+ - description: Scale your CPU Memory based on resource usage
+ text: Compute
+ value: compute
+ - description: Expand your database size based on volume usage
+ text: Storage
+ value: storage
+ schema: temp/properties/autoscalingType
+ type: radio
+ validation:
+ type: required
+ watcher:
+ func: initAutoscalerMetadata
+ paths:
+ - temp/properties/autoscalingType
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/compute/node/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/trigger
+ type: switch
+ - label: Pod lifetime threshold
+ subtitle: Specifies the duration a pod can exist before being considered for
+ scaling decisions, ensuring resource optimization and workload stability
+ type: label-element
+ - customClass: width-300
+ label: Pod LifeTime Threshold (e.g., 10m 30s)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/podLifeTimeThreshold
+ type: input
+ - elements:
+ - customClass: width-300
+ label: ResourceDiff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/resourceDiffPercentage
+ type: threshold-input
+ - label: Resource Configuration
+ subtitle: Define minimum and maximum allowed resources to ensure optimal database
+ performance
+ type: label-element
+ - elements:
+ - header: Minimum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|node|min
+ label: Min Allowed Profile
+ loader:
+ name: getMachines|node|min
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-node-max
+ schema: temp/properties/allowedMachine-node-min
+ type: machine-compare
+ watcher:
+ func: onMachineChange|node
+ paths:
+ - temp/properties/allowedMachine-node-min
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/minAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/minAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Min Allowed
+ showLabels: true
+ type: block-layout
+ - header: Maximum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|node|max
+ label: Max Allowed Profile
+ loader:
+ name: getMachines|node|max
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-node-min
+ schema: temp/properties/allowedMachine-node-max
+ type: machine-compare
+ watcher:
+ func: onMachineChange|node
+ paths:
+ - temp/properties/allowedMachine-node-max
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/maxAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/maxAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Max Allowed
+ showLabels: true
+ type: block-layout
+ showLabels: false
+ type: block-layout
+ - label: Controlled Resources
+ loader: setControlledResources|node
+ multiple: true
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/node/properties/controlledResources
+ type: select
+ label: Node
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusStandalone
+ type: function
+ label: Node
+ showLabels: true
+ type: block-layout
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/compute/datanode/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/trigger
+ type: switch
+ - label: Pod lifetime threshold
+ subtitle: Specifies the duration a pod can exist before being considered for
+ scaling decisions, ensuring resource optimization and workload stability
+ type: label-element
+ - customClass: width-300
+ label: Pod LifeTime Threshold (e.g., 10m 30s)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/podLifeTimeThreshold
+ type: input
+ - elements:
+ - customClass: width-300
+ label: ResourceDiff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/resourceDiffPercentage
+ type: threshold-input
+ - label: Resource Configuration
+ subtitle: Define minimum and maximum allowed resources to ensure optimal database
+ performance
+ type: label-element
+ - elements:
+ - header: Minimum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|datanode|min
+ label: Min Allowed Profile
+ loader:
+ name: getMachines|datanode|min
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-datanode-max
+ schema: temp/properties/allowedMachine-datanode-min
+ type: machine-compare
+ watcher:
+ func: onMachineChange|datanode
+ paths:
+ - temp/properties/allowedMachine-datanode-min
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/minAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/minAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Min Allowed
+ showLabels: true
+ type: block-layout
+ - header: Maximum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|datanode|max
+ label: Max Allowed Profile
+ loader:
+ name: getMachines|datanode|max
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-datanode-min
+ schema: temp/properties/allowedMachine-datanode-max
+ type: machine-compare
+ watcher:
+ func: onMachineChange|datanode
+ paths:
+ - temp/properties/allowedMachine-datanode-max
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/maxAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/maxAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Max Allowed
+ showLabels: true
+ type: block-layout
+ showLabels: false
+ type: block-layout
+ - label: Controlled Resources
+ loader: setControlledResources|datanode
+ multiple: true
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/datanode/properties/controlledResources
+ type: select
+ label: DataNode
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusDistributed
+ type: function
+ label: DataNode
+ showLabels: true
+ type: block-layout
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/compute/mixcoord/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/trigger
+ type: switch
+ - label: Pod lifetime threshold
+ subtitle: Specifies the duration a pod can exist before being considered for
+ scaling decisions, ensuring resource optimization and workload stability
+ type: label-element
+ - customClass: width-300
+ label: Pod LifeTime Threshold (e.g., 10m 30s)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/podLifeTimeThreshold
+ type: input
+ - elements:
+ - customClass: width-300
+ label: ResourceDiff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/resourceDiffPercentage
+ type: threshold-input
+ - label: Resource Configuration
+ subtitle: Define minimum and maximum allowed resources to ensure optimal database
+ performance
+ type: label-element
+ - elements:
+ - header: Minimum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|mixcoord|min
+ label: Min Allowed Profile
+ loader:
+ name: getMachines|mixcoord|min
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-mixcoord-max
+ schema: temp/properties/allowedMachine-mixcoord-min
+ type: machine-compare
+ watcher:
+ func: onMachineChange|mixcoord
+ paths:
+ - temp/properties/allowedMachine-mixcoord-min
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/minAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/minAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Min Allowed
+ showLabels: true
+ type: block-layout
+ - header: Maximum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|mixcoord|max
+ label: Max Allowed Profile
+ loader:
+ name: getMachines|mixcoord|max
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-mixcoord-min
+ schema: temp/properties/allowedMachine-mixcoord-max
+ type: machine-compare
+ watcher:
+ func: onMachineChange|mixcoord
+ paths:
+ - temp/properties/allowedMachine-mixcoord-max
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/maxAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/maxAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Max Allowed
+ showLabels: true
+ type: block-layout
+ showLabels: false
+ type: block-layout
+ - label: Controlled Resources
+ loader: setControlledResources|mixcoord
+ multiple: true
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/mixcoord/properties/controlledResources
+ type: select
+ label: MixCoord
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusDistributed
+ type: function
+ label: MixCoord
+ showLabels: true
+ type: block-layout
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/compute/proxy/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/trigger
+ type: switch
+ - label: Pod lifetime threshold
+ subtitle: Specifies the duration a pod can exist before being considered for
+ scaling decisions, ensuring resource optimization and workload stability
+ type: label-element
+ - customClass: width-300
+ label: Pod LifeTime Threshold (e.g., 10m 30s)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/podLifeTimeThreshold
+ type: input
+ - elements:
+ - customClass: width-300
+ label: ResourceDiff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/resourceDiffPercentage
+ type: threshold-input
+ - label: Resource Configuration
+ subtitle: Define minimum and maximum allowed resources to ensure optimal database
+ performance
+ type: label-element
+ - elements:
+ - header: Minimum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|proxy|min
+ label: Min Allowed Profile
+ loader:
+ name: getMachines|proxy|min
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-proxy-max
+ schema: temp/properties/allowedMachine-proxy-min
+ type: machine-compare
+ watcher:
+ func: onMachineChange|proxy
+ paths:
+ - temp/properties/allowedMachine-proxy-min
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/minAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/minAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Min Allowed
+ showLabels: true
+ type: block-layout
+ - header: Maximum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|proxy|max
+ label: Max Allowed Profile
+ loader:
+ name: getMachines|proxy|max
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-proxy-min
+ schema: temp/properties/allowedMachine-proxy-max
+ type: machine-compare
+ watcher:
+ func: onMachineChange|proxy
+ paths:
+ - temp/properties/allowedMachine-proxy-max
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/maxAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/maxAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Max Allowed
+ showLabels: true
+ type: block-layout
+ showLabels: false
+ type: block-layout
+ - label: Controlled Resources
+ loader: setControlledResources|proxy
+ multiple: true
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/proxy/properties/controlledResources
+ type: select
+ label: Proxy
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusDistributed
+ type: function
+ label: Proxy
+ showLabels: true
+ type: block-layout
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/compute/querynode/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/trigger
+ type: switch
+ - label: Pod lifetime threshold
+ subtitle: Specifies the duration a pod can exist before being considered for
+ scaling decisions, ensuring resource optimization and workload stability
+ type: label-element
+ - customClass: width-300
+ label: Pod LifeTime Threshold (e.g., 10m 30s)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/podLifeTimeThreshold
+ type: input
+ - elements:
+ - customClass: width-300
+ label: ResourceDiff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/resourceDiffPercentage
+ type: threshold-input
+ - label: Resource Configuration
+ subtitle: Define minimum and maximum allowed resources to ensure optimal database
+ performance
+ type: label-element
+ - elements:
+ - header: Minimum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|querynode|min
+ label: Min Allowed Profile
+ loader:
+ name: getMachines|querynode|min
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-querynode-max
+ schema: temp/properties/allowedMachine-querynode-min
+ type: machine-compare
+ watcher:
+ func: onMachineChange|querynode
+ paths:
+ - temp/properties/allowedMachine-querynode-min
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/minAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/minAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Min Allowed
+ showLabels: true
+ type: block-layout
+ - header: Maximum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|querynode|max
+ label: Max Allowed Profile
+ loader:
+ name: getMachines|querynode|max
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-querynode-min
+ schema: temp/properties/allowedMachine-querynode-max
+ type: machine-compare
+ watcher:
+ func: onMachineChange|querynode
+ paths:
+ - temp/properties/allowedMachine-querynode-max
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/maxAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/maxAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Max Allowed
+ showLabels: true
+ type: block-layout
+ showLabels: false
+ type: block-layout
+ - label: Controlled Resources
+ loader: setControlledResources|querynode
+ multiple: true
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/querynode/properties/controlledResources
+ type: select
+ label: QueryNode
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusDistributed
+ type: function
+ label: QueryNode
+ showLabels: true
+ type: block-layout
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/compute/streamingnode/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/trigger
+ type: switch
+ - label: Pod lifetime threshold
+ subtitle: Specifies the duration a pod can exist before being considered for
+ scaling decisions, ensuring resource optimization and workload stability
+ type: label-element
+ - customClass: width-300
+ label: Pod LifeTime Threshold (e.g., 10m 30s)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/podLifeTimeThreshold
+ type: input
+ - elements:
+ - customClass: width-300
+ label: ResourceDiff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/resourceDiffPercentage
+ type: threshold-input
+ - label: Resource Configuration
+ subtitle: Define minimum and maximum allowed resources to ensure optimal database
+ performance
+ type: label-element
+ - elements:
+ - header: Minimum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|streamingnode|min
+ label: Min Allowed Profile
+ loader:
+ name: getMachines|streamingnode|min
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-streamingnode-max
+ schema: temp/properties/allowedMachine-streamingnode-min
+ type: machine-compare
+ watcher:
+ func: onMachineChange|streamingnode
+ paths:
+ - temp/properties/allowedMachine-streamingnode-min
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/minAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/minAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Min Allowed
+ showLabels: true
+ type: block-layout
+ - header: Maximum Resource Limit
+ if:
+ name: hasAnnotations
+ type: function
+ init:
+ type: func
+ value: setAllowedMachine|streamingnode|max
+ label: Max Allowed Profile
+ loader:
+ name: getMachines|streamingnode|max
+ watchPaths:
+ - temp/properties/topologyMachines
+ - temp/properties/allowedMachine-streamingnode-min
+ schema: temp/properties/allowedMachine-streamingnode-max
+ type: machine-compare
+ watcher:
+ func: onMachineChange|streamingnode
+ paths:
+ - temp/properties/allowedMachine-streamingnode-max
+ - elements:
+ - label: Cpu
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/maxAllowed/properties/cpu
+ type: input-compare
+ - label: Memory
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/maxAllowed/properties/memory
+ type: input-compare
+ fixedBlock: true
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Max Allowed
+ showLabels: true
+ type: block-layout
+ showLabels: false
+ type: block-layout
+ - label: Controlled Resources
+ loader: setControlledResources|streamingnode
+ multiple: true
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/streamingnode/properties/controlledResources
+ type: select
+ label: StreamingNode
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusDistributed
+ type: function
+ label: StreamingNode
+ showLabels: true
+ type: block-layout
+ - elements:
+ - label: Select NodeTopology
+ loader: fetchNodeTopology
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/nodeTopology/properties/name
+ type: select
+ - if:
+ name: isNodeTopologySelected
+ type: function
+ label: ScaleUp Diff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/nodeTopology/properties/scaleUpDiffPercentage
+ type: threshold-input
+ - if:
+ name: isNodeTopologySelected
+ type: function
+ label: ScaleDown Diff Percentage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/compute/properties/nodeTopology/properties/scaleDownDiffPercentage
+ type: threshold-input
+ if:
+ name: hasNoAnnotations
+ type: function
+ label: Node Topology
+ showLabels: true
+ type: block-layout
+ - elements:
+ - label: Timeout
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/opsRequestOptions/properties/timeout
+ type: time-picker
+ - init:
+ type: func
+ value: setApplyToIfReady
+ label: Apply
+ options:
+ - text: IfReady (OpsRequest will be applied if database is ready)
+ value: IfReady
+ - text: Always (OpsRequest will always be applied)
+ value: Always
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/opsRequestOptions/properties/apply
+ type: radio
+ if:
+ name: showOpsRequestOptions
+ type: function
+ label: Ops Request Options
+ showLabels: true
+ type: block-layout
+ id: compute-autoscaler
+ loader: getMilvusDbDetails
+ type: single-step-form
+- elements:
+ - elements:
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/storage/node/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/node/properties/trigger
+ type: switch
+ - label: Expansion Mode (Online/Offline)
+ subtitle: Online Mode enables scaling without downtime by dynamically resizing
+ storage while the database remains operational. Offline Mode performs storage
+ scaling during scheduled downtime, ensuring consistency but requiring database
+ restarts.
+ type: label-element
+ - description: Select how the storage expansion should be handled.
+ label: Mode
+ options:
+ - text: Online
+ value: Online
+ - text: Offline
+ value: Offline
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/node/properties/expansionMode
+ type: select
+ - elements:
+ - label: UsageThreshold (%)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/node/properties/usageThreshold
+ subtitle: Set the threshold percentage of storage usage to trigger scaling.
+ type: threshold-input
+ - label: Scaling Rules
+ loader: setValueFromDbDetails|resources/kubedbComMilvus/spec/storage/resources/requests/storage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/node/properties/scalingRules
+ type: scaling-rules
+ watcher:
+ func: handleUnit|autoscalingKubedbComMilvusAutoscaler/spec/storage/node/scalingRules|scalingRules
+ paths:
+ - schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/node/properties/scalingRules
+ - label: UpperBound
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/node/properties/upperBound
+ type: input
+ watcher:
+ func: handleUnit|autoscalingKubedbComMilvusAutoscaler/spec/storage/node/upperBound
+ paths:
+ - schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/node/properties/upperBound
+ label: Node
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusStandalone
+ type: function
+ showLabels: false
+ type: block-layout
+ - elements:
+ - fullwidth: true
+ init:
+ type: func
+ value: setTrigger|autoscalingKubedbComMilvusAutoscaler/spec/storage/streamingnode/trigger
+ label: Trigger
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/streamingnode/properties/trigger
+ type: switch
+ - label: Expansion Mode (Online/Offline)
+ subtitle: Online Mode enables scaling without downtime by dynamically resizing
+ storage while the database remains operational. Offline Mode performs storage
+ scaling during scheduled downtime, ensuring consistency but requiring database
+ restarts.
+ type: label-element
+ - description: Select how the storage expansion should be handled.
+ label: Mode
+ options:
+ - text: Online
+ value: Online
+ - text: Offline
+ value: Offline
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/streamingnode/properties/expansionMode
+ type: select
+ - elements:
+ - label: UsageThreshold (%)
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/streamingnode/properties/usageThreshold
+ subtitle: Set the threshold percentage of storage usage to trigger scaling.
+ type: threshold-input
+ - label: Scaling Rules
+ loader: setValueFromDbDetails|resources/kubedbComMilvus/spec/topology/distributed/streamingnode/storage/resources/requests/storage
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/streamingnode/properties/scalingRules
+ type: scaling-rules
+ watcher:
+ func: handleUnit|autoscalingKubedbComMilvusAutoscaler/spec/storage/streamingnode/scalingRules|scalingRules
+ paths:
+ - schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/streamingnode/properties/scalingRules
+ - label: UpperBound
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/streamingnode/properties/upperBound
+ type: input
+ watcher:
+ func: handleUnit|autoscalingKubedbComMilvusAutoscaler/spec/storage/streamingnode/upperBound
+ paths:
+ - schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/storage/properties/streamingnode/properties/upperBound
+ label: StreamingNode
+ showLabels: true
+ type: block-layout
+ if:
+ name: isMilvusDistributed
+ type: function
+ showLabels: false
+ type: block-layout
+ showLabels: false
+ type: block-layout
+ - elements:
+ - label: Timeout
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/opsRequestOptions/properties/timeout
+ type: time-picker
+ - init:
+ type: func
+ value: setApplyToIfReady
+ label: Apply
+ options:
+ - text: IfReady (OpsRequest will be applied if database is ready)
+ value: IfReady
+ - text: Always (OpsRequest will always be applied)
+ value: Always
+ schema: schema/properties/resources/properties/autoscalingKubedbComMilvusAutoscaler/properties/spec/properties/opsRequestOptions/properties/apply
+ type: radio
+ if:
+ name: showOpsRequestOptions
+ type: function
+ label: OpsRequest Options
+ showLabels: true
+ type: block-layout
+ id: storage-autoscaler
+ loader: getMilvusDbDetails
+ type: single-step-form
+- elements:
+ - label: To update Exporter Resource section click on Create OpsRequest
+ type: label-element
+ - init:
+ type: func
+ value: getOpsRequestUrl|scale-vertically
+ label: Create OpsRequest
+ schema: temp/properties/opsRequestUrl
+ type: anchor
+ - fullwidth: true
+ init:
+ type: func
+ value: isValueExistInModel|/resources/kubedbComMilvus/spec/monitor
+ label: Enable Monitoring
+ schema: temp/properties/enableMonitoring
+ type: switch
+ watcher:
+ func: onEnableMonitoringChange
+ paths:
+ - temp/properties/enableMonitoring
+ - elements:
+ - init:
+ type: static
+ value: prometheus.io/operator
+ isHorizontal: true
+ label: Select a Monitoring Method
+ options:
+ - description: Inject metric exporter sidecar and creates a ServiceMonitor
+ text: Prometheus Operator
+ value: prometheus.io/operator
+ - description: Injects the metric exporter sidecar and let you customize ServiceMonitor
+ text: Custom ServiceMonitor
+ value: prometheus.io
+ - description: Inject metric exporter sidecar and add Prometheus annotations
+ to the stats Service
+ text: Custom Scrapper
+ value: prometheus.io/builtin
+ schema: schema/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/agent
+ type: radio
+ watcher:
+ func: onAgentChange
+ paths:
+ - schema/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/agent
+ - elements:
+ - label: Scrapping Interval
+ schema: schema/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/serviceMonitor/properties/interval
+ type: input
+ if:
+ name: isEqualToModelPathValue|prometheus.io/operator|/resources/kubedbComMilvus/spec/monitor/agent
+ type: function
+ label: ServiceMonitor Configuration
+ showLabels: true
+ type: block-layout
+ - elements:
+ - buttonClass: is-light is-outlined
+ elements:
+ - fullwidth: true
+ label: Honor labels
+ schema: honorLabels
+ type: switch
+ - label: Interval
+ schema: interval
+ type: input
+ validation:
+ type: required
+ - label: Path
+ schema: path
+ type: input
+ validation:
+ type: required
+ - label: Port
+ schema: port
+ type: input
+ validation:
+ type: required
+ label: Endpoints
+ schema: schema/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/endpoints
+ type: array-object-form
+ - if:
+ name: returnFalse
+ type: function
+ label: Match Namespaces
+ loader: getNamespaces
+ multiple: true
+ schema: schema/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/namespaceSelector/properties/matchNames
+ type: select
+ - elements:
+ - label: Labels
+ schema: schema/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/spec/properties/selector/properties/matchLabels
+ type: object-item
+ if:
+ name: returnFalse
+ type: function
+ showLabels: false
+ type: block-layout
+ if:
+ name: isEqualToModelPathValue|prometheus.io|/resources/kubedbComMilvus/spec/monitor/agent
+ type: function
+ label: Service Monitor
+ showLabels: true
+ type: block-layout
+ - buttonClass: is-light is-outlined
+ if:
+ name: isEqualToModelPathValue|prometheus.io|/resources/kubedbComMilvus/spec/monitor/agent
+ type: function
+ label: Labels
+ schema: schema/properties/resources/properties/monitoringCoreosComServiceMonitor/properties/metadata/properties/labels
+ type: object-item
+ - label: Exporter Configuration
+ schema: ""
+ type: label-element
+ - fullwidth: true
+ init:
+ type: static
+ value: true
+ label: Customize Exporter Sidecar
+ schema: temp/properties/customizeExporter
+ type: switch
+ watcher:
+ func: onCustomizeExporterChange
+ paths:
+ - temp/properties/customizeExporter
+ - elements:
+ - if:
+ name: returnFalse
+ type: function
+ label: Resources
+ schema: schema/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/resources
+ type: machine-compare
+ - label: Security Context
+ schema: ""
+ type: label-element
+ - label: Run as User
+ schema: schema/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/securityContext/properties/runAsUser
+ type: input
+ - label: Run as Group
+ schema: schema/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/securityContext/properties/runAsGroup
+ type: input
+ - label: Port
+ schema: schema/properties/resources/properties/kubedbComMilvus/properties/spec/properties/monitor/properties/prometheus/properties/exporter/properties/port
+ type: input
+ if:
+ name: showCustomizeExporterSection
+ type: function
+ label: Customer Exporter Section
+ showLabels: false
+ type: block-layout
+ if:
+ name: showMonitoringSection
+ type: function
+ type: block-layout
+ id: monitoring
+ loader: initMonitoring
+ 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
new file mode 100644
index 0000000000..09ed811475
--- /dev/null
+++ b/charts/kubedbcom-milvus-editor/ui/functions.js
@@ -0,0 +1,841 @@
+const { axios, useOperator, store } = window.vueHelpers || {}
+
+export const useFunc = (model) => {
+ const { getValue, setDiscriminatorValue, commit, storeGet, discriminator } = useOperator(
+ model,
+ store.state,
+ )
+
+ setDiscriminatorValue('/enableMonitoring', false)
+ setDiscriminatorValue('/customizeExporter', true)
+
+ function returnFalse() {
+ return false
+ }
+
+ function isRancherManaged() {
+ const managers = storeGet('/cluster/clusterDefinition/result/clusterManagers')
+ const found = managers.find((item) => item === 'Rancher')
+ return !!found
+ }
+
+ function isVariantAvailable() {
+ const variant = storeGet('/route/query/variant')
+ return !!variant
+ }
+
+ async function getNamespaces() {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+
+ const resp = await axios.get(`/clusters/${owner}/${cluster}/proxy/core/v1/namespaces`, {
+ params: { filter: { items: { metadata: { name: null } } } },
+ })
+
+ const resources = (resp && resp.data && resp.data.items) || []
+ return resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return { text: name, value: name }
+ })
+ }
+
+ function getCreateNameSpaceUrl() {
+ const user = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const domain = storeGet('/domain') || ''
+ if (domain.includes('bb.test')) {
+ return `http://console.bb.test:5990/console/${user}/kubernetes/${cluster}/core/v1/namespaces/create`
+ } else {
+ const editedDomain = domain.replace('kubedb', 'console')
+ return `${editedDomain}/console/${user}/kubernetes/${cluster}/core/v1/namespaces/create`
+ }
+ }
+
+ async function getMilvusVersions() {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+
+ try {
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/catalog.kubedb.com/v1alpha1/milvusversions`,
+ { params: { filter: { items: { metadata: { name: null } } } } },
+ )
+ const resources = (resp && resp.data && resp.data.items) || []
+ return resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return { text: name, value: name }
+ })
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+
+ async function getStorageClassNames() {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+
+ try {
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/storage.k8s.io/v1/storageclasses`,
+ { params: { filter: { items: { metadata: { name: null } } } } },
+ )
+ const resources = (resp && resp.data && resp.data.items) || []
+ return resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return { text: name, value: name }
+ })
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+
+ async function getSecrets() {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const namespace = getValue(model, '/metadata/release/namespace')
+ try {
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/core/v1/namespaces/${namespace}/secrets`,
+ { params: { filter: { items: { metadata: { name: null }, type: null } } } },
+ )
+ const items = (resp && resp.data && resp.data.items) || []
+ return items
+ .filter((item) => ['kubernetes.io/service-account-token', 'Opaque'].includes(item.type))
+ .map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return { text: name, value: name }
+ })
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+
+ 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 namespace = getValue(model, '/metadata/release/namespace')
+
+ if (kind === 'Issuer') {
+ const url = `/clusters/${owner}/${cluster}/proxy/cert-manager.io/v1/namespaces/${namespace}/issuers`
+ return getIssuer(url)
+ } else if (kind === 'ClusterIssuer') {
+ const url = `/clusters/${owner}/${cluster}/proxy/cert-manager.io/v1/clusterissuers`
+ return getIssuer(url)
+ } else {
+ return []
+ }
+
+ async function getIssuer(url) {
+ try {
+ const resp = await axios.get(url)
+ const resources = (resp && resp.data && resp.data.items) || []
+ return resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return { text: name, value: name }
+ })
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+ }
+
+ function setApiGroup() {
+ return 'cert-manager.io'
+ }
+
+ function getAliasOptions() {
+ return ['server', 'client', 'metrics-exporter']
+ }
+
+ function onNameChange() {
+ const dbName = getValue(model, '/metadata/release/name')
+ commit('wizard/model$update', {
+ path: '/resources/kubedbComMilvus/metadata/name',
+ value: dbName,
+ force: true,
+ })
+ }
+
+ function onNamespaceChange() {
+ const namespace = getValue(model, '/metadata/release/namespace')
+ commit('wizard/model$update', {
+ path: '/resources/kubedbComMilvus/metadata/namespace',
+ value: namespace,
+ force: true,
+ })
+ }
+
+ function onLabelChange() {
+ const labels = getValue(model, '/resources/kubedbComMilvus/metadata/labels')
+ commit('wizard/model$update', {
+ path: '/resources/kubedbComMilvus/metadata/labels',
+ value: labels,
+ force: true,
+ })
+ }
+
+ function disableLableChecker({ itemCtx }) {
+ const key = itemCtx?.key || ''
+ if (key.startsWith('app.kubernetes.io') || key.includes('helm')) return true
+ else return false
+ }
+
+ function isEqualToModelPathValue(value, path) {
+ const modelValue = getValue(model, path)
+ return modelValue === value
+ }
+
+ function returnTrue() {
+ return true
+ }
+
+ function returnStringYes() {
+ return 'yes'
+ }
+
+ function getCreateAuthSecret() {
+ const secret = getValue(model, '/resources/kubedbComMilvus/spec/authSecret/name')
+ return !secret
+ }
+
+ function onCreateAuthSecretChange({ getValue, discriminator, commit }) {
+ const createAuthSecret = getValue(discriminator, '/createAuthSecret')
+ if (!createAuthSecret) {
+ commit('wizard/model$delete', '/resources/kubedbComMilvus/spec/authSecret')
+ }
+ }
+
+ function showExistingSecretSection() {
+ const createAuthSecret = getValue(discriminator, '/createAuthSecret')
+ return !createAuthSecret
+ }
+
+ function showPasswordSection() {
+ const createAuthSecret = getValue(discriminator, '/createAuthSecret')
+ return !!createAuthSecret
+ }
+
+ function setAuthSecretPassword() {
+ return ''
+ }
+
+ function onAuthSecretPasswordChange({ getValue, discriminator, commit, model }) {
+ const password = getValue(discriminator, '/password')
+ if (password) {
+ commit('wizard/model$update', {
+ path: '/resources/secret_auth/stringData/password',
+ value: password,
+ force: true,
+ })
+ }
+ }
+
+ function onTlsConfigureChange() {
+ const configureTLS = getValue(discriminator, '/configureTLS')
+ if (!configureTLS) {
+ commit('wizard/model$delete', '/resources/kubedbComMilvus/spec/tls')
+ }
+ }
+
+ function showTlsConfigureSection() {
+ const configureTLS = getValue(discriminator, '/configureTLS')
+ return !!configureTLS
+ }
+
+ function setStorageClass() {
+ const deletionPolicy = getValue(model, '/resources/kubedbComMilvus/spec/deletionPolicy')
+ if (deletionPolicy === 'WipeOut' || deletionPolicy === 'Delete') {
+ commit('wizard/model$update', {
+ path: '/resources/kubedbComMilvus/spec/storageType',
+ value: 'Durable',
+ force: true,
+ })
+ }
+ }
+
+ function onEnableMonitoringChange() {
+ const enableMonitoring = getValue(discriminator, '/enableMonitoring')
+ if (!enableMonitoring) {
+ commit('wizard/model$delete', '/resources/kubedbComMilvus/spec/monitor')
+ }
+ }
+
+ function showMonitoringSection() {
+ const enableMonitoring = getValue(discriminator, '/enableMonitoring')
+ return !!enableMonitoring
+ }
+
+ function onAgentChange() {
+ const agent = getValue(model, '/resources/kubedbComMilvus/spec/monitor/agent')
+ if (agent !== 'prometheus.io') {
+ commit('wizard/model$delete', '/resources/monitoringCoreosComServiceMonitor')
+ }
+ }
+
+ function onCustomizeExporterChange() {
+ const customize = getValue(discriminator, '/customizeExporter')
+ if (!customize) {
+ commit('wizard/model$delete', '/resources/kubedbComMilvus/spec/monitor/prometheus/exporter')
+ }
+ }
+
+ function showCustomizeExporterSection() {
+ const customize = getValue(discriminator, '/customizeExporter')
+ return !!customize
+ }
+
+ function onSetCustomConfigChange() {
+ const setCustomConfig = getValue(discriminator, '/setCustomConfig')
+ if (setCustomConfig !== 'yes') {
+ commit('wizard/model$delete', '/resources/kubedbComMilvus/spec/configuration')
+ }
+ }
+
+ function setConfigurationSource() {
+ return 'use-existing-config'
+ }
+
+ function onConfigurationSourceChange() {
+ const source = getValue(discriminator, '/configurationSource')
+ if (source === 'use-existing-config') {
+ commit('wizard/model$delete', '/resources/kubedbComMilvus/spec/configuration/inline')
+ } else {
+ commit('wizard/model$delete', '/resources/kubedbComMilvus/spec/configuration/secretName')
+ }
+ }
+
+ function setConfiguration() {
+ return ''
+ }
+
+ function onConfigurationChange() {
+ const config = getValue(discriminator, '/configuration')
+ if (config) {
+ commit('wizard/model$update', {
+ path: '/resources/kubedbComMilvus/spec/configuration/inline',
+ value: { 'milvus.yaml': config },
+ force: true,
+ })
+ }
+ }
+
+ function isEqualToDiscriminatorPath(value, path) {
+ const discriminatorValue = getValue(discriminator, path)
+ return discriminatorValue === value
+ }
+
+ function isValueExistInModel(path) {
+ const modelValue = getValue(model, path) || null
+ return !!modelValue
+ }
+
+ function getOpsRequestUrl(reqType) {
+ const cluster = storeGet('/route/params/cluster')
+ const domain = storeGet('/domain') || ''
+ const owner = storeGet('/route/params/user')
+ const dbname = getValue(model, '/metadata/release/name')
+ const group = getValue(model, '/metadata/resource/group')
+ const kind = getValue(model, '/metadata/resource/kind')
+ const namespace = getValue(model, '/metadata/release/namespace')
+ const resource = getValue(model, '/metadata/resource/name')
+ const version = getValue(model, '/metadata/resource/version')
+ const routeRootPath = storeGet('/route/path')
+ const pathPrefix = `${domain}/db${routeRootPath}`
+ const pathSplit = pathPrefix.split('/').slice(0, -1).join('/')
+ const pathConstructedForKubedb = pathSplit + `/${reqType.toLowerCase()}?namespace=${namespace}`
+ const isKube = !!storeGet('/route/params/actions')
+ if (isKube) return pathConstructedForKubedb
+ else
+ return `${domain}/console/${owner}/kubernetes/${cluster}/ops.kubedb.com/v1alpha1/milvusopsrequests/create?name=${dbname}&namespace=${namespace}&group=${group}&version=${version}&resource=${resource}&kind=${kind}&page=operations&requestType=VerticalScaling`
+ }
+
+ function initMonitoring() {
+ const exporter = getValue(model, '/resources/kubedbComMilvus/spec/monitor/prometheus/exporter')
+ if (!exporter) {
+ setDiscriminatorValue('/customizeExporter', false)
+ }
+ }
+
+ // ── Autoscaling ────────────────────────────────────────────────────────────
+
+ let autoscaleType = ''
+ let dbDetails = {}
+ let instance = {}
+
+ function isKubedb() {
+ return !!storeGet('/route/params/actions')
+ }
+
+ function isConsole() {
+ const isKube = isKubedb()
+ if (isKube) {
+ const dbName = storeGet('/route/params/name') || ''
+ commit('wizard/model$update', {
+ path: '/resources/autoscalingKubedbComMilvusAutoscaler/spec/databaseRef/name',
+ value: dbName,
+ force: true,
+ })
+ const operation = storeGet('/route/params/actions') || ''
+ if (operation.length) {
+ const splitOp = operation.split('-')
+ if (splitOp.length > 2) autoscaleType = splitOp[2]
+ }
+ const date = Math.floor(Date.now() / 1000)
+ const modifiedName = `${dbName}-${date}-autoscaling-${autoscaleType}`
+ commit('wizard/model$update', {
+ path: '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/name',
+ value: modifiedName,
+ force: true,
+ })
+ const namespace = storeGet('/route/query/namespace') || ''
+ if (namespace) {
+ commit('wizard/model$update', {
+ path: '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/namespace',
+ value: namespace,
+ force: true,
+ })
+ }
+ }
+ return !isKube
+ }
+
+ async function getMilvusDbs() {
+ const namespace = getValue(
+ model,
+ '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/namespace',
+ )
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ try {
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/kubedb.com/v1alpha2/namespaces/${namespace}/milvuses`,
+ { params: { filter: { items: { metadata: { name: null } } } } },
+ )
+ const resources = (resp && resp.data && resp.data.items) || []
+ return resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return { text: name, value: name }
+ })
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+
+ function initAutoscalerMetadata() {
+ const dbName =
+ getValue(model, '/resources/autoscalingKubedbComMilvusAutoscaler/spec/databaseRef/name') || ''
+ const type = getValue(discriminator, '/autoscalingType') || ''
+ const date = Math.floor(Date.now() / 1000)
+ const resource = storeGet('/route/params/resource')
+ const scalingName = dbName ? dbName : resource
+ const modifiedName = `${scalingName}-${date}-autoscaling-${type || ''}`
+ if (modifiedName)
+ commit('wizard/model$update', {
+ path: '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/name',
+ value: modifiedName,
+ force: true,
+ })
+ if (type === 'compute')
+ commit('wizard/model$delete', '/resources/autoscalingKubedbComMilvusAutoscaler/spec/storage')
+ if (type === 'storage')
+ commit('wizard/model$delete', '/resources/autoscalingKubedbComMilvusAutoscaler/spec/compute')
+ }
+
+ async function getMilvusDbDetails() {
+ const annotations =
+ getValue(model, '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/annotations') || {}
+ instance = annotations?.['kubernetes.io/instance-type']
+ const owner = storeGet('/route/params/user') || ''
+ const cluster = storeGet('/route/params/cluster') || ''
+ const namespace =
+ storeGet('/route/query/namespace') || getValue(model, '/metadata/release/namespace') || ''
+ const name =
+ storeGet('/route/params/name') ||
+ getValue(model, '/resources/autoscalingKubedbComMilvusAutoscaler/spec/databaseRef/name') ||
+ ''
+
+ if (namespace && name) {
+ try {
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/kubedb.com/v1alpha2/namespaces/${namespace}/milvuses/${name}`,
+ )
+ dbDetails = resp.data || {}
+ setDiscriminatorValue('/dbDetails', true)
+ } catch (e) {
+ console.log(e)
+ }
+ }
+
+ commit('wizard/model$update', { path: '/metadata/release/name', value: name, force: true })
+ commit('wizard/model$update', {
+ path: '/metadata/release/namespace',
+ value: namespace,
+ force: true,
+ })
+ commit('wizard/model$update', {
+ path: '/resources/autoscalingKubedbComMilvusAutoscaler/spec/databaseRef/name',
+ value: name,
+ force: true,
+ })
+ commit('wizard/model$update', {
+ path: '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/labels',
+ value: dbDetails.metadata?.labels,
+ force: true,
+ })
+
+ await fetchTopologyMachines()
+ }
+
+ function isMilvusStandalone() {
+ const loaded = getValue(discriminator, '/dbDetails')
+ if (!loaded) return false
+ return !dbDetails?.spec?.topology?.distributed
+ }
+
+ function isMilvusDistributed() {
+ const loaded = getValue(discriminator, '/dbDetails')
+ if (!loaded) return false
+ return !!dbDetails?.spec?.topology?.distributed
+ }
+
+ function setTrigger(path) {
+ const value = getValue(model, `/resources/${path}`)
+ if (value) return value
+ return 'On'
+ }
+
+ async function fetchTopologyMachines() {
+ const annotations =
+ getValue(model, '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/annotations') || {}
+ instance = annotations['kubernetes.io/instance-type']
+ const user = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ if (instance) {
+ try {
+ const url = `/clusters/${user}/${cluster}/proxy/node.k8s.appscode.com/v1alpha1/nodetopologies/kubedb-ui-machine-profiles`
+ const resp = await axios.get(url)
+ const nodeGroups = resp.data?.spec?.nodeGroups || []
+ setDiscriminatorValue('/topologyMachines', nodeGroups)
+ } catch (e) {
+ console.log(e)
+ setDiscriminatorValue('/topologyMachines', [])
+ }
+ }
+ }
+
+ function getMachines(type, minmax) {
+ const depends = minmax === 'min' ? 'max' : 'min'
+ const dependantPath = `/allowedMachine-${type}-${depends}`
+ const dependantMachineObj = getValue(discriminator, dependantPath)
+ const dependantMachine = dependantMachineObj?.machine || ''
+
+ const nodeGroups = getValue(discriminator, '/topologyMachines') || []
+ const dependantIndex = nodeGroups?.findIndex((item) => item.topologyValue === dependantMachine)
+
+ const machines = nodeGroups?.map((item) => ({
+ text: item.topologyValue,
+ subtext: `CPU: ${item.allocatable?.cpu}, Memory: ${item.allocatable?.memory}`,
+ value: {
+ machine: item.topologyValue,
+ cpu: item.allocatable?.cpu,
+ memory: item.allocatable?.memory,
+ },
+ }))
+
+ const filteredMachine = machines?.filter((item, ind) =>
+ minmax === 'min' ? ind <= dependantIndex : ind >= dependantIndex,
+ )
+
+ return dependantIndex === -1 ? machines : filteredMachine
+ }
+
+ function setAllowedMachine(type, minmax) {
+ let parsedInstance = {}
+ try {
+ if (instance) parsedInstance = JSON.parse(instance)
+ } catch (e) {
+ parsedInstance = {}
+ }
+
+ const machine = parsedInstance[type] || ''
+ const mx = machine?.includes(',') ? machine.split(',')[1] : ''
+ const mn = machine?.includes(',') ? machine.split(',')[0] : ''
+ const machineName = minmax === 'min' ? mn : mx
+
+ const nodeGroups = getValue(discriminator, '/topologyMachines') || []
+ const machineData = nodeGroups.find((item) => item.topologyValue === machineName)
+
+ if (machineData) {
+ return {
+ machine: machineName,
+ cpu: machineData.allocatable?.cpu,
+ memory: machineData.allocatable?.memory,
+ }
+ }
+ return { machine: machineName || '', cpu: '', memory: '' }
+ }
+
+ function onMachineChange(nodeType) {
+ const annoPath = '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/annotations'
+ const annotations = getValue(model, annoPath) || {}
+ const inst = annotations['kubernetes.io/instance-type']
+ let parsedInstance = {}
+ try {
+ if (inst) parsedInstance = JSON.parse(inst)
+ } catch (e) {
+ parsedInstance = {}
+ }
+
+ const minMachineObj = getValue(discriminator, `/allowedMachine-${nodeType}-min`)
+ const maxMachineObj = getValue(discriminator, `/allowedMachine-${nodeType}-max`)
+ const minMachine = minMachineObj?.machine || ''
+ const maxMachine = maxMachineObj?.machine || ''
+ const minMaxMachine = `${minMachine},${maxMachine}`
+
+ parsedInstance[nodeType] = minMaxMachine
+ const instanceString = JSON.stringify(parsedInstance)
+ annotations['kubernetes.io/instance-type'] = instanceString
+
+ const minMachineAllocatable = minMachineObj
+ ? { cpu: minMachineObj.cpu, memory: minMachineObj.memory }
+ : null
+ const maxMachineAllocatable = maxMachineObj
+ ? { cpu: maxMachineObj.cpu, memory: maxMachineObj.memory }
+ : null
+ const allowedPath = `/resources/autoscalingKubedbComMilvusAutoscaler/spec/compute/${nodeType}`
+
+ if (minMachine && maxMachine && inst !== instanceString) {
+ commit('wizard/model$update', {
+ path: `${allowedPath}/maxAllowed`,
+ value: maxMachineAllocatable,
+ force: true,
+ })
+ commit('wizard/model$update', {
+ path: `${allowedPath}/minAllowed`,
+ value: minMachineAllocatable,
+ force: true,
+ })
+ commit('wizard/model$update', { path: annoPath, value: annotations, force: true })
+ }
+ }
+
+ function setControlledResources(type) {
+ const list = ['cpu', 'memory']
+ const path = `/resources/autoscalingKubedbComMilvusAutoscaler/spec/${type}/controlledResources`
+ commit('wizard/model$update', { path, value: list, force: true })
+ return list
+ }
+
+ function hasAnnotations() {
+ const annotations =
+ getValue(model, '/resources/autoscalingKubedbComMilvusAutoscaler/metadata/annotations') || {}
+ return !!annotations['kubernetes.io/instance-type']
+ }
+
+ function hasNoAnnotations() {
+ return !hasAnnotations()
+ }
+
+ async function fetchNodeTopology() {
+ const owner = storeGet('/route/params/user') || ''
+ const cluster = storeGet('/route/params/cluster') || ''
+ try {
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/node.k8s.appscode.com/v1alpha1/nodetopologies`,
+ )
+ const list = (resp && resp.data?.items) || []
+ return list.map((item) => (item.metadata && item.metadata.name) || '')
+ } catch (e) {
+ console.log(e)
+ }
+ return []
+ }
+
+ function isNodeTopologySelected() {
+ const nodeTopologyName =
+ getValue(
+ model,
+ '/resources/autoscalingKubedbComMilvusAutoscaler/spec/compute/nodeTopology/name',
+ ) || ''
+ return !!nodeTopologyName.length
+ }
+
+ function showOpsRequestOptions() {
+ if (isKubedb()) return true
+ return (
+ !!getValue(
+ model,
+ '/resources/autoscalingKubedbComMilvusAutoscaler/spec/databaseRef/name',
+ ) && !!getValue(discriminator, '/autoscalingType')
+ )
+ }
+
+ function setApplyToIfReady() {
+ return 'IfReady'
+ }
+
+ function handleUnit(path, type = 'bound') {
+ let value = getValue(model, `/resources/${path}`)
+ if (type === 'scalingRules') {
+ const updatedValue = []
+ value?.forEach((ele) => {
+ let appliesUpto = ele['appliesUpto']
+ let threshold = ele['threshold']
+ if (appliesUpto && !isNaN(appliesUpto)) appliesUpto += 'Gi'
+ if (!isNaN(threshold)) threshold += 'pc'
+ updatedValue.push({ threshold, appliesUpto })
+ })
+ if (JSON.stringify(updatedValue) !== JSON.stringify(value)) {
+ commit('wizard/model$update', {
+ path: `/resources/${path}`,
+ value: updatedValue,
+ force: true,
+ })
+ }
+ } else {
+ if (!isNaN(value)) {
+ value += 'Gi'
+ commit('wizard/model$update', { path: `/resources/${path}`, value, force: true })
+ }
+ }
+ }
+
+ function setValueFromDbDetails(path) {
+ return getValue(model, path)
+ }
+
+ // ── End Autoscaling ────────────────────────────────────────────────────────
+
+ async function resourceNames(group, version, resource) {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const namespace = getValue(model, '/metadata/release/namespace')
+
+ try {
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/${group}/${version}/namespaces/${namespace}/${resource}`,
+ { params: { filter: { items: { metadata: { name: null }, type: null } } } },
+ )
+ let items = (resp && resp.data && resp.data.items) || []
+ if (resource === 'secrets') {
+ items = items.filter((item) => {
+ const validType = ['kubernetes.io/service-account-token', 'Opaque']
+ return validType.includes(item.type)
+ })
+ }
+ return items.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return { text: name, value: name }
+ })
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+
+ function fetchJsons({ axios, itemCtx }) {
+ let ui = {}
+ let language = {}
+ let functions = {}
+ const { name, sourceRef, version, packageviewUrlPrefix } = itemCtx.chart
+
+ try {
+ ui = axios.get(
+ `${packageviewUrlPrefix}/create-ui.yaml?name=${name}&sourceApiGroup=${sourceRef.apiGroup}&sourceKind=${sourceRef.kind}&sourceNamespace=${sourceRef.namespace}&sourceName=${sourceRef.name}&version=${version}&format=json`,
+ )
+ language = axios.get(
+ `${packageviewUrlPrefix}/language.yaml?name=${name}&sourceApiGroup=${sourceRef.apiGroup}&sourceKind=${sourceRef.kind}&sourceNamespace=${sourceRef.namespace}&sourceName=${sourceRef.name}&version=${version}&format=json`,
+ )
+ const functionString = axios.get(
+ `${packageviewUrlPrefix}/functions.js?name=${name}&sourceApiGroup=${sourceRef.apiGroup}&sourceKind=${sourceRef.kind}&sourceNamespace=${sourceRef.namespace}&sourceName=${sourceRef.name}&version=${version}`,
+ )
+ const evalFunc = new Function(functionString.data || '')
+ functions = evalFunc()
+ } catch (e) {
+ console.log(e)
+ }
+
+ return {
+ ui: ui.data || {},
+ language: language.data || {},
+ functions,
+ }
+ }
+
+ return {
+ returnFalse,
+ returnTrue,
+ returnStringYes,
+ isRancherManaged,
+ isVariantAvailable,
+ getNamespaces,
+ getCreateNameSpaceUrl,
+ getMilvusVersions,
+ getStorageClassNames,
+ getSecrets,
+ getIssuerRefsName,
+ setApiGroup,
+ getAliasOptions,
+ onNameChange,
+ onNamespaceChange,
+ onLabelChange,
+ disableLableChecker,
+ isEqualToModelPathValue,
+ isEqualToDiscriminatorPath,
+ isValueExistInModel,
+ getOpsRequestUrl,
+ initMonitoring,
+ getCreateAuthSecret,
+ onCreateAuthSecretChange,
+ showExistingSecretSection,
+ showPasswordSection,
+ setAuthSecretPassword,
+ onAuthSecretPasswordChange,
+ onTlsConfigureChange,
+ showTlsConfigureSection,
+ setStorageClass,
+ onEnableMonitoringChange,
+ showMonitoringSection,
+ onAgentChange,
+ onCustomizeExporterChange,
+ showCustomizeExporterSection,
+ onSetCustomConfigChange,
+ setConfigurationSource,
+ onConfigurationSourceChange,
+ setConfiguration,
+ onConfigurationChange,
+ resourceNames,
+ fetchJsons,
+ // Autoscaling
+ isKubedb,
+ isConsole,
+ getMilvusDbs,
+ initAutoscalerMetadata,
+ getMilvusDbDetails,
+ isMilvusStandalone,
+ isMilvusDistributed,
+ setTrigger,
+ fetchTopologyMachines,
+ getMachines,
+ setAllowedMachine,
+ onMachineChange,
+ setControlledResources,
+ hasAnnotations,
+ hasNoAnnotations,
+ fetchNodeTopology,
+ isNodeTopologySelected,
+ showOpsRequestOptions,
+ setApplyToIfReady,
+ handleUnit,
+ setValueFromDbDetails,
+ }
+}
diff --git a/charts/kubedbcom-milvus-editor/ui/language.yaml b/charts/kubedbcom-milvus-editor/ui/language.yaml
new file mode 100644
index 0000000000..46ccb90b63
--- /dev/null
+++ b/charts/kubedbcom-milvus-editor/ui/language.yaml
@@ -0,0 +1,144 @@
+bn: {}
+en:
+ labels:
+ agent: Select a Monitoring Method
+ milvus: Milvus
+ alias: Alias
+ annotations:
+ key: Key
+ label: Annotations
+ value: Value
+ api_group: API Group
+ apply: Apply
+ args: Args
+ basic_info: Basic Information
+ certificate: Certificate
+ certificates: Certificates
+ client_auth_mode: Client Auth Mode
+ config_map_key: ConfigMap Key
+ config_map_name: ConfigMap Name
+ configuration: Configuration
+ configuration_files: Configuration Files
+ configuration_source: Configuration Source
+ countries: Countries
+ country: Country
+ cpu: CPU
+ customize_exporter: Customize Exporter Sidecar
+ database:
+ mode: Database Mode
+ name: Milvus Name
+ secret: Database Secret
+ version: Database Version
+ deletionPolicy: Deletion Policy
+ dns_name: DNS Name
+ dns_names: DNS Names
+ duration: Duration
+ enable_monitoring: Enable Monitoring
+ enable_tls: Enable TLS
+ endpoint: Endpoint
+ endpoints: Endpoints
+ exporter: Exporter
+ exporter_configuration: Exporter Configuration
+ honor_labels: Honor labels
+ interval: Interval
+ ip_address: IP Address
+ ip_addresses: IP Addresses
+ issuer_ref: Issuer Reference
+ key: Key
+ kind: Kind
+ labels:
+ key: Key
+ label: Labels
+ value: Value
+ memory: Memory
+ name: Name
+ namespace: Namespace
+ new_secret_password: New Database Secret
+ node: Node
+ organization: Organization
+ organizational_unit: Organizational Unit
+ organizational_units: Organizational Units
+ organizations: Organizations
+ password: Password (Keep it empty to autogenerate)
+ path: Path
+ pod_template: Pod Template
+ port: Port
+ province: Province
+ provinces: Provinces
+ renew_before: Renew Before
+ replicaset:
+ number: Replica Number
+ replicas: Replicas
+ resources: Resources
+ run_as_group: Run as Group
+ run_as_user: Run as User
+ scrapping_interval: Scrapping Interval
+ secret: Secret
+ security_context: Security Context
+ service_monitor: Service Monitor
+ service_monitor_configuration: ServiceMonitor Configuration
+ service_template: Service Template
+ service_templates: Service Templates
+ setCustomConfig: Custom Config?
+ storage:
+ class: Storage Class
+ size: Storage Size
+ subject: Subject
+ targetVersion: Select Target Version
+ timeout: Timeout
+ tls: TLS Configuration
+ type: Type
+ value: Value
+ add_new_namespace: Add New Namespace
+ hanadb_cnf: milvus.yaml
+ alert: Alert
+ matchNames: Match Names
+ weight: Weight
+ options:
+ deletionPolicy:
+ delete:
+ description: Delete all database resources
+ label: Delete
+ halt:
+ description: Halt database but keep data
+ label: Halt
+ wipeOut:
+ description: Completely wipe out the database
+ label: WipeOut
+ doNotTerminate:
+ description: Prevent accidental deletion
+ label: DoNotTerminate
+ database:
+ secret:
+ existingSecret:
+ label: Use Existing Secret
+ customSecret:
+ label: New Secret
+ yesOrNo:
+ yes:
+ text: "Yes"
+ no:
+ text: "No"
+ configuration_source:
+ use_existing_config:
+ label: Use Existing Config
+ create_new_config:
+ label: Create New Config
+ agent:
+ prometheus_operator:
+ description: Inject metric exporter sidecar and creates a ServiceMonitor
+ label: Prometheus Operator
+ prometheus:
+ description: Injects the metric exporter sidecar and let you customize ServiceMonitor
+ label: Custom ServiceMonitor
+ prometheus_builtin:
+ description: Inject metric exporter sidecar and add Prometheus annotations to the stats Service
+ label: Custom Scrapper
+ steps:
+ - label: Basic Information
+ - label: Topology
+ - label: TLS
+ - label: Monitoring
+ - label: Pod Template
+ - label: Networking
+ - label: Custom Config
diff --git a/charts/opskubedbcom-milvusopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-milvusopsrequest-editor/ui/create-ui.yaml
new file mode 100644
index 0000000000..b2014019c8
--- /dev/null
+++ b/charts/opskubedbcom-milvusopsrequest-editor/ui/create-ui.yaml
@@ -0,0 +1,1025 @@
+step:
+- elements:
+ - if:
+ name: showAndInitName
+ type: function
+ label: op_req_name
+ schema: schema/properties/metadata/properties/name
+ type: input
+ validation:
+ type: required
+ - disable: isNamespaceDisabled
+ hasGroup: isRancherManaged
+ if:
+ name: showAndInitNamespace
+ type: function
+ init:
+ type: func
+ value: initNamespace
+ label: Namespace
+ loader: getNamespaces
+ schema: schema/properties/metadata/properties/namespace
+ type: select
+ validation:
+ type: required
+ watcher:
+ func: onNamespaceChange
+ paths:
+ - schema/properties/metadata/properties/namespace
+ - disable: isDatabaseRefDisabled
+ if:
+ name: showAndInitDatabaseRef
+ type: function
+ init:
+ type: func
+ value: initDatabaseRef
+ label: Database Ref
+ loader:
+ name: getDbs
+ watchPaths:
+ - schema/properties/metadata/properties/namespace
+ refresh: true
+ schema: schema/properties/spec/properties/databaseRef/properties/name
+ type: select
+ validation:
+ type: required
+ watcher:
+ func: onDbChange
+ paths:
+ - schema/properties/spec/properties/databaseRef/properties/name
+ - if:
+ name: showConfigureOpsrequestLabel
+ type: function
+ label: config_ops_request
+ type: label-element
+ - disable: isDbDetailsLoading
+ if:
+ name: showAndInitOpsRequestType
+ type: function
+ init:
+ type: func
+ value: getRequestTypeFromRoute
+ isHorizontal: true
+ label: Type of Ops Request
+ options:
+ - description: Update your database to any version
+ text: Update Version
+ value: UpdateVersion
+ - description: Scale up or down pod count
+ text: Horizontal Scaling
+ value: HorizontalScaling
+ - description: Manage your CPU resources
+ text: Vertical Scaling
+ value: VerticalScaling
+ - description: Manage your database size
+ text: Volume Expansion
+ value: VolumeExpansion
+ - description: Restart your database
+ text: Restart
+ value: Restart
+ - description: Reconfigure your database
+ text: Reconfigure
+ value: Reconfigure
+ - description: Reconfigure your database tls configuration
+ text: Reconfigure TLS
+ value: ReconfigureTLS
+ - description: Rotate authentication credentials
+ text: Rotate Auth
+ value: RotateAuth
+ - description: Migrate storage
+ text: Storage Migration
+ value: StorageMigration
+ schema: schema/properties/spec/properties/type
+ type: radio
+ watcher:
+ func: onRequestTypeChange
+ paths:
+ - schema/properties/spec/properties/type
+ - elements:
+ - init:
+ type: func
+ value: setValueFromDbDetails|/spec/version
+ label: Target Version
+ loader: getDbVersions
+ schema: schema/properties/spec/properties/updateVersion/properties/targetVersion
+ subtitle: Select the desired Milvus version to which you want to update your
+ database.
+ type: select-compare
+ - if:
+ name: isVersionEmpty
+ type: function
+ label: ""
+ loader:
+ name: getVersionInfo
+ watchPaths:
+ - temp/properties/filteredVersion
+ type: info
+ fixedBlock: true
+ if:
+ name: ifRequestTypeEqualsTo|UpdateVersion
+ type: function
+ label: Version
+ showLabels: true
+ type: block-layout
+ - elements:
+ - elements:
+ - header: DataNode
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/topology/distributed/datanode/replicas
+ label: DataNode Replicas
+ schema: schema/properties/spec/properties/horizontalScaling/properties/topology/properties/dataNode
+ subtitle: Define the number of DataNode replicas
+ type: input-compare
+ type: horizontal-layout
+ - elements:
+ - header: MixCoord
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/topology/distributed/mixcoord/replicas
+ label: MixCoord Replicas
+ schema: schema/properties/spec/properties/horizontalScaling/properties/topology/properties/mixcoord
+ subtitle: Define the number of MixCoord replicas
+ type: input-compare
+ type: horizontal-layout
+ - elements:
+ - header: Proxy
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/topology/distributed/proxy/replicas
+ label: Proxy Replicas
+ schema: schema/properties/spec/properties/horizontalScaling/properties/topology/properties/proxy
+ subtitle: Define the number of Proxy replicas
+ type: input-compare
+ type: horizontal-layout
+ - elements:
+ - header: QueryNode
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/topology/distributed/querynode/replicas
+ label: QueryNode Replicas
+ schema: schema/properties/spec/properties/horizontalScaling/properties/topology/properties/querynode
+ subtitle: Define the number of QueryNode replicas
+ type: input-compare
+ type: horizontal-layout
+ - elements:
+ - header: StreamingNode
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/topology/distributed/streamingnode/replicas
+ label: StreamingNode Replicas
+ schema: schema/properties/spec/properties/horizontalScaling/properties/topology/properties/streamingnode
+ subtitle: Define the number of StreamingNode replicas
+ type: input-compare
+ type: horizontal-layout
+ fixedBlock: true
+ if:
+ name: ifRequestTypeEqualsTo|HorizontalScaling
+ type: function
+ label: Horizontal Scaling Form
+ showLabels: true
+ type: block-layout
+ - elements:
+ - elements:
+ - init:
+ type: func
+ value: setMachine|node
+ label: Resources
+ loader: getMachines|node
+ schema: temp/properties/machine-node
+ subtitle: Compare your current machine configuration with the proposed memory
+ adjustments and make informed decisions for your database setup
+ type: machine-compare
+ validation:
+ name: isMachineValid|node
+ type: custom
+ watcher:
+ func: onMachineChange|node|/spec/podTemplate/spec/resources
+ paths:
+ - temp/properties/machine-node
+ - elements:
+ - elements:
+ - elements:
+ - label: Node Selection Policy
+ subtitle: Control where your workloads runs by configuring node selection
+ criteria. Use label selectors to match specific nodes or taints to
+ avoid unsuitable nodes
+ type: label-element
+ - label: Node Selection Policy
+ options:
+ - text: LabelSelector
+ value: LabelSelector
+ - text: Taint
+ value: Taint
+ schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/nodeSelectionPolicy
+ type: select
+ hideBorder: true
+ showLabels: false
+ type: block-layout
+ - customClass: mt-20
+ label: Label Selector: Specify key-value pairs to target nodes
+ that match your workload's requirements.
Taints: Define
+ tolerations for node taints to ensure your workload runs only on compatible
+ nodes
+ type: info
+ type: horizontal-layout
+ - label: Topology
+ subtitle: Define node topology preferences, such as zone or region. For
+ example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
+ type: label-element
+ - elements:
+ - label: Key
+ schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/key
+ type: input
+ - label: Value
+ schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/value
+ type: input
+ type: horizontal-layout
+ label: Node Selection
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifDbTypeEqualsTo|standalone
+ type: function
+ label: Node
+ showLabels: true
+ type: block-layout
+ - elements:
+ - init:
+ type: func
+ value: setMachine|datanode
+ label: Resources
+ loader: getMachines|datanode
+ schema: temp/properties/machine-datanode
+ subtitle: Compare your current machine configuration with the proposed memory
+ adjustments and make informed decisions for your database setup
+ type: machine-compare
+ validation:
+ name: isMachineValid|datanode
+ type: custom
+ watcher:
+ func: onMachineChange|datanode|/spec/topology/distributed/datanode/podTemplate/spec/resources
+ paths:
+ - temp/properties/machine-datanode
+ - elements:
+ - elements:
+ - elements:
+ - label: Node Selection Policy
+ subtitle: Control where your workloads runs by configuring node selection
+ criteria. Use label selectors to match specific nodes or taints to
+ avoid unsuitable nodes
+ type: label-element
+ - label: Node Selection Policy
+ options:
+ - text: LabelSelector
+ value: LabelSelector
+ - text: Taint
+ value: Taint
+ schema: schema/properties/spec/properties/verticalScaling/properties/datanode/properties/nodeSelectionPolicy
+ type: select
+ hideBorder: true
+ showLabels: false
+ type: block-layout
+ - customClass: mt-20
+ label: Label Selector: Specify key-value pairs to target nodes
+ that match your workload's requirements.
Taints: Define
+ tolerations for node taints to ensure your workload runs only on compatible
+ nodes
+ type: info
+ type: horizontal-layout
+ - label: Topology
+ subtitle: Define node topology preferences, such as zone or region. For
+ example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
+ type: label-element
+ - elements:
+ - label: Key
+ schema: schema/properties/spec/properties/verticalScaling/properties/datanode/properties/topology/properties/key
+ type: input
+ - label: Value
+ schema: schema/properties/spec/properties/verticalScaling/properties/datanode/properties/topology/properties/value
+ type: input
+ type: horizontal-layout
+ label: Node Selection
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifDbTypeEqualsTo|distributed
+ type: function
+ label: DataNode
+ showLabels: true
+ type: block-layout
+ - elements:
+ - init:
+ type: func
+ value: setMachine|mixcoord
+ label: Resources
+ loader: getMachines|mixcoord
+ schema: temp/properties/machine-mixcoord
+ subtitle: Compare your current machine configuration with the proposed memory
+ adjustments and make informed decisions for your database setup
+ type: machine-compare
+ validation:
+ name: isMachineValid|mixcoord
+ type: custom
+ watcher:
+ func: onMachineChange|mixcoord|/spec/topology/distributed/mixcoord/podTemplate/spec/resources
+ paths:
+ - temp/properties/machine-mixcoord
+ - elements:
+ - elements:
+ - elements:
+ - label: Node Selection Policy
+ subtitle: Control where your workloads runs by configuring node selection
+ criteria. Use label selectors to match specific nodes or taints to
+ avoid unsuitable nodes
+ type: label-element
+ - label: Node Selection Policy
+ options:
+ - text: LabelSelector
+ value: LabelSelector
+ - text: Taint
+ value: Taint
+ schema: schema/properties/spec/properties/verticalScaling/properties/mixcoord/properties/nodeSelectionPolicy
+ type: select
+ hideBorder: true
+ showLabels: false
+ type: block-layout
+ - customClass: mt-20
+ label: Label Selector: Specify key-value pairs to target nodes
+ that match your workload's requirements.
Taints: Define
+ tolerations for node taints to ensure your workload runs only on compatible
+ nodes
+ type: info
+ type: horizontal-layout
+ - label: Topology
+ subtitle: Define node topology preferences, such as zone or region. For
+ example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
+ type: label-element
+ - elements:
+ - label: Key
+ schema: schema/properties/spec/properties/verticalScaling/properties/mixcoord/properties/topology/properties/key
+ type: input
+ - label: Value
+ schema: schema/properties/spec/properties/verticalScaling/properties/mixcoord/properties/topology/properties/value
+ type: input
+ type: horizontal-layout
+ label: Node Selection
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifDbTypeEqualsTo|distributed
+ type: function
+ label: MixCoord
+ showLabels: true
+ type: block-layout
+ - elements:
+ - init:
+ type: func
+ value: setMachine|proxy
+ label: Resources
+ loader: getMachines|proxy
+ schema: temp/properties/machine-proxy
+ subtitle: Compare your current machine configuration with the proposed memory
+ adjustments and make informed decisions for your database setup
+ type: machine-compare
+ validation:
+ name: isMachineValid|proxy
+ type: custom
+ watcher:
+ func: onMachineChange|proxy|/spec/topology/distributed/proxy/podTemplate/spec/resources
+ paths:
+ - temp/properties/machine-proxy
+ - elements:
+ - elements:
+ - elements:
+ - label: Node Selection Policy
+ subtitle: Control where your workloads runs by configuring node selection
+ criteria. Use label selectors to match specific nodes or taints to
+ avoid unsuitable nodes
+ type: label-element
+ - label: Node Selection Policy
+ options:
+ - text: LabelSelector
+ value: LabelSelector
+ - text: Taint
+ value: Taint
+ schema: schema/properties/spec/properties/verticalScaling/properties/proxy/properties/nodeSelectionPolicy
+ type: select
+ hideBorder: true
+ showLabels: false
+ type: block-layout
+ - customClass: mt-20
+ label: Label Selector: Specify key-value pairs to target nodes
+ that match your workload's requirements.
Taints: Define
+ tolerations for node taints to ensure your workload runs only on compatible
+ nodes
+ type: info
+ type: horizontal-layout
+ - label: Topology
+ subtitle: Define node topology preferences, such as zone or region. For
+ example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
+ type: label-element
+ - elements:
+ - label: Key
+ schema: schema/properties/spec/properties/verticalScaling/properties/proxy/properties/topology/properties/key
+ type: input
+ - label: Value
+ schema: schema/properties/spec/properties/verticalScaling/properties/proxy/properties/topology/properties/value
+ type: input
+ type: horizontal-layout
+ label: Node Selection
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifDbTypeEqualsTo|distributed
+ type: function
+ label: Proxy
+ showLabels: true
+ type: block-layout
+ - elements:
+ - init:
+ type: func
+ value: setMachine|querynode
+ label: Resources
+ loader: getMachines|querynode
+ schema: temp/properties/machine-querynode
+ subtitle: Compare your current machine configuration with the proposed memory
+ adjustments and make informed decisions for your database setup
+ type: machine-compare
+ validation:
+ name: isMachineValid|querynode
+ type: custom
+ watcher:
+ func: onMachineChange|querynode|/spec/topology/distributed/querynode/podTemplate/spec/resources
+ paths:
+ - temp/properties/machine-querynode
+ - elements:
+ - elements:
+ - elements:
+ - label: Node Selection Policy
+ subtitle: Control where your workloads runs by configuring node selection
+ criteria. Use label selectors to match specific nodes or taints to
+ avoid unsuitable nodes
+ type: label-element
+ - label: Node Selection Policy
+ options:
+ - text: LabelSelector
+ value: LabelSelector
+ - text: Taint
+ value: Taint
+ schema: schema/properties/spec/properties/verticalScaling/properties/querynode/properties/nodeSelectionPolicy
+ type: select
+ hideBorder: true
+ showLabels: false
+ type: block-layout
+ - customClass: mt-20
+ label: Label Selector: Specify key-value pairs to target nodes
+ that match your workload's requirements.
Taints: Define
+ tolerations for node taints to ensure your workload runs only on compatible
+ nodes
+ type: info
+ type: horizontal-layout
+ - label: Topology
+ subtitle: Define node topology preferences, such as zone or region. For
+ example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
+ type: label-element
+ - elements:
+ - label: Key
+ schema: schema/properties/spec/properties/verticalScaling/properties/querynode/properties/topology/properties/key
+ type: input
+ - label: Value
+ schema: schema/properties/spec/properties/verticalScaling/properties/querynode/properties/topology/properties/value
+ type: input
+ type: horizontal-layout
+ label: Node Selection
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifDbTypeEqualsTo|distributed
+ type: function
+ label: QueryNode
+ showLabels: true
+ type: block-layout
+ - elements:
+ - init:
+ type: func
+ value: setMachine|streamingnode
+ label: Resources
+ loader: getMachines|streamingnode
+ schema: temp/properties/machine-streamingnode
+ subtitle: Compare your current machine configuration with the proposed memory
+ adjustments and make informed decisions for your database setup
+ type: machine-compare
+ validation:
+ name: isMachineValid|streamingnode
+ type: custom
+ watcher:
+ func: onMachineChange|streamingnode|/spec/topology/distributed/streamingnode/podTemplate/spec/resources
+ paths:
+ - temp/properties/machine-streamingnode
+ - elements:
+ - elements:
+ - elements:
+ - label: Node Selection Policy
+ subtitle: Control where your workloads runs by configuring node selection
+ criteria. Use label selectors to match specific nodes or taints to
+ avoid unsuitable nodes
+ type: label-element
+ - label: Node Selection Policy
+ options:
+ - text: LabelSelector
+ value: LabelSelector
+ - text: Taint
+ value: Taint
+ schema: schema/properties/spec/properties/verticalScaling/properties/streamingnode/properties/nodeSelectionPolicy
+ type: select
+ hideBorder: true
+ showLabels: false
+ type: block-layout
+ - customClass: mt-20
+ label: Label Selector: Specify key-value pairs to target nodes
+ that match your workload's requirements.
Taints: Define
+ tolerations for node taints to ensure your workload runs only on compatible
+ nodes
+ type: info
+ type: horizontal-layout
+ - label: Topology
+ subtitle: Define node topology preferences, such as zone or region. For
+ example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
+ type: label-element
+ - elements:
+ - label: Key
+ schema: schema/properties/spec/properties/verticalScaling/properties/streamingnode/properties/topology/properties/key
+ type: input
+ - label: Value
+ schema: schema/properties/spec/properties/verticalScaling/properties/streamingnode/properties/topology/properties/value
+ type: input
+ type: horizontal-layout
+ label: Node Selection
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifDbTypeEqualsTo|distributed
+ type: function
+ label: StreamingNode
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifRequestTypeEqualsTo|VerticalScaling
+ type: function
+ type: block-layout
+ - elements:
+ - elements:
+ - elements:
+ - label: Mode
+ subtitle: Not sure which mode to pick? Use Online Mode for smooth operations
+ with minimal disruption. Choose Offline Mode if you can afford a brief
+ downtime for added reliability during the volume expansion.
+ type: label-element
+ - label: Mode
+ options:
+ - text: Offline
+ value: Offline
+ - text: Online
+ value: Online
+ schema: schema/properties/spec/properties/volumeExpansion/properties/mode
+ type: select
+ validation:
+ type: required
+ type: block-layout
+ type: horizontal-layout
+ - elements:
+ - header: Node
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/storage/resources/requests/storage
+ label: Node Storage Size
+ schema: schema/properties/spec/properties/volumeExpansion/properties/node
+ subtitle: How much extra storage does your database need? Specify the size
+ (e.g. 2Gi for 2 gigabytes) so we can allocate it correctly
+ type: input-compare
+ validation:
+ name: checkVolume|/spec/storage/resources/requests/storage|/spec/volumeExpansion/node
+ type: custom
+ fixedBlock: true
+ if:
+ name: ifDbTypeEqualsTo|standalone
+ type: function
+ label: Milvus volume expansion
+ showLabels: true
+ type: block-layout
+ - elements:
+ - header: StreamingNode
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/topology/distributed/streamingnode/storage/resources/requests/storage
+ label: Storage Size
+ schema: schema/properties/spec/properties/volumeExpansion/properties/streamingnode
+ subtitle: How much extra storage does StreamingNode need? Specify the size
+ (e.g. 2Gi for 2 gigabytes)
+ type: input-compare
+ validation:
+ name: checkVolume|/spec/topology/distributed/streamingnode/storage/resources/requests/storage|/spec/volumeExpansion/streamingnode
+ type: custom
+ fixedBlock: true
+ if:
+ name: ifDbTypeEqualsTo|distributed
+ type: function
+ label: Milvus volume expansion
+ showLabels: true
+ type: block-layout
+ if:
+ name: ifRequestTypeEqualsTo|VolumeExpansion
+ type: function
+ label: Volume Expansion Form
+ type: block-layout
+ - elements:
+ - label: ""
+ subtitle: The database will be restarted. This operation restarts all the pods
+ of the database.
+ type: label-element
+ if:
+ name: ifRequestTypeEqualsTo|Restart
+ type: function
+ label: Restart Form
+ type: block-layout
+ - elements:
+ - elements:
+ - label: ""
+ subtitle: Select a new configuration secret, apply a custom configuration,
+ or remove an existing setup to update your database settings
+ type: label-element
+ - elements:
+ - elements:
+ - customClass: mb-15
+ label: Config Secret
+ subtitle: Select an existing secret or create a new one to apply to your
+ database configuration.
+ type: label-element
+ - customClass: mb-2
+ init:
+ type: func
+ value: setValueFromDbDetails|/spec/configSecret/name
+ label: Config Secret
+ loader:
+ name: getConfigSecrets
+ watchPaths:
+ - schema/properties/metadata/properties/namespace
+ - temp/properties/createSecret/properties/status
+ refresh: fetchConfigSecrets
+ schema: schema/properties/spec/properties/configuration/properties/configSecret/properties/name
+ type: select
+ watcher:
+ func: onCreateSecretChange
+ paths:
+ - temp/properties/createSecret/properties/status
+ - customClass: mt-15
+ elements:
+ - label: ""
+ subtitle: Enter a unique name to identify this secret.
+ type: label-element
+ - label: Secret Name
+ schema: temp/properties/createSecret/properties/name
+ type: input
+ validation:
+ type: required
+ - buttonClass: is-light is-outlined
+ elements:
+ - label: Key
+ loader:
+ name: onSelectedSecretChange
+ watchPaths:
+ - temp/properties/createSecret/properties/data
+ schema: key
+ type: select
+ validation:
+ type: required
+ - height: 120px
+ label: Value
+ schema: value
+ type: textarea
+ keepInitial: true
+ label: String Data
+ schema: temp/properties/createSecret/properties/data
+ type: array-object-form
+ validation:
+ type: required
+ hasButton:
+ action: createNewConfigSecret
+ hasCancel: cancelCreateSecret
+ text: Save
+ if:
+ name: isCreateSecret
+ type: function
+ label: Create a New Config Secret
+ showLabels: true
+ type: block-layout
+ - editorHeight: 500px
+ hideFormatButton: true
+ if:
+ name: isNotCreateSecret
+ type: function
+ loader:
+ name: onNewConfigSecretChange
+ watchPaths:
+ - schema/properties/spec/properties/configuration/properties/configSecret/properties/name
+ readonly: true
+ schema: temp/properties/newConfigSecret
+ type: multi-file-editor
+ validateContent: false
+ if:
+ name: ifReconfigurationTypeEqualsTo|selectNewConfigSecret
+ type: function
+ label: Config Secret
+ type: block-layout
+ - elements:
+ - customClass: mb-15
+ label: New Apply Config
+ subtitle: Define custom configurations for your database using key-value
+ pairs. These parameters will overwrite existing settings.
Enter the
+ parameter you want to configure.
+ type: label-element
+ - customClass: mb-2
+ label: Configuration
+ loader: getConfigSecretsforAppyConfig
+ refresh: fetchConfigSecrets
+ schema: temp/properties/selectedConfiguration
+ type: select
+ - editorHeight: 500px
+ hideFormatButton: true
+ loader:
+ name: setApplyConfig
+ watchPaths:
+ - temp/properties/selectedConfiguration
+ schema: temp/properties/applyConfig
+ type: multi-file-editor
+ validateContent: false
+ watcher:
+ func: onApplyconfigChange
+ paths:
+ - temp/properties/applyConfig
+ if:
+ name: ifReconfigurationTypeEqualsTo|applyConfig
+ type: function
+ label: ApplyConfig
+ type: block-layout
+ - elements:
+ - customClass: mb-15
+ label: Remove
+ subtitle: Selected a configuration secret from the available list to update
+ your database settings
+ type: label-element
+ - customClass: mb-2
+ label: Configuration
+ loader:
+ name: getConfigSecretsforAppyConfig
+ watchPaths:
+ - schema/properties/metadata/properties/namespace
+ refresh: fetchConfigSecrets
+ schema: temp/properties/selectedConfigurationRemove
+ type: select
+ - editorHeight: 500px
+ hideFormatButton: true
+ init:
+ type: func
+ value: onRemoveConfigChange
+ readonly: true
+ schema: temp/properties/removeConfig
+ type: multi-file-editor
+ validateContent: false
+ watcher:
+ func: onRemoveConfigChange
+ paths:
+ - temp/properties/selectedConfigurationRemove
+ if:
+ name: ifReconfigurationTypeEqualsTo|remove
+ type: function
+ label: Remove
+ type: block-layout
+ label: New Config Secret
+ options:
+ - text: NEW CONFIG SECRET
+ value: selectNewConfigSecret
+ - text: APPLY CONFIG
+ value: applyConfig
+ - text: REMOVE
+ value: remove
+ schema: temp/properties/reconfigurationType
+ type: tab-layout
+ label: Configuration
+ type: block-layout
+ if:
+ name: ifRequestTypeEqualsTo|Reconfigure
+ type: function
+ label: Reconfigure Form
+ loader:
+ name: fetchConfigSecrets
+ watchPaths:
+ - schema/properties/metadata/properties/namespace
+ type: block-layout
+ - elements:
+ - if:
+ name: hasTlsField
+ type: function
+ init:
+ type: func
+ value: initTlsOperation
+ label: TLS Operation
+ options:
+ - text: Update
+ value: update
+ - text: Rotate
+ value: rotate
+ - text: Remove
+ value: remove
+ schema: temp/properties/tlsOperation
+ type: radio
+ watcher:
+ func: onTlsOperationChange
+ paths:
+ - temp/properties/tlsOperation
+ - fullwidth: true
+ if:
+ name: isTlsEnabled
+ type: function
+ label: Remove TLS
+ schema: schema/properties/spec/properties/tls/properties/remove
+ type: switch
+ - fullwidth: true
+ if:
+ name: isTlsEnabled
+ type: function
+ label: Rotate Certificates
+ schema: schema/properties/spec/properties/tls/properties/rotateCertificates
+ type: switch
+ - elements:
+ - disable: true
+ init:
+ type: func
+ value: initIssuerRefApiGroup
+ label: API Group
+ schema: schema/properties/spec/properties/tls/properties/issuerRef/properties/apiGroup
+ type: input
+ watcher:
+ func: initIssuerRefApiGroup
+ paths:
+ - schema/properties/spec/properties/tls/properties/issuerRef/properties/kind
+ - init:
+ type: func
+ value: setValueFromDbDetails|/spec/tls/issuerRef/kind
+ label: Kind
+ options:
+ - text: Issuer
+ value: Issuer
+ - text: ClusterIssuer
+ value: ClusterIssuer
+ schema: schema/properties/spec/properties/tls/properties/issuerRef/properties/kind
+ type: select
+ validation:
+ name: isIssuerRefRequired
+ type: custom
+ - init:
+ type: func
+ value: setValueFromDbDetails|/spec/tls/issuerRef/name
+ label: Name
+ loader:
+ name: getIssuerRefsName
+ watchPaths:
+ - schema/properties/spec/properties/tls/properties/issuerRef/properties/kind
+ - schema/properties/metadata/properties/namespace
+ schema: schema/properties/spec/properties/tls/properties/issuerRef/properties/name
+ type: select
+ validation:
+ name: isIssuerRefRequired
+ type: custom
+ if:
+ name: showIssuerRefAndCertificates
+ type: function
+ label: Issuer Reference
+ showLabels: true
+ type: block-layout
+ - elements:
+ - buttonClass: is-light is-outlined
+ elements:
+ - disable: disableAlias
+ label: Alias
+ loader: fetchAliasOptions
+ schema: alias
+ type: select
+ validation:
+ type: required
+ - label: Secret Name
+ schema: secretName
+ type: input
+ - label: Duration
+ schema: duration
+ type: input
+ - label: Renew Before
+ schema: renewBefore
+ type: input
+ - buttonClass: is-light is-outlined
+ element:
+ label: Organization
+ type: input
+ label: Organizations
+ schema: subject/properties/organizations
+ type: array-item-form
+ - buttonClass: is-light is-outlined
+ element:
+ label: Country
+ type: input
+ label: Countries
+ schema: subject/properties/countries
+ type: array-item-form
+ - buttonClass: is-light is-outlined
+ element:
+ label: Organizational Unit
+ type: input
+ label: Organizational Units
+ schema: subject/properties/organizationalUnits
+ type: array-item-form
+ - buttonClass: is-light is-outlined
+ element:
+ label: Province
+ type: input
+ label: Provinces
+ schema: subject/properties/provinces
+ type: array-item-form
+ - buttonClass: is-light is-outlined
+ element:
+ label: DNS Name
+ type: input
+ label: DNS Names
+ schema: dnsNames
+ type: array-item-form
+ - buttonClass: is-light is-outlined
+ element:
+ label: IP Address
+ type: input
+ label: IP Addresses
+ schema: ipAddresses
+ type: array-item-form
+ label: Certificates
+ schema: schema/properties/spec/properties/tls/properties/certificates
+ type: array-object-form
+ if:
+ name: showIssuerRefAndCertificates
+ type: function
+ label: Certificates
+ loader: setValueFromDbDetails|/spec/tls/certificates|/spec/tls/certificates
+ showLabels: false
+ type: block-layout
+ if:
+ name: ifRequestTypeEqualsTo|ReconfigureTLS
+ type: function
+ label: TLS
+ type: block-layout
+ - elements:
+ - label: Authentication Secret
+ subtitle: Reference to an existing secret containing authentication credentials
+ type: label-element
+ - label: Secret Name
+ schema: schema/properties/spec/properties/authentication/properties/secretRef/properties/name
+ type: input
+ if:
+ name: ifRequestTypeEqualsTo|RotateAuth
+ type: function
+ label: Rotate Auth Form
+ type: block-layout
+ - elements:
+ - label: Storage Class Name
+ schema: schema/properties/spec/properties/migration/properties/storageClassName
+ type: input
+ validation:
+ type: required
+ - label: Old PV Reclaim Policy
+ schema: schema/properties/spec/properties/migration/properties/oldPVReclaimPolicy
+ type: input
+ if:
+ name: ifRequestTypeEqualsTo|StorageMigration
+ type: function
+ label: Storage Migration Form
+ type: block-layout
+ - elements:
+ - label: Timeout
+ schema: schema/properties/spec/properties/timeout
+ subtitle: Specify the maximum time allowed for the operation to complete before
+ it times out
+ type: time-picker
+ - init:
+ type: func
+ value: setApplyToIfReady
+ label: Apply
+ options:
+ - text: IfReady (OpsRequest will be applied if database is ready)
+ value: IfReady
+ - text: Always (OpsRequest will always be applied)
+ value: Always
+ schema: schema/properties/spec/properties/apply
+ type: radio
+ label: OpsRequest Options
+ showLabels: true
+ type: block-layout
+ loader: getDbDetails
+ type: single-step-form
+type: multi-step-form
diff --git a/charts/opskubedbcom-milvusopsrequest-editor/ui/functions.js b/charts/opskubedbcom-milvusopsrequest-editor/ui/functions.js
new file mode 100644
index 0000000000..83308eb603
--- /dev/null
+++ b/charts/opskubedbcom-milvusopsrequest-editor/ui/functions.js
@@ -0,0 +1,1726 @@
+const { axios, useOperator, store, useToast } = window.vueHelpers || {}
+const machines = {
+ 'db.t.micro': {
+ resources: {
+ requests: {
+ cpu: '250m',
+ memory: '512Mi',
+ },
+ limits: {
+ cpu: '500m',
+ memory: '1Gi',
+ },
+ },
+ },
+ 'db.t.small': {
+ resources: {
+ requests: {
+ cpu: '1',
+ memory: '1Gi',
+ },
+ limits: {
+ cpu: '2',
+ memory: '2Gi',
+ },
+ },
+ },
+ 'db.t.medium': {
+ resources: {
+ requests: {
+ cpu: '1',
+ memory: '2Gi',
+ },
+ limits: {
+ cpu: '2',
+ memory: '4Gi',
+ },
+ },
+ },
+ 'db.t.large': {
+ resources: {
+ requests: {
+ cpu: '1',
+ memory: '4Gi',
+ },
+ limits: {
+ cpu: '2',
+ memory: '8Gi',
+ },
+ },
+ },
+ 'db.t.xlarge': {
+ resources: {
+ requests: {
+ cpu: '2',
+ memory: '8Gi',
+ },
+ limits: {
+ cpu: '4',
+ memory: '16Gi',
+ },
+ },
+ },
+ 'db.t.2xlarge': {
+ resources: {
+ requests: {
+ cpu: '4',
+ memory: '16Gi',
+ },
+ limits: {
+ cpu: '8',
+ memory: '32Gi',
+ },
+ },
+ },
+ 'db.m.small': {
+ resources: {
+ requests: {
+ cpu: '500m',
+ memory: '912680550',
+ },
+ limits: {
+ cpu: '1',
+ memory: '1825361100',
+ },
+ },
+ },
+ 'db.m.large': {
+ resources: {
+ requests: {
+ cpu: '1',
+ memory: '4Gi',
+ },
+ limits: {
+ cpu: '2',
+ memory: '8Gi',
+ },
+ },
+ },
+ 'db.m.xlarge': {
+ resources: {
+ requests: {
+ cpu: '2',
+ memory: '8Gi',
+ },
+ limits: {
+ cpu: '4',
+ memory: '16Gi',
+ },
+ },
+ },
+ 'db.m.2xlarge': {
+ resources: {
+ requests: {
+ cpu: '4',
+ memory: '16Gi',
+ },
+ limits: {
+ cpu: '8',
+ memory: '32Gi',
+ },
+ },
+ },
+ 'db.m.4xlarge': {
+ resources: {
+ requests: {
+ cpu: '8',
+ memory: '32Gi',
+ },
+ limits: {
+ cpu: '16',
+ memory: '64Gi',
+ },
+ },
+ },
+ 'db.m.8xlarge': {
+ resources: {
+ requests: {
+ cpu: '16',
+ memory: '64Gi',
+ },
+ limits: {
+ cpu: '32',
+ memory: '128Gi',
+ },
+ },
+ },
+ 'db.m.12xlarge': {
+ resources: {
+ requests: {
+ cpu: '24',
+ memory: '96Gi',
+ },
+ limits: {
+ cpu: '48',
+ memory: '192Gi',
+ },
+ },
+ },
+ 'db.m.16xlarge': {
+ resources: {
+ requests: {
+ cpu: '32',
+ memory: '128Gi',
+ },
+ limits: {
+ cpu: '64',
+ memory: '256Gi',
+ },
+ },
+ },
+ 'db.m.24xlarge': {
+ resources: {
+ requests: {
+ cpu: '48',
+ memory: '192Gi',
+ },
+ limits: {
+ cpu: '96',
+ memory: '384Gi',
+ },
+ },
+ },
+ 'db.r.large': {
+ resources: {
+ requests: {
+ cpu: '1',
+ memory: '8Gi',
+ },
+ limits: {
+ cpu: '2',
+ memory: '16Gi',
+ },
+ },
+ },
+ 'db.r.xlarge': {
+ resources: {
+ requests: {
+ cpu: '2',
+ memory: '16Gi',
+ },
+ limits: {
+ cpu: '4',
+ memory: '32Gi',
+ },
+ },
+ },
+ 'db.r.2xlarge': {
+ resources: {
+ requests: {
+ cpu: '4',
+ memory: '32Gi',
+ },
+ limits: {
+ cpu: '8',
+ memory: '64Gi',
+ },
+ },
+ },
+ 'db.r.4xlarge': {
+ resources: {
+ requests: {
+ cpu: '8',
+ memory: '96Gi',
+ },
+ limits: {
+ cpu: '16',
+ memory: '192Gi',
+ },
+ },
+ },
+ 'db.r.8xlarge': {
+ resources: {
+ requests: {
+ cpu: '16',
+ memory: '128Gi',
+ },
+ limits: {
+ cpu: '32',
+ memory: '256Gi',
+ },
+ },
+ },
+ 'db.r.12xlarge': {
+ resources: {
+ requests: {
+ cpu: '24',
+ memory: '192Gi',
+ },
+ limits: {
+ cpu: '48',
+ memory: '384Gi',
+ },
+ },
+ },
+ 'db.r.16xlarge': {
+ resources: {
+ requests: {
+ cpu: '32',
+ memory: '256Gi',
+ },
+ limits: {
+ cpu: '64',
+ memory: '512Gi',
+ },
+ },
+ },
+ 'db.r.24xlarge': {
+ resources: {
+ requests: {
+ cpu: '24',
+ memory: '384Gi',
+ },
+ limits: {
+ cpu: '96',
+ memory: '768Gi',
+ },
+ },
+ },
+}
+
+const machineList = [
+ 'custom',
+ 'db.t.micro',
+ 'db.t.small',
+ 'db.t.medium',
+ 'db.t.large',
+ 'db.t.xlarge',
+ 'db.t.2xlarge',
+ 'db.m.small',
+ 'db.m.large',
+ 'db.m.xlarge',
+ 'db.m.2xlarge',
+ 'db.m.4xlarge',
+ 'db.m.8xlarge',
+ 'db.m.12xlarge',
+ 'db.m.16xlarge',
+ 'db.m.24xlarge',
+ 'db.r.large',
+ 'db.r.xlarge',
+ 'db.r.2xlarge',
+ 'db.r.4xlarge',
+ 'db.r.8xlarge',
+ 'db.r.12xlarge',
+ 'db.r.16xlarge',
+ 'db.r.24xlarge',
+]
+
+let machinesFromPreset = []
+const configSecretKeys = ['milvus.yaml']
+
+export const useFunc = (model) => {
+ const route = store.state?.route
+ const toast = useToast()
+
+ const { getValue, storeGet, discriminator, setDiscriminatorValue, commit } = useOperator(
+ model,
+ store.state,
+ )
+
+ showAndInitOpsRequestType()
+ async function fetchJsons({ axios, itemCtx }) {
+ let ui = {}
+ let language = {}
+ let functions = {}
+ const { name, sourceRef, version, packageviewUrlPrefix } = itemCtx.chart
+
+ try {
+ ui = await axios.get(
+ `${packageviewUrlPrefix}/create-ui.yaml?name=${name}&sourceApiGroup=${sourceRef.apiGroup}&sourceKind=${sourceRef.kind}&sourceNamespace=${sourceRef.namespace}&sourceName=${sourceRef.name}&version=${version}&format=json`,
+ )
+ language = await axios.get(
+ `${packageviewUrlPrefix}/language.yaml?name=${name}&sourceApiGroup=${sourceRef.apiGroup}&sourceKind=${sourceRef.kind}&sourceNamespace=${sourceRef.namespace}&sourceName=${sourceRef.name}&version=${version}&format=json`,
+ )
+ const functionString = await axios.get(
+ `${packageviewUrlPrefix}/functions.js?name=${name}&sourceApiGroup=${sourceRef.apiGroup}&sourceKind=${sourceRef.kind}&sourceNamespace=${sourceRef.namespace}&sourceName=${sourceRef.name}&version=${version}`,
+ )
+ const evalFunc = new Function(functionString.data || '')
+ functions = evalFunc()
+ } catch (e) {
+ console.log(e)
+ }
+
+ return {
+ ui: ui.data || {},
+ language: language.data || {},
+ functions,
+ }
+ }
+
+ function returnFalse() {
+ return false
+ }
+
+ function isTlsEnabled() {
+ const dbDetails = getValue(discriminator, '/dbDetails')
+ return !!dbDetails?.spec?.tls
+ }
+
+ function isRancherManaged() {
+ const managers = storeGet('/cluster/clusterDefinition/result/clusterManagers')
+ const found = managers.find((item) => item === 'Rancher')
+ return !!found
+ }
+
+ async function getNamespaces() {
+ if (storeGet('/route/params/actions')) return []
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+
+ const resp = await axios.get(`/clusters/${owner}/${cluster}/proxy/core/v1/namespaces`, {
+ params: { filter: { items: { metadata: { name: null } } } },
+ })
+
+ const resources = (resp && resp.data && resp.data.items) || []
+
+ return resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return {
+ text: name,
+ value: name,
+ }
+ })
+ }
+
+ async function getDbs() {
+ if (storeGet('/route/params/actions')) return []
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+
+ const namespace = getValue(model, '/metadata/namespace')
+
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/kubedb.com/v1alpha2/namespaces/${namespace}/milvuses`,
+ {
+ params: { filter: { items: { metadata: { name: null } } } },
+ },
+ )
+
+ const resources = (resp && resp.data && resp.data.items) || []
+
+ return resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ return {
+ text: name,
+ value: name,
+ }
+ })
+ }
+
+ async function getDbDetails() {
+ machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []
+
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const namespace = storeGet('/route/query/namespace') || getValue(model, '/metadata/namespace')
+ const name = storeGet('/route/params/name') || getValue(model, '/spec/databaseRef/name')
+
+ if (namespace && name) {
+ const url = `/clusters/${owner}/${cluster}/proxy/kubedb.com/v1alpha2/namespaces/${namespace}/milvuses/${name}`
+ const resp = await axios.get(url)
+
+ setDiscriminatorValue('/dbDetails', resp.data || {})
+
+ return resp.data || {}
+ } else return {}
+ }
+
+ let presetVersions = []
+ setDiscriminatorValue('/filteredVersion', [])
+
+ async function getDbVersions() {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const url = `/clusters/${owner}/${cluster}/proxy/charts.x-helm.dev/v1alpha1/clusterchartpresets/kubedb-ui-presets`
+ let presets = storeGet('/kubedbuiPresets') || {}
+ if (!storeGet('/route/params/actions')) {
+ try {
+ const presetResp = await axios.get(url)
+ presets = presetResp.data?.spec?.values?.spec
+ } catch (e) {
+ console.log(e)
+ presets.status = String(e.status)
+ }
+ }
+ try {
+ presetVersions = presets.admin?.databases?.Milvus?.versions?.available || []
+ const queryParams = {
+ filter: {
+ items: {
+ metadata: { name: null },
+ spec: { version: null, deprecated: null, updateConstraints: null },
+ },
+ },
+ }
+ const resp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/catalog.kubedb.com/v1alpha1/milvusversions`,
+ {
+ params: queryParams,
+ },
+ )
+ const resources = (resp && resp.data && resp.data.items) || []
+ const sortedVersions = resources.sort((a, b) =>
+ versionCompare(a.spec.version, b.spec.version),
+ )
+ let ver = getValue(discriminator, '/dbDetails/spec/version') || '0'
+ const found = sortedVersions.find((item) => item.metadata.name === ver)
+ if (found) ver = found.spec?.version
+ const allowed = found?.spec?.updateConstraints?.allowlist || []
+ const limit = allowed.length ? allowed[0] : '0.0'
+ // keep only non deprecated & kubedb-ui-presets & within constraints of current version
+ // if presets.status is 404, it means no presets available, no need to filter with presets
+ const filteredMilvusVersions = sortedVersions.filter((item) => {
+ // default limit 0.0 means no restrictions, show all higher versions
+ if (limit === '0.0')
+ return (
+ !item.spec?.deprecated &&
+ (presets.status === '404' ||
+ presetVersions.length === 0 ||
+ presetVersions.includes(item.metadata?.name)) &&
+ versionCompare(item.spec?.version, ver) >= 0
+ )
+ // if limit doesn't have any operator, it's a single version
+ else if (!limit.match(/^(>=|<=|>|<)/))
+ return (
+ !item.spec?.deprecated &&
+ (presets.status === '404' ||
+ presetVersions.length === 0 ||
+ presetVersions.includes(item.metadata?.name)) &&
+ item.spec?.version === limit
+ )
+ // if limit has operator, check version with constraints
+ else
+ return (
+ !item.spec?.deprecated &&
+ (presets.status === '404' ||
+ presetVersions.length === 0 ||
+ presetVersions.includes(item.metadata?.name)) &&
+ isVersionWithinConstraints(item.spec?.version, limit)
+ )
+ })
+ setDiscriminatorValue('/filteredVersion', filteredMilvusVersions)
+ return filteredMilvusVersions.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ const specVersion = (item.spec && item.spec.version) || ''
+ return {
+ text: `${name} (${specVersion})`,
+ value: name,
+ }
+ })
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+
+ function versionCompare(v1, v2) {
+ const arr1 = v1.split('.').map(Number)
+ const arr2 = v2.split('.').map(Number)
+
+ for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) {
+ const num1 = arr1[i] || 0
+ const num2 = arr2[i] || 0
+
+ if (num1 > num2) return 1
+ if (num1 < num2) return -1
+ }
+ return 0
+ }
+
+ function isVersionWithinConstraints(version, constraints) {
+ let constraintsArr = []
+ if (constraints.includes(',')) constraintsArr = constraints?.split(',')?.map((c) => c.trim())
+ else constraintsArr = [constraints]
+
+ for (let constraint of constraintsArr) {
+ let match = constraint.match(/^(>=|<=|>|<)/)
+ let operator = match ? match[0] : ''
+ let constraintVersion = constraint.replace(/^(>=|<=|>|<)/, '').trim()
+
+ let comparison = versionCompare(version, constraintVersion)
+ if (
+ (operator === '>=' && comparison < 0) ||
+ (operator === '<=' && comparison > 0) ||
+ (operator === '>' && comparison <= 0) ||
+ (operator === '<' && comparison >= 0)
+ )
+ return false
+ }
+ return true
+ }
+
+ function getVersionInfo() {
+ const filteredVersion = getValue(discriminator, '/filteredVersion')
+ if (filteredVersion.length) return ''
+
+ let txt = 'No versions from this list can be selected as the target version: [ '
+
+ presetVersions.forEach((v, idx) => {
+ txt = `${txt}"${v}"`
+ if (idx !== presetVersions.length - 1) txt = txt + ', '
+ else txt = txt + ' ]'
+ })
+
+ return txt
+ }
+
+ function isVersionEmpty() {
+ const val = getValue(discriminator, '/filteredVersion')
+ return val.length === 0
+ }
+
+ function ifRequestTypeEqualsTo(type) {
+ const selectedType = getValue(model, '/spec/type')
+ return selectedType === type
+ }
+
+ function onRequestTypeChange() {
+ const selectedType = getValue(model, '/spec/type')
+ const reqTypeMapping = {
+ UpdateVersion: 'updateVersion',
+ HorizontalScaling: 'horizontalScaling',
+ VerticalScaling: 'verticalScaling',
+ VolumeExpansion: 'volumeExpansion',
+ Restart: 'restart',
+ Reconfigure: 'configuration',
+ ReconfigureTLS: 'tls',
+ RotateAuth: 'authentication',
+ StorageMigration: 'migration',
+ }
+
+ Object.keys(reqTypeMapping).forEach((key) => {
+ if (key !== selectedType) commit('wizard/model$delete', `/spec/${reqTypeMapping[key]}`)
+ })
+ }
+
+ function disableOpsRequest() {
+ return false
+ }
+
+ function getDbTls() {
+ const dbDetails = getValue(discriminator, '/dbDetails')
+
+ const { spec } = dbDetails || {}
+ return spec?.tls || undefined
+ }
+
+ function getDbType() {
+ const dbDetails = getValue(discriminator, '/dbDetails')
+ const distributed = dbDetails?.spec?.topology?.distributed
+ return distributed ? 'distributed' : 'standalone'
+ }
+
+ function initNamespace() {
+ const { namespace } = route.query || {}
+ return namespace || null
+ }
+
+ function initDatabaseRef() {
+ const { name } = route.params || {}
+ return name
+ }
+
+ function asDatabaseOperation() {
+ return !!route.params.actions
+ }
+
+ function generateOpsRequestNameForClusterUI(getValue, model, route) {
+ const dbName = getValue(model, '/spec/databaseRef/name')
+
+ const selectedType = getValue(model, '/spec/type')
+ const lowerType = selectedType ? String(selectedType).toLowerCase() : ''
+
+ const resources = route.params.resource || ''
+ const resource = resources.slice(0, -1)
+
+ const opsName = dbName ? dbName : resource
+ return `${opsName}-${Math.floor(Date.now() / 1000)}${lowerType ? '-' + lowerType : ''}`
+ }
+
+ function showAndInitName() {
+ const ver = asDatabaseOperation()
+
+ const selectedType = getValue(model, '/spec/type')
+ const lowerType = selectedType ? String(selectedType).toLowerCase() : ''
+
+ if (ver) {
+ commit('wizard/model$update', {
+ path: '/metadata/name',
+ value: `${route.params.name}-${Math.floor(Date.now() / 1000)}-${lowerType}`,
+ force: true,
+ })
+ } else {
+ commit('wizard/model$update', {
+ path: '/metadata/name',
+ value: generateOpsRequestNameForClusterUI(getValue, model, route),
+ force: true,
+ })
+ }
+ return !ver
+ }
+
+ function showAndInitNamespace() {
+ const ver = asDatabaseOperation()
+ if (ver) {
+ commit('wizard/model$update', {
+ path: '/metadata/namespace',
+ value: `${route.query.namespace}`,
+ force: true,
+ })
+ }
+
+ return !ver
+ }
+
+ function showAndInitDatabaseRef() {
+ const ver = asDatabaseOperation()
+ if (ver) {
+ commit('wizard/model$update', {
+ path: '/spec/databaseRef/name',
+ value: `${route.params.name}`,
+ force: true,
+ })
+ }
+
+ return !ver
+ }
+
+ function showConfigureOpsrequestLabel() {
+ return !asDatabaseOperation()
+ }
+
+ function showAndInitOpsRequestType() {
+ const ver = asDatabaseOperation()
+ const opMap = {
+ upgrade: 'UpdateVersion',
+ updateVersion: 'UpdateVersion',
+ updateversion: 'UpdateVersion',
+ horizontalscaling: 'HorizontalScaling',
+ verticalscaling: 'VerticalScaling',
+ volumeexpansion: 'VolumeExpansion',
+ restart: 'Restart',
+ reconfiguretls: 'ReconfigureTLS',
+ reconfigure: 'Reconfigure',
+ rotateauth: 'RotateAuth',
+ storagemigration: 'StorageMigration',
+ }
+ if (ver) {
+ const operation = storeGet('/resource/activeActionItem/result/operationId') || ''
+
+ const match = /^(.*)-opsrequest-(.*)$/.exec(operation)
+ if (match) {
+ const opstype = match[2]
+ commit('wizard/model$update', {
+ path: '/spec/type',
+ value: opMap[opstype],
+ force: true,
+ })
+ }
+ }
+
+ return !ver
+ }
+
+ function ifDbTypeEqualsTo(value) {
+ const verd = getDbType()
+ return value === verd
+ }
+
+ function getMachines(type) {
+ const presets = storeGet('/kubedbuiPresets') || {}
+ const dbDetails = getValue(discriminator, '/dbDetails')
+ let limits = {}
+ if (type === 'node' || !type) {
+ limits =
+ dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || { cpu: '', memory: '' }
+ } else {
+ limits =
+ dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0]?.resources?.requests ||
+ { cpu: '', memory: '' }
+ }
+
+ const avlMachines = presets.admin?.machineProfiles?.available || []
+ let arr = []
+ if (avlMachines.length) {
+ arr = avlMachines.map((machine) => {
+ if (machine === 'custom')
+ return { text: machine, value: { machine, cpu: limits.cpu, memory: limits.memory } }
+ else {
+ const machineData = machinesFromPreset.find((val) => val.id === machine)
+ if (machineData) {
+ const subtext = `CPU: ${machineData.limits.cpu}, Memory: ${machineData.limits.memory}`
+ const text = machineData.name ? machineData.name : machineData.id
+ return {
+ text,
+ subtext,
+ value: {
+ machine: text,
+ cpu: machineData.limits.cpu,
+ memory: machineData.limits.memory,
+ },
+ }
+ } else
+ return { text: machine, value: { machine, cpu: limits.cpu, memory: limits.memory } }
+ }
+ })
+ } else {
+ arr = machineList
+ .map((machine) => {
+ if (machine === 'custom')
+ return { text: machine, value: { machine, cpu: limits.cpu, memory: limits.memory } }
+ const subtext = `CPU: ${machines[machine].resources.limits.cpu}, Memory: ${machines[machine].resources.limits.memory}`
+ const text = machine
+ return {
+ text,
+ subtext,
+ value: {
+ machine: text,
+ cpu: machines[machine].resources.limits.cpu,
+ memory: machines[machine].resources.limits.memory,
+ },
+ }
+ })
+ .filter((val) => !!val)
+ }
+ return arr
+ }
+
+ function setMachine(type) {
+ const dbDetails = getValue(discriminator, '/dbDetails')
+ let limits = {}
+ if (type === 'node' || !type) {
+ limits =
+ dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || { cpu: '', memory: '' }
+ } else {
+ limits =
+ dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0]?.resources?.requests ||
+ { cpu: '', memory: '' }
+ }
+
+ const annotations = dbDetails?.metadata?.annotations || {}
+ const instance = annotations['kubernetes.io/instance-type']
+ let parsedInstance = {}
+ try {
+ if (instance) parsedInstance = JSON.parse(instance)
+ } catch (e) {
+ console.log(e)
+ parsedInstance = {}
+ }
+
+ const machine = parsedInstance[type] || 'custom'
+
+ const machinePresets = machinesFromPreset.find((item) => item.id === machine)
+ if (machinePresets) {
+ return {
+ machine: machine,
+ cpu: machinePresets.limits.cpu,
+ memory: machinePresets.limits.memory,
+ }
+ } else return { machine: 'custom', cpu: limits.cpu, memory: limits.memory }
+ }
+
+ function onMachineChange(type, valPath) {
+ const selectedMachine = getValue(discriminator, `/machine-${type}`)
+ const machine = machinesFromPreset.find((item) => item.id === selectedMachine.machine)
+
+ let obj = {}
+ if (selectedMachine.machine !== 'custom') {
+ if (machine) obj = { limits: { ...machine?.limits }, requests: { ...machine?.limits } }
+ else obj = machines[selectedMachine.machine]?.resources
+ } else {
+ const cpu = selectedMachine.cpu || ''
+ const memory = selectedMachine.memory || ''
+ obj = {
+ limits: { cpu: cpu, memory: memory },
+ requests: { cpu: cpu, memory: memory },
+ }
+ }
+
+ const path = `/spec/verticalScaling/${type}/resources`
+
+ if (obj && Object.keys(obj).length)
+ commit('wizard/model$update', {
+ path: path,
+ value: obj,
+ force: true,
+ })
+
+ const annotations = getValue(model, '/metadata/annotations') || {}
+ const instance = annotations['kubernetes.io/instance-type']
+ let parsedInstance = {}
+ try {
+ if (instance) parsedInstance = JSON.parse(instance)
+ } catch (e) {
+ parsedInstance = {}
+ }
+ parsedInstance[type] = selectedMachine.machine
+ annotations['kubernetes.io/instance-type'] = JSON.stringify(parsedInstance)
+
+ if (machinesFromPreset.length)
+ commit('wizard/model$update', {
+ path: '/metadata/annotations',
+ value: annotations,
+ force: true,
+ })
+ }
+
+ function isMachineCustom() {
+ const machine = getValue(discriminator, '/machine-node')
+ return machine === 'custom'
+ }
+
+ // Fetch and store database Infos
+ let configSecrets = []
+ let secretConfigData = []
+ let existingSecrets = []
+
+ async function fetchConfigSecrets() {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const namespace = getValue(model, '/metadata/namespace')
+
+ const name = getValue(model, '/spec/databaseRef/name')
+ const dbGroup = getValue(model, '/route/params/group')
+ const dbKind = getValue(store.state, '/resource/definition/result/kind')
+ const dbResource = getValue(model, '/route/params/resource')
+ const dbVersion = getValue(model, '/route/params/version')
+
+ try {
+ const resp = await axios.post(
+ `/clusters/${owner}/${cluster}/proxy/ui.kubedb.com/v1alpha1/databaseinfos`,
+ {
+ apiVersion: 'ui.kubedb.com/v1alpha1',
+ kind: 'DatabaseInfo',
+ request: {
+ source: {
+ ref: {
+ name: name,
+ namespace: namespace,
+ },
+ resource: {
+ group: dbGroup,
+ kind: dbKind,
+ name: dbResource,
+ version: dbVersion,
+ },
+ },
+ keys: ['milvus.yaml'],
+ },
+ },
+ )
+ configSecrets = resp?.data?.response?.availableSecrets || []
+ secretConfigData = resp?.data?.response?.configurations || []
+ } catch (e) {
+ console.log(e)
+ }
+
+ try {
+ const resp = await axios.get(`/clusters/${owner}/${cluster}/proxy/core/v1/secrets`)
+ resp.data?.items.forEach((item) => {
+ if (item.metadata?.name) {
+ existingSecrets.push(item.metadata.name)
+ }
+ })
+ } catch (e) {
+ console.log(e)
+ }
+ }
+
+ async function getConfigSecrets(type) {
+ type = type ? type + '/' : ''
+ const secretStatus = getValue(discriminator, `${type}createSecret/status`)
+ if (secretStatus === 'success') {
+ await fetchConfigSecrets()
+ }
+ const mappedSecrets = configSecrets.map((item) => {
+ return { text: item, value: item }
+ })
+ mappedSecrets.push({ text: '+ Create a new Secret', value: 'Create' })
+ return mappedSecrets
+ }
+
+ async function getConfigSecretsforAppyConfig() {
+ const secrets = secretConfigData.map((item) => {
+ return { text: item.componentName, value: item.componentName }
+ })
+ return secrets
+ }
+
+ function getSelectedConfigurationData(type) {
+ type = type ? type + '/' : ''
+ const path = `/${type}selectedConfiguration`
+ const selectedConfiguration = getValue(discriminator, path)
+
+ if (!selectedConfiguration) {
+ return []
+ }
+
+ const configuration = secretConfigData.find(
+ (item) => item.componentName === selectedConfiguration,
+ )
+
+ if (!configuration) {
+ return []
+ }
+
+ const result = []
+ Object.keys(configuration.data).forEach((fileName) => {
+ try {
+ const decodedContent = atob(configuration.data[fileName])
+ result.push({
+ name: fileName,
+ content: decodedContent,
+ })
+ } catch (e) {
+ console.error(`Error decoding ${fileName}:`, e)
+ result.push({
+ name: fileName,
+ content: configuration.data[fileName],
+ })
+ }
+ })
+
+ commit('wizard/model$update', {
+ path: `/temp/${type}applyConfig`,
+ value: result,
+ force: true,
+ })
+
+ return result
+ }
+
+ async function createNewConfigSecret(type) {
+ type = type ? type + '/' : ''
+ const { user, cluster } = route.params
+ const url = `/clusters/${user}/${cluster}/resources`
+ const namespace = storeGet('/route/query/namespace') || getValue(model, '/metadata/namespace')
+ const secretName = getValue(discriminator, `${type}createSecret/name`)
+ const secretData = getValue(discriminator, `${type}createSecret/data`)
+ const secretDataObj = Object.fromEntries(secretData.map((item) => [item.key, item.value]))
+
+ if (existingSecrets.includes(secretName)) {
+ toast.error('A secret with this name already exists. Please choose another name.', {
+ timeout: 8000,
+ })
+ return false
+ }
+
+ try {
+ await axios.post(url, {
+ apiVersion: 'v1',
+ stringData: secretDataObj,
+ kind: 'Secret',
+ metadata: {
+ name: secretName,
+ namespace: namespace,
+ },
+ type: 'Opaque',
+ })
+ commit('wizard/temp$update', {
+ path: `${type}createSecret/status`,
+ value: 'success',
+ })
+ commit('wizard/temp$update', {
+ path: `${type}createSecret/lastCreatedSecret`,
+ value: secretName,
+ })
+ toast.success('Secret created successfully')
+ } catch (error) {
+ const errMsg = decodeError(error, 'Failed to create secret')
+ toast.error(errMsg, { timeout: 5000 })
+ cancelCreateSecret()
+ }
+ return true
+ }
+
+ function decodeError(msg, defaultMsg) {
+ if (typeof msg === 'string') {
+ return msg || defaultMsg
+ }
+ return (
+ (msg.response && msg.response.data && msg.response.data.message) ||
+ (msg.response && msg.response.data) ||
+ (msg.status && msg.status.status) ||
+ defaultMsg
+ )
+ }
+
+ function isCreateSecret(type) {
+ type = type ? type + '/' : ''
+ const selectedSecret = getValue(model, `spec/configuration/${type}configSecret/name`)
+ const res = selectedSecret === 'Create'
+
+ if (res === true) {
+ commit('wizard/temp$update', {
+ path: `${type}createSecret/status`,
+ value: 'pending',
+ })
+ }
+ return res
+ }
+
+ function isNotCreateSecret(type) {
+ return !isCreateSecret(type)
+ }
+
+ function onCreateSecretChange(type) {
+ type = type ? type + '/' : ''
+ const secretStatus = getValue(discriminator, `${type}createSecret/status`)
+ if (secretStatus === 'cancelled') return ''
+ else if (secretStatus === 'success') {
+ const name = getValue(discriminator, `${type}createSecret/lastCreatedSecret`)
+
+ const configFound = configSecrets.find((item) => item === name)
+ return configFound ? { text: name, value: name } : ''
+ }
+ }
+
+ function cancelCreateSecret(type) {
+ type = type ? type + '/' : ''
+ commit('wizard/temp$delete', `${type}createSecret/name`)
+ commit('wizard/temp$delete', `${type}createSecret/data`)
+ commit('wizard/temp$update', {
+ path: `${type}createSecret/status`,
+ value: 'cancelled',
+ })
+ }
+
+ async function onApplyconfigChange(type) {
+ type = type ? type + '/' : ''
+ const configValue = getValue(discriminator, `${type}applyConfig`)
+
+ if (!configValue) {
+ commit('wizard/model$delete', `/spec/configuration/${type}applyConfig`)
+ return
+ }
+ const tempConfigObj = {}
+ configValue.forEach((item) => {
+ if (item.name && item.content) {
+ tempConfigObj[item.name] = item.content
+ }
+ })
+ if (Object.keys(tempConfigObj).length === 0) {
+ commit('wizard/model$delete', `/spec/configuration/${type}applyConfig`)
+ return
+ }
+ commit('wizard/model$update', {
+ path: `/spec/configuration/${type}applyConfig`,
+ value: tempConfigObj,
+ })
+ }
+
+ function setApplyConfig(type) {
+ type = type ? type + '/' : ''
+ const configPath = `/${type}selectedConfiguration`
+ const selectedConfig = getValue(discriminator, configPath)
+ if (!selectedConfig) {
+ return [{ name: '', content: '' }]
+ }
+ const applyconfigData = secretConfigData.find((item) => {
+ if (item.componentName === selectedConfig) {
+ return item
+ }
+ })
+ const { applyConfig } = applyconfigData
+ const configObj = []
+
+ if (applyConfig) {
+ Object.keys(applyConfig).forEach((fileName) => {
+ configObj.push({
+ name: fileName,
+ content: applyConfig[fileName],
+ })
+ })
+ }
+ configSecretKeys.forEach((key) => {
+ if (!configObj.find((item) => item.name === key)) {
+ configObj.push({ name: key, content: '' })
+ }
+ })
+ return configObj
+ }
+
+ function onRemoveConfigChange(type) {
+ type = type ? type + '/' : ''
+ const configPath = `/${type}selectedConfigurationRemove`
+ const selectedConfig = getValue(discriminator, configPath)
+
+ if (!selectedConfig) {
+ commit('wizard/model$delete', `/spec/configuration/${type}removeCustomConfig`)
+ return [{ name: '', content: '' }]
+ }
+ commit('wizard/model$update', {
+ path: `/spec/configuration/${type}removeCustomConfig`,
+ value: true,
+ force: true,
+ })
+
+ const configuration = secretConfigData.find((item) => item.componentName === selectedConfig)
+
+ if (!configuration.data) {
+ return [{ name: '', content: '' }]
+ }
+
+ const configObj = []
+ Object.keys(configuration.data).forEach((fileName) => {
+ try {
+ const decodedString = atob(configuration.data[fileName])
+ configObj.push({
+ name: fileName,
+ content: decodedString,
+ })
+ } catch (e) {
+ console.error(`Error decoding ${fileName}:`, e)
+ configObj.push({
+ name: fileName,
+ content: configuration.data[fileName],
+ })
+ }
+ })
+ return configObj
+ }
+
+ async function onNewConfigSecretChange(type) {
+ type = type ? type + '/' : ''
+ const path = `/spec/configuration/${type}configSecret/name`
+ const selectedSecret = getValue(model, path)
+
+ if (!selectedSecret) {
+ commit('wizard/model$delete', `/spec/configuration/${type}configSecret`)
+ return [{ name: '', content: '' }]
+ }
+ if (selectedSecret === 'Create') return [{ name: '', content: '' }]
+
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const namespace = storeGet('/route/query/namespace') || getValue(model, '/metadata/namespace')
+
+ try {
+ const secretResp = await axios.get(
+ `/clusters/${owner}/${cluster}/proxy/core/v1/namespaces/${namespace}/secrets/${selectedSecret}`,
+ )
+
+ const secretData = secretResp.data?.data || {}
+ const configObj = []
+
+ Object.keys(secretData).forEach((fileName) => {
+ try {
+ const decodedString = atob(secretData[fileName])
+ configObj.push({
+ name: fileName,
+ content: decodedString,
+ })
+ } catch (e) {
+ console.error(`Error decoding ${fileName}:`, e)
+ configObj.push({
+ name: fileName,
+ content: secretData[fileName],
+ })
+ }
+ })
+
+ return configObj
+ } catch (e) {
+ console.error('Error fetching secret:', e)
+ return [{ name: '', content: '' }]
+ }
+ }
+
+ function onSelectedSecretChange(index) {
+ const secretData = getValue(discriminator, 'createSecret/data') || []
+ const selfSecrets = secretData.map((item) => item.key)
+
+ const remainingSecrets = configSecretKeys.filter((item) => !selfSecrets.includes(item))
+
+ const selfKey = getValue(discriminator, `createSecret/data/${index}/key`)
+ if (selfKey) {
+ remainingSecrets.push(selfKey)
+ }
+ const resSecret = remainingSecrets.map((item) => {
+ return { text: item, value: item }
+ })
+ return resSecret
+ }
+
+ async function getNamespacedResourceList({ namespace, group, version, resource }) {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+
+ const url = `/clusters/${owner}/${cluster}/proxy/${group}/${version}/namespaces/${namespace}/${resource}`
+
+ let ans = []
+ try {
+ const resp = await axios.get(url, {
+ params: {
+ filter: { items: { metadata: { name: null }, type: null } },
+ },
+ })
+
+ const items = (resp && resp.data && resp.data.items) || []
+ ans = items
+ } catch (e) {
+ console.log(e)
+ }
+
+ return ans
+ }
+ async function getResourceList({ group, version, resource }) {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+
+ const url = `/clusters/${owner}/${cluster}/proxy/${group}/${version}/${resource}`
+
+ let ans = []
+ try {
+ const resp = await axios.get(url, {
+ params: {
+ filter: { items: { metadata: { name: null }, type: null } },
+ },
+ })
+
+ const items = (resp && resp.data && resp.data.items) || []
+ ans = items
+ } catch (e) {
+ console.log(e)
+ }
+
+ return ans
+ }
+ async function resourceNames(group, version, resource) {
+ const namespace = getValue(model, '/metadata/namespace')
+
+ let resources = await getNamespacedResourceList({
+ namespace,
+ group,
+ version,
+ resource,
+ })
+
+ if (resource === 'secrets') {
+ resources = resources.filter((item) => {
+ const validType = ['kubernetes.io/service-account-token', 'Opaque']
+ return validType.includes(item.type)
+ })
+ }
+
+ return resources.map((resource) => {
+ const name = (resource.metadata && resource.metadata.name) || ''
+ return {
+ text: name,
+ value: name,
+ }
+ })
+ }
+ async function unNamespacedResourceNames(group, version, resource) {
+ let resources = await getResourceList({
+ group,
+ version,
+ resource,
+ })
+
+ if (resource === 'secrets') {
+ resources = resources.filter((item) => {
+ const validType = ['kubernetes.io/service-account-token', 'Opaque']
+ return validType.includes(item.type)
+ })
+ }
+
+ return resources.map((resource) => {
+ const name = (resource.metadata && resource.metadata.name) || ''
+ return {
+ text: name,
+ value: name,
+ }
+ })
+ }
+
+ // reconfiguration type
+ function ifReconfigurationTypeEqualsTo(value) {
+ const reconfigurationType = getValue(discriminator, '/reconfigurationType')
+ return reconfigurationType === value
+ }
+
+ function onReconfigurationTypeChange() {
+ const reconfigurationType = getValue(discriminator, '/reconfigurationType')
+ setDiscriminatorValue('/applyConfig', [])
+ if (reconfigurationType === 'remove') {
+ commit('wizard/model$delete', `/spec/configuration`)
+
+ commit('wizard/model$update', {
+ path: `/spec/configuration/removeCustomConfig`,
+ value: true,
+ force: true,
+ })
+ } else {
+ commit('wizard/model$delete', `/spec/configuration/configSecret`)
+ commit('wizard/model$delete', `/spec/configuration/applyConfig`)
+ commit('wizard/model$delete', `/spec/configuration/removeCustomConfig`)
+ }
+ }
+
+ // for tls
+ function hasTlsField() {
+ const tls = getDbTls()
+ return !!tls
+ }
+
+ function initIssuerRefApiGroup() {
+ const kind = getValue(model, '/spec/tls/issuerRef/kind')
+
+ if (kind) {
+ const apiGroup = getValue(discriminator, '/dbDetails/spec/tls/issuerRef/apiGroup')
+ if (apiGroup) return apiGroup
+ return 'cert-manager.io'
+ } else return undefined
+ }
+
+ async function getIssuerRefsName() {
+ const owner = storeGet('/route/params/user')
+ const cluster = storeGet('/route/params/cluster')
+ const kind = getValue(model, '/spec/tls/issuerRef/kind')
+ const namespace = getValue(model, '/metadata/namespace')
+
+ if (kind === 'Issuer') {
+ const url = `/clusters/${owner}/${cluster}/proxy/cert-manager.io/v1/namespaces/${namespace}/issuers`
+ return getIssuer(url)
+ } else if (kind === 'ClusterIssuer') {
+ const url = `/clusters/${owner}/${cluster}/proxy/charts.x-helm.dev/v1alpha1/clusterchartpresets/kubedb-ui-presets`
+
+ let presets = storeGet('/kubedbuiPresets') || {}
+ if (!storeGet('/route/params/actions')) {
+ try {
+ const presetResp = await axios.get(url)
+ presets = presetResp.data?.spec?.values?.spec
+ } catch (e) {
+ console.log(e)
+ presets.status = String(e.status)
+ }
+ }
+ let clusterIssuers = presets.admin?.clusterIssuers?.available || []
+ if (presets.status === '404') {
+ const url = `/clusters/${owner}/${cluster}/proxy/cert-manager.io/v1/clusterissuers`
+ return getIssuer(url)
+ }
+ return clusterIssuers
+ } else if (!kind) {
+ commit('wizard/model$delete', '/spec/tls/issuerRef/name')
+ return []
+ }
+
+ async function getIssuer(url) {
+ try {
+ const resp = await axios.get(url)
+ const resources = (resp && resp.data && resp.data.items) || []
+
+ resources.map((item) => {
+ const name = (item.metadata && item.metadata.name) || ''
+ item.text = name
+ item.value = name
+ return true
+ })
+ return resources
+ } catch (e) {
+ console.log(e)
+ return []
+ }
+ }
+ }
+
+ function initTlsOperation() {
+ return 'update'
+ }
+ function onTlsOperationChange() {
+ const tlsOperation = getValue(discriminator, '/tlsOperation')
+
+ commit('wizard/model$delete', '/spec/tls')
+
+ if (tlsOperation === 'rotate') {
+ commit('wizard/model$update', {
+ path: '/spec/tls/rotateCertificates',
+ value: true,
+ force: true,
+ })
+ commit('wizard/model$delete', '/spec/tls/certificates')
+ commit('wizard/model$delete', '/spec/tls/remove')
+ } else if (tlsOperation === 'remove') {
+ commit('wizard/model$update', {
+ path: '/spec/tls/remove',
+ value: true,
+ force: true,
+ })
+ commit('wizard/model$delete', '/spec/tls/certificates')
+ commit('wizard/model$delete', '/spec/tls/rotateCertificates')
+ }
+ }
+
+ function showIssuerRefAndCertificates() {
+ const tlsOperation = getValue(discriminator, '/tlsOperation')
+ const verd = tlsOperation !== 'remove' && tlsOperation !== 'rotate'
+ return verd
+ }
+
+ function isIssuerRefRequired() {
+ const hasTls = hasTlsField()
+ return hasTls ? false : ''
+ }
+
+ function getRequestTypeFromRoute() {
+ const isDbloading = isDbDetailsLoading()
+ const { query } = route || {}
+ const { requestType } = query || {}
+ return isDbloading ? '' : requestType || ''
+ }
+
+ function isDbDetailsLoading() {
+ const dbDetails = getValue(discriminator, '/dbDetails')
+ const dbName = getValue(model, '/spec/databaseRef/name')
+
+ return !dbDetails || !dbName
+ }
+
+ function setValueFromDbDetails(path, commitPath) {
+ const retValue = getValue(discriminator, `/dbDetails${path}`)
+
+ if (commitPath && retValue) {
+ const tlsOperation = getValue(discriminator, '/tlsOperation')
+
+ if (commitPath.includes('/spec/tls') && tlsOperation !== 'update') return undefined
+
+ commit('wizard/model$update', {
+ path: commitPath,
+ value: retValue,
+ force: true,
+ })
+ }
+
+ return retValue || undefined
+ }
+
+ function getAliasOptions() {
+ return ['server', 'client', 'metrics-exporter']
+ }
+
+ function isNamespaceDisabled() {
+ const { namespace } = route.query || {}
+ return !!namespace
+ }
+
+ function isDatabaseRefDisabled() {
+ const { name } = route.params || {}
+ return !!name
+ }
+
+ function onNamespaceChange() {
+ commit('wizard/model$delete', '/spec/type')
+ }
+
+ function onDbChange() {
+ commit('wizard/model$delete', '/spec/type')
+ getDbDetails()
+ }
+
+ function setApplyToIfReady() {
+ return 'IfReady'
+ }
+
+ function isVerticalScaleTopologyRequired() {
+ const key = getValue(discriminator, '/topologyKey')
+ const value = getValue(discriminator, '/topologyValue')
+ const path = `/spec/verticalScaling/node/topology`
+
+ if (key || value) {
+ commit('wizard/model$update', {
+ path: path,
+ value: { key, value },
+ force: true,
+ })
+ return ''
+ } else {
+ commit('wizard/model$delete', path)
+ return false
+ }
+ }
+
+ function checkVolume(initpath, path) {
+ const volume = getValue(discriminator, `/dbDetails${initpath}`)
+ const input = getValue(model, path)
+
+ if (!volume) return
+
+ try {
+ const sizeInBytes = parseSize(volume)
+ const inputSizeInBytes = parseSize(input)
+
+ if (inputSizeInBytes >= sizeInBytes) return
+ else return 'Cannot expand to lower volume!'
+ } catch (err) {
+ return err.message || 'Invalid'
+ }
+ }
+
+ function parseSize(sizeStr) {
+ const units = {
+ '': 1,
+ K: 1e3,
+ M: 1e6,
+ G: 1e9,
+ T: 1e12,
+ P: 1e15,
+ E: 1e18,
+ Ki: 1024,
+ Mi: 1024 ** 2,
+ Gi: 1024 ** 3,
+ Ti: 1024 ** 4,
+ Pi: 1024 ** 5,
+ Ei: 1024 ** 6,
+ }
+
+ const match = String(sizeStr).match(/^([0-9]+(?:\.[0-9]*)?)\s*([A-Za-z]*)$/)
+ if (!match) throw new Error('Invalid size format')
+
+ const value = parseFloat(match[1])
+ const unit = match[2]
+
+ if (!(unit in units))
+ throw new Error('Unrecognized unit. Available units are K, Ki, M, Mi, G, Gi etc')
+
+ return value * units[unit]
+ }
+
+ function fetchAliasOptions() {
+ return getAliasOptions ? getAliasOptions() : []
+ }
+
+ function validateNewCertificates({ itemCtx }) {
+ const addedAliases = (model && model.map((item) => item.alias)) || []
+
+ if (addedAliases.includes(itemCtx.alias) && itemCtx.isCreate) {
+ return { isInvalid: true, message: 'Alias already exists' }
+ }
+ return {}
+ }
+
+ function disableAlias() {
+ return !!(model && model.alias)
+ }
+
+ function setExporter(type) {
+ let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}`
+ const limitVal = getValue(discriminator, path)
+
+ if (!limitVal) {
+ path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}`
+ const reqVal = getValue(discriminator, path)
+
+ if (reqVal) return reqVal
+ }
+ return limitVal
+ }
+
+ function onExporterResourceChange(type) {
+ const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}`
+ const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}`
+ const val = getValue(model, valPath)
+ if (val)
+ commit('wizard/model$update', {
+ path: commitPath,
+ value: val,
+ force: true,
+ })
+ }
+
+ function isMachineValid(type) {
+ const dbDetails = getValue(discriminator, '/dbDetails')
+ let limits = {}
+ if (type === 'node' || !type) {
+ limits = dbDetails?.spec?.podTemplate?.spec?.containers?.[0]?.resources?.requests || {}
+ } else {
+ limits =
+ dbDetails?.spec?.topology?.distributed?.[type]?.podTemplate?.spec?.containers?.[0]?.resources?.requests ||
+ {}
+ }
+
+ const selectedMachine = getValue(discriminator, `/machine-${type}`)
+ const selectedLimits = { cpu: selectedMachine?.cpu, memory: selectedMachine?.memory }
+
+ if (Object.keys(limits).length && JSON.stringify(limits) === JSON.stringify(selectedLimits)) {
+ return 'Resource limits are same as current machine configuration. Please select different resources or machine preset.'
+ }
+ return false
+ }
+
+ return {
+ isMachineValid,
+ setExporter,
+ onExporterResourceChange,
+ fetchAliasOptions,
+ validateNewCertificates,
+ disableAlias,
+ isRancherManaged,
+ fetchJsons,
+ returnFalse,
+ getNamespaces,
+ getDbs,
+ getDbDetails,
+ getVersionInfo,
+ isVersionEmpty,
+ getDbVersions,
+ ifRequestTypeEqualsTo,
+ onRequestTypeChange,
+ getDbTls,
+ getDbType,
+ disableOpsRequest,
+ initNamespace,
+ initDatabaseRef,
+ showAndInitName,
+ showAndInitNamespace,
+ showAndInitDatabaseRef,
+ showConfigureOpsrequestLabel,
+ showAndInitOpsRequestType,
+ ifDbTypeEqualsTo,
+ getConfigSecrets,
+ getNamespacedResourceList,
+ getResourceList,
+ resourceNames,
+ unNamespacedResourceNames,
+ ifReconfigurationTypeEqualsTo,
+ onReconfigurationTypeChange,
+ onApplyconfigChange,
+ hasTlsField,
+ initIssuerRefApiGroup,
+ getIssuerRefsName,
+ initTlsOperation,
+ onTlsOperationChange,
+ showIssuerRefAndCertificates,
+ isIssuerRefRequired,
+ getRequestTypeFromRoute,
+ isDbDetailsLoading,
+ setValueFromDbDetails,
+ getAliasOptions,
+ isDatabaseRefDisabled,
+ isNamespaceDisabled,
+ onNamespaceChange,
+ onDbChange,
+ setApplyToIfReady,
+ isVerticalScaleTopologyRequired,
+ getMachines,
+ setMachine,
+ onMachineChange,
+ isMachineCustom,
+ checkVolume,
+ fetchConfigSecrets,
+ getConfigSecretsforAppyConfig,
+ getSelectedConfigurationData,
+ createNewConfigSecret,
+ decodeError,
+ isCreateSecret,
+ isNotCreateSecret,
+ onCreateSecretChange,
+ cancelCreateSecret,
+ setApplyConfig,
+ onRemoveConfigChange,
+ onNewConfigSecretChange,
+ onSelectedSecretChange,
+ isTlsEnabled,
+ }
+}
diff --git a/charts/opskubedbcom-milvusopsrequest-editor/ui/language.yaml b/charts/opskubedbcom-milvusopsrequest-editor/ui/language.yaml
new file mode 100644
index 0000000000..4af06a278c
--- /dev/null
+++ b/charts/opskubedbcom-milvusopsrequest-editor/ui/language.yaml
@@ -0,0 +1,106 @@
+bn: {}
+en:
+ labels:
+ agent: Select a Monitoring Method
+ milvus: Milvus
+ node_selection_policy: Node Selection Policy
+ topology: Topology
+ alias: Alias
+ annotations:
+ key: Key
+ label: Annotations
+ value: Value
+ api_group: API Group
+ apply: Apply
+ args: Args
+ basic_info: Basic Information
+ certificate: Certificate
+ certificates: Certificates
+ config_ops_request: Configure Ops Request
+ configuration: Configuration
+ configSecret: Config Secret
+ createConfig: Create Secret
+ applyConfig:
+ key: Key
+ value: Value
+ label: Apply Config
+ countries: Countries
+ country: Country
+ cpu: CPU
+ database:
+ mode: Database Mode
+ name: Milvus Name
+ secret: Database Secret
+ version: Database Version
+ databaseRef: Select your database
+ dns_name: DNS Name
+ dns_names: DNS Names
+ duration: Duration
+ enable_tls: Enable TLS
+ issuer_ref: Issuer Reference
+ key: Key
+ kind: Kind
+ labels:
+ key: Key
+ label: Labels
+ value: Value
+ memory: Memory
+ name: Name
+ namespace: Namespace
+ new_secret_password: New Database Secret
+ node: Node
+ op_req_name: Ops Request Name
+ ops_request_type: Type of Ops Request
+ organization: Organization
+ organizational_unit: Organizational Unit
+ organizational_units: Organizational Units
+ organizations: Organizations
+ province: Province
+ provinces: Provinces
+ reconfigurationType: Reconfiguration Type
+ removeCustomConfig: Remove Custom Config?
+ renew_before: Renew Before
+ replicas: Replicas
+ resources: Resources
+ secret: Secret
+ secret_name: Secret Name
+ storage:
+ class: Storage Class
+ size: Storage Size
+ subject: Subject
+ targetVersion: Select Target Version
+ timeout: Timeout
+ tls: Reconfigure TLS
+ tlsOperation: Choose TLS Operation
+ type: Type
+ value: Value
+ options:
+ HorizontalScaling:
+ description: Scale up or down pod count
+ text: Horizontal Scaling
+ Reconfigure:
+ description: Reconfigure your database
+ text: Reconfigure
+ ReconfigureTLS:
+ description: Reconfigure your database tls configuration
+ text: Reconfigure TLS
+ Restart:
+ description: Restart your database
+ text: Restart
+ UpdateVersion:
+ description: Update your database to any version
+ text: Update Version
+ VerticalScaling:
+ description: Manage your CPU resources
+ text: Vertical Scaling
+ VolumeExpansion:
+ description: Manage your database size
+ text: Volume Expansion
+ RotateAuth:
+ description: Rotate authentication credentials
+ text: Rotate Auth
+ StorageMigration:
+ description: Migrate storage
+ text: Storage Migration
+ steps:
+ - label: Basic Information