From 8d201e1d5db838ff742ff9b4342fa90e76aa33c4 Mon Sep 17 00:00:00 2001 From: wangyelei Date: Wed, 11 Feb 2026 18:14:43 +0800 Subject: [PATCH 1/6] chore: remove kbcli cluster register when enabling addon --- pkg/cmd/addon/addon.go | 10 ++++++++-- pkg/cmd/addon/install.go | 11 +++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/addon/addon.go b/pkg/cmd/addon/addon.go index ae7c0c0d5..378b24532 100644 --- a/pkg/cmd/addon/addon.go +++ b/pkg/cmd/addon/addon.go @@ -32,6 +32,7 @@ import ( extensionsv1alpha1 "github.com/apecloud/kubeblocks/apis/extensions/v1alpha1" "github.com/apecloud/kubeblocks/pkg/constant" viper "github.com/apecloud/kubeblocks/pkg/viperx" + "github.com/fatih/color" "github.com/jedib0t/go-pretty/v6/table" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -49,7 +50,6 @@ import ( "k8s.io/utils/strings/slices" "github.com/apecloud/kbcli/pkg/action" - clusterCmd "github.com/apecloud/kbcli/pkg/cmd/cluster" "github.com/apecloud/kbcli/pkg/cmd/plugin" "github.com/apecloud/kbcli/pkg/printer" "github.com/apecloud/kbcli/pkg/types" @@ -228,7 +228,13 @@ func newEnableCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra. util.CheckErr(o.PatchOptions.CmdComplete(cmd)) util.CheckErr(o.PatchOptions.Run()) if isEngineAddon(&o.addon) { - util.CheckErr(clusterCmd.RegisterClusterChart(f, streams, "", name, getAddonVersion(&o.addon), types.ClusterChartsRepoURL)) + fmt.Fprintf(o.Out, "addon %s enabled successfully\n", name) + fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n") + msg := color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", name, name, types.ClusterChartsRepoURL)) + fmt.Fprintf(o.Out, msg) + fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n") + msg = color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", name)) + fmt.Fprintf(o.Out, msg) } } }, diff --git a/pkg/cmd/addon/install.go b/pkg/cmd/addon/install.go index d232a3b8c..aab5147b9 100644 --- a/pkg/cmd/addon/install.go +++ b/pkg/cmd/addon/install.go @@ -29,6 +29,7 @@ import ( "github.com/Masterminds/semver/v3" kbappsv1 "github.com/apecloud/kubeblocks/apis/apps/v1" "github.com/apecloud/kubeblocks/pkg/constant" + "github.com/fatih/color" "github.com/spf13/cobra" helmaction "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart/loader" @@ -48,7 +49,6 @@ import ( extensionsv1alpha1 "github.com/apecloud/kubeblocks/apis/extensions/v1alpha1" "github.com/apecloud/kbcli/pkg/cluster" - clusterCmd "github.com/apecloud/kbcli/pkg/cmd/cluster" "github.com/apecloud/kbcli/pkg/printer" "github.com/apecloud/kbcli/pkg/types" "github.com/apecloud/kbcli/pkg/util" @@ -149,9 +149,12 @@ func newInstallCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra util.CheckErr(o.Run(f, streams)) // avoid unnecessary messages for upgrade fmt.Fprintf(o.Out, "addon %s installed successfully\n", o.name) - if err := clusterCmd.RegisterClusterChart(f, streams, "", o.name, o.clusterChartVersion, o.clusterChartRepo); err != nil { - util.CheckErr(err) - } + fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n") + msg := color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", o.name, o.name, o.clusterChartRepo)) + fmt.Fprintf(o.Out, msg) + fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n") + msg = color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", o.name)) + fmt.Fprintf(o.Out, msg) }, } cmd.Flags().BoolVar(&o.force, "force", false, "force install the addon and ignore the version check") From bc61099573c61f5edeb2f8db8e37f1294f38cfbb Mon Sep 17 00:00:00 2001 From: wangyelei Date: Thu, 26 Feb 2026 09:54:19 +0800 Subject: [PATCH 2/6] chore: remove kbcli cluster register when enabling addon --- addons | 2 +- docs/user_docs/cli/kbcli_cluster_create.md | 10 ++++ .../kbcli_cluster_create_apecloud-mysql.md | 54 ++++++++----------- .../user_docs/cli/kbcli_cluster_custom-ops.md | 29 ++++++++++ 4 files changed, 63 insertions(+), 32 deletions(-) diff --git a/addons b/addons index 3dca32705..e381e3de9 160000 --- a/addons +++ b/addons @@ -1 +1 @@ -Subproject commit 3dca32705114aed567891a7bf44201a069e9b32e +Subproject commit e381e3de9cac5d07f7e24ce57dfbc1e86a607503 diff --git a/docs/user_docs/cli/kbcli_cluster_create.md b/docs/user_docs/cli/kbcli_cluster_create.md index 6c3805622..cec4d416f 100644 --- a/docs/user_docs/cli/kbcli_cluster_create.md +++ b/docs/user_docs/cli/kbcli_cluster_create.md @@ -55,14 +55,24 @@ kbcli cluster create [ClusterType] [flags] * [kbcli cluster](kbcli_cluster.md) - Cluster command. * [kbcli cluster create apecloud-mysql](kbcli_cluster_create_apecloud-mysql.md) - Create a apecloud-mysql cluster. +* [kbcli cluster create clickhouse](kbcli_cluster_create_clickhouse.md) - Create a clickhouse cluster. * [kbcli cluster create etcd](kbcli_cluster_create_etcd.md) - Create a etcd cluster. +* [kbcli cluster create greptime](kbcli_cluster_create_greptime.md) - Create a greptime cluster. * [kbcli cluster create kafka](kbcli_cluster_create_kafka.md) - Create a kafka cluster. +* [kbcli cluster create loki](kbcli_cluster_create_loki.md) - Create a loki cluster. +* [kbcli cluster create milvus](kbcli_cluster_create_milvus.md) - Create a milvus cluster. +* [kbcli cluster create minio](kbcli_cluster_create_minio.md) - Create a minio cluster. * [kbcli cluster create mongodb](kbcli_cluster_create_mongodb.md) - Create a mongodb cluster. * [kbcli cluster create mysql](kbcli_cluster_create_mysql.md) - Create a mysql cluster. +* [kbcli cluster create oceanbase](kbcli_cluster_create_oceanbase.md) - Create a oceanbase cluster. +* [kbcli cluster create orchestrator](kbcli_cluster_create_orchestrator.md) - Create a orchestrator cluster. +* [kbcli cluster create polardbx](kbcli_cluster_create_polardbx.md) - Create a polardbx cluster. * [kbcli cluster create postgresql](kbcli_cluster_create_postgresql.md) - Create a postgresql cluster. +* [kbcli cluster create pulsar](kbcli_cluster_create_pulsar.md) - Create a pulsar cluster. * [kbcli cluster create qdrant](kbcli_cluster_create_qdrant.md) - Create a qdrant cluster. * [kbcli cluster create rabbitmq](kbcli_cluster_create_rabbitmq.md) - Create a rabbitmq cluster. * [kbcli cluster create redis](kbcli_cluster_create_redis.md) - Create a redis cluster. +* [kbcli cluster create victoria-metrics](kbcli_cluster_create_victoria-metrics.md) - Create a victoria-metrics cluster. #### Go Back to [CLI Overview](cli.md) Homepage. diff --git a/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md b/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md index e654ed265..b8ca2c109 100644 --- a/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md +++ b/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md @@ -21,37 +21,29 @@ kbcli cluster create apecloud-mysql NAME [flags] ### Options ``` - --cpu float CPU cores. Value range [0.5, 64]. (default 0.5) - --disable-exporter Enable or disable monitor. (default true) - --dry-run string[="unchanged"] Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none") - --edit Edit the API resource before creating - --etcd.local.etcdctl-api string (default "3") - --etcd.local.replicas int Value range [1, 3]. (default 3) - --etcd.local.resources.storage string (default "20Gi") - --etcd.local.service-version string (default "3.5.6") - --etcd.mode string Legal values [serviceRef, local]. (default "local") - --etcd.service-ref.cluster.component string (default "etcd") - --etcd.service-ref.cluster.credential string - --etcd.service-ref.cluster.name string - --etcd.service-ref.cluster.port string (default "client") - --etcd.service-ref.cluster.service string (default "headless") - --etcd.service-ref.namespace string (default "default") - --etcd.service-ref.service-descriptor string - -h, --help help for apecloud-mysql - --memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5) - --mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone") - --node-labels stringToString Node label selector (default []) - -o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml) - --pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred") - --proxy-enabled Enable proxy or not. - --replicas int The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Value range [1, 5]. (default 1) - --storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20) - --storage-class-name string Storage class name of the data volume - --tenancy string Tenancy options, one of: (SharedNode, DedicatedNode) (default "SharedNode") - --termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Delete, WipeOut]. (default "Delete") - --tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"' - --topology-keys stringArray Topology keys for affinity - --version string MySQL Service Version. (default "8.0.30") + --availability-policy string The availability policy of cluster. Legal values [none, node, zone]. (default "node") + --cpu float CPU cores. Value range [0.5, 64]. (default 0.5) + --disable-exporter Enable or disable monitor. (default true) + --dry-run string[="unchanged"] Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none") + --edit Edit the API resource before creating + -h, --help help for apecloud-mysql + --host-network-accessible Specify whether the cluster can be accessed from within the VPC. + --memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5) + --mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone") + --node-labels stringToString Node label selector (default []) + -o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml) + --pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred") + --proxy-enabled Enable proxy or not. + --publicly-accessible Specify whether the cluster can be accessed from the public internet. + --rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources. + --replicas int The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Value range [1, 5]. (default 1) + --storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20) + --storage-class-name string Storage class name of the data volume + --tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode") + --termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete") + --tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"' + --topology-keys stringArray Topology keys for affinity + --version string Cluster version. (default "ac-mysql-8.0.30") ``` ### Options inherited from parent commands diff --git a/docs/user_docs/cli/kbcli_cluster_custom-ops.md b/docs/user_docs/cli/kbcli_cluster_custom-ops.md index 8bd6e19e2..aed0490b9 100644 --- a/docs/user_docs/cli/kbcli_cluster_custom-ops.md +++ b/docs/user_docs/cli/kbcli_cluster_custom-ops.md @@ -57,6 +57,35 @@ kbcli cluster custom-ops OpsDef --cluster [fl ### SEE ALSO * [kbcli cluster](kbcli_cluster.md) - Cluster command. +* [kbcli cluster custom-ops add-arch-for-dm](kbcli_cluster_custom-ops_add-arch-for-dm.md) - Create a custom ops with opsDef add-arch-for-dm +* [kbcli cluster custom-ops hdfs-balancer](kbcli_cluster_custom-ops_hdfs-balancer.md) - Create a custom ops with opsDef hdfs-balancer +* [kbcli cluster custom-ops hive-server2-apply-account](kbcli_cluster_custom-ops_hive-server2-apply-account.md) - Create a custom ops with opsDef hive-server2-apply-account +* [kbcli cluster custom-ops kafka-quota](kbcli_cluster_custom-ops_kafka-quota.md) - Create a custom ops with opsDef kafka-quota +* [kbcli cluster custom-ops kafka-topic](kbcli_cluster_custom-ops_kafka-topic.md) - Create a custom ops with opsDef kafka-topic +* [kbcli cluster custom-ops kafka-user-acl](kbcli_cluster_custom-ops_kafka-user-acl.md) - Create a custom ops with opsDef kafka-user-acl +* [kbcli cluster custom-ops mongodb-shard-toggle-balancer](kbcli_cluster_custom-ops_mongodb-shard-toggle-balancer.md) - Create a custom ops with opsDef mongodb-shard-toggle-balancer +* [kbcli cluster custom-ops mssql-dynamic-modify-member](kbcli_cluster_custom-ops_mssql-dynamic-modify-member.md) - Create a custom ops with opsDef mssql-dynamic-modify-member +* [kbcli cluster custom-ops mssql-dynamic-modify-member-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-modify-member-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-modify-member-1.0.0 +* [kbcli cluster custom-ops mssql-dynamic-remove-ag](kbcli_cluster_custom-ops_mssql-dynamic-remove-ag.md) - Create a custom ops with opsDef mssql-dynamic-remove-ag +* [kbcli cluster custom-ops mssql-dynamic-remove-ag-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-remove-ag-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-remove-ag-1.0.0 +* [kbcli cluster custom-ops mssql-dynamic-remove-member](kbcli_cluster_custom-ops_mssql-dynamic-remove-member.md) - Create a custom ops with opsDef mssql-dynamic-remove-member +* [kbcli cluster custom-ops mssql-dynamic-remove-member-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-remove-member-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-remove-member-1.0.0 +* [kbcli cluster custom-ops nebula-balance-data](kbcli_cluster_custom-ops_nebula-balance-data.md) - Create a custom ops with opsDef nebula-balance-data +* [kbcli cluster custom-ops ob-alter-unit](kbcli_cluster_custom-ops_ob-alter-unit.md) - Create a custom ops with opsDef ob-alter-unit +* [kbcli cluster custom-ops ob-switch-configserver](kbcli_cluster_custom-ops_ob-switch-configserver.md) - Create a custom ops with opsDef ob-switch-configserver +* [kbcli cluster custom-ops pg-update-standby-config](kbcli_cluster_custom-ops_pg-update-standby-config.md) - Create a custom ops with opsDef pg-update-standby-config +* [kbcli cluster custom-ops post-rebuild-for-clickhouse](kbcli_cluster_custom-ops_post-rebuild-for-clickhouse.md) - Create a custom ops with opsDef post-rebuild-for-clickhouse +* [kbcli cluster custom-ops post-scale-for-dmdb](kbcli_cluster_custom-ops_post-scale-for-dmdb.md) - Create a custom ops with opsDef post-scale-for-dmdb +* [kbcli cluster custom-ops post-scale-out-shard-for-clickhouse](kbcli_cluster_custom-ops_post-scale-out-shard-for-clickhouse.md) - Create a custom ops with opsDef post-scale-out-shard-for-clickhouse +* [kbcli cluster custom-ops redis-cluster-rebalance](kbcli_cluster_custom-ops_redis-cluster-rebalance.md) - Create a custom ops with opsDef redis-cluster-rebalance +* [kbcli cluster custom-ops redis-master-account-ops](kbcli_cluster_custom-ops_redis-master-account-ops.md) - Create a custom ops with opsDef redis-master-account-ops +* [kbcli cluster custom-ops redis-reset-master](kbcli_cluster_custom-ops_redis-reset-master.md) - Create a custom ops with opsDef redis-reset-master +* [kbcli cluster custom-ops redis-sentinel-account-ops](kbcli_cluster_custom-ops_redis-sentinel-account-ops.md) - Create a custom ops with opsDef redis-sentinel-account-ops +* [kbcli cluster custom-ops redis-shard-account-ops](kbcli_cluster_custom-ops_redis-shard-account-ops.md) - Create a custom ops with opsDef redis-shard-account-ops +* [kbcli cluster custom-ops remove-remote-arch](kbcli_cluster_custom-ops_remove-remote-arch.md) - Create a custom ops with opsDef remove-remote-arch +* [kbcli cluster custom-ops switchover-for-dm](kbcli_cluster_custom-ops_switchover-for-dm.md) - Create a custom ops with opsDef switchover-for-dm +* [kbcli cluster custom-ops update-license-for-dm](kbcli_cluster_custom-ops_update-license-for-dm.md) - Create a custom ops with opsDef update-license-for-dm +* [kbcli cluster custom-ops update-license-for-kingbase](kbcli_cluster_custom-ops_update-license-for-kingbase.md) - Create a custom ops with opsDef update-license-for-kingbase #### Go Back to [CLI Overview](cli.md) Homepage. From 9210e272c73926b68ef3fb5cabff15081ed226a0 Mon Sep 17 00:00:00 2001 From: wangyelei Date: Thu, 26 Feb 2026 10:12:23 +0800 Subject: [PATCH 3/6] fix bug --- pkg/cmd/addon/addon.go | 6 ++---- pkg/cmd/addon/install.go | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/cmd/addon/addon.go b/pkg/cmd/addon/addon.go index 378b24532..7716d45b1 100644 --- a/pkg/cmd/addon/addon.go +++ b/pkg/cmd/addon/addon.go @@ -230,11 +230,9 @@ func newEnableCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra. if isEngineAddon(&o.addon) { fmt.Fprintf(o.Out, "addon %s enabled successfully\n", name) fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n") - msg := color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", name, name, types.ClusterChartsRepoURL)) - fmt.Fprintf(o.Out, msg) + fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", name, name, types.ClusterChartsRepoURL))) fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n") - msg = color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", name)) - fmt.Fprintf(o.Out, msg) + fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", name))) } } }, diff --git a/pkg/cmd/addon/install.go b/pkg/cmd/addon/install.go index aab5147b9..381b7c2a8 100644 --- a/pkg/cmd/addon/install.go +++ b/pkg/cmd/addon/install.go @@ -150,11 +150,9 @@ func newInstallCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra // avoid unnecessary messages for upgrade fmt.Fprintf(o.Out, "addon %s installed successfully\n", o.name) fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n") - msg := color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", o.name, o.name, o.clusterChartRepo)) - fmt.Fprintf(o.Out, msg) + fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", o.name, o.name, o.clusterChartRepo))) fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n") - msg = color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", o.name)) - fmt.Fprintf(o.Out, msg) + fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", o.name))) }, } cmd.Flags().BoolVar(&o.force, "force", false, "force install the addon and ignore the version check") From 0f88c9ac38da433bee3c667e909f8eda917a069d Mon Sep 17 00:00:00 2001 From: wangyelei Date: Thu, 26 Feb 2026 02:16:33 +0000 Subject: [PATCH 4/6] chore: auto update cli doc changes --- docs/user_docs/cli/kbcli_cluster_create.md | 10 ---- .../kbcli_cluster_create_apecloud-mysql.md | 54 +++++++++++-------- .../user_docs/cli/kbcli_cluster_custom-ops.md | 29 ---------- 3 files changed, 31 insertions(+), 62 deletions(-) diff --git a/docs/user_docs/cli/kbcli_cluster_create.md b/docs/user_docs/cli/kbcli_cluster_create.md index cec4d416f..6c3805622 100644 --- a/docs/user_docs/cli/kbcli_cluster_create.md +++ b/docs/user_docs/cli/kbcli_cluster_create.md @@ -55,24 +55,14 @@ kbcli cluster create [ClusterType] [flags] * [kbcli cluster](kbcli_cluster.md) - Cluster command. * [kbcli cluster create apecloud-mysql](kbcli_cluster_create_apecloud-mysql.md) - Create a apecloud-mysql cluster. -* [kbcli cluster create clickhouse](kbcli_cluster_create_clickhouse.md) - Create a clickhouse cluster. * [kbcli cluster create etcd](kbcli_cluster_create_etcd.md) - Create a etcd cluster. -* [kbcli cluster create greptime](kbcli_cluster_create_greptime.md) - Create a greptime cluster. * [kbcli cluster create kafka](kbcli_cluster_create_kafka.md) - Create a kafka cluster. -* [kbcli cluster create loki](kbcli_cluster_create_loki.md) - Create a loki cluster. -* [kbcli cluster create milvus](kbcli_cluster_create_milvus.md) - Create a milvus cluster. -* [kbcli cluster create minio](kbcli_cluster_create_minio.md) - Create a minio cluster. * [kbcli cluster create mongodb](kbcli_cluster_create_mongodb.md) - Create a mongodb cluster. * [kbcli cluster create mysql](kbcli_cluster_create_mysql.md) - Create a mysql cluster. -* [kbcli cluster create oceanbase](kbcli_cluster_create_oceanbase.md) - Create a oceanbase cluster. -* [kbcli cluster create orchestrator](kbcli_cluster_create_orchestrator.md) - Create a orchestrator cluster. -* [kbcli cluster create polardbx](kbcli_cluster_create_polardbx.md) - Create a polardbx cluster. * [kbcli cluster create postgresql](kbcli_cluster_create_postgresql.md) - Create a postgresql cluster. -* [kbcli cluster create pulsar](kbcli_cluster_create_pulsar.md) - Create a pulsar cluster. * [kbcli cluster create qdrant](kbcli_cluster_create_qdrant.md) - Create a qdrant cluster. * [kbcli cluster create rabbitmq](kbcli_cluster_create_rabbitmq.md) - Create a rabbitmq cluster. * [kbcli cluster create redis](kbcli_cluster_create_redis.md) - Create a redis cluster. -* [kbcli cluster create victoria-metrics](kbcli_cluster_create_victoria-metrics.md) - Create a victoria-metrics cluster. #### Go Back to [CLI Overview](cli.md) Homepage. diff --git a/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md b/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md index b8ca2c109..e654ed265 100644 --- a/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md +++ b/docs/user_docs/cli/kbcli_cluster_create_apecloud-mysql.md @@ -21,29 +21,37 @@ kbcli cluster create apecloud-mysql NAME [flags] ### Options ``` - --availability-policy string The availability policy of cluster. Legal values [none, node, zone]. (default "node") - --cpu float CPU cores. Value range [0.5, 64]. (default 0.5) - --disable-exporter Enable or disable monitor. (default true) - --dry-run string[="unchanged"] Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none") - --edit Edit the API resource before creating - -h, --help help for apecloud-mysql - --host-network-accessible Specify whether the cluster can be accessed from within the VPC. - --memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5) - --mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone") - --node-labels stringToString Node label selector (default []) - -o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml) - --pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred") - --proxy-enabled Enable proxy or not. - --publicly-accessible Specify whether the cluster can be accessed from the public internet. - --rbac-enabled Specify whether rbac resources will be created by client, otherwise KubeBlocks server will try to create rbac resources. - --replicas int The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Value range [1, 5]. (default 1) - --storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20) - --storage-class-name string Storage class name of the data volume - --tenancy string The tenancy of cluster. Legal values [SharedNode, DedicatedNode]. (default "SharedNode") - --termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Halt, Delete, WipeOut]. (default "Delete") - --tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"' - --topology-keys stringArray Topology keys for affinity - --version string Cluster version. (default "ac-mysql-8.0.30") + --cpu float CPU cores. Value range [0.5, 64]. (default 0.5) + --disable-exporter Enable or disable monitor. (default true) + --dry-run string[="unchanged"] Must be "client", or "server". If with client strategy, only print the object that would be sent, and no data is actually sent. If with server strategy, submit the server-side request, but no data is persistent. (default "none") + --edit Edit the API resource before creating + --etcd.local.etcdctl-api string (default "3") + --etcd.local.replicas int Value range [1, 3]. (default 3) + --etcd.local.resources.storage string (default "20Gi") + --etcd.local.service-version string (default "3.5.6") + --etcd.mode string Legal values [serviceRef, local]. (default "local") + --etcd.service-ref.cluster.component string (default "etcd") + --etcd.service-ref.cluster.credential string + --etcd.service-ref.cluster.name string + --etcd.service-ref.cluster.port string (default "client") + --etcd.service-ref.cluster.service string (default "headless") + --etcd.service-ref.namespace string (default "default") + --etcd.service-ref.service-descriptor string + -h, --help help for apecloud-mysql + --memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5) + --mode string Cluster topology mode. Legal values [standalone, raftGroup]. (default "standalone") + --node-labels stringToString Node label selector (default []) + -o, --output format Prints the output in the specified format. Allowed values: JSON and YAML (default yaml) + --pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred") + --proxy-enabled Enable proxy or not. + --replicas int The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3. Value range [1, 5]. (default 1) + --storage float Storage size, the unit is Gi. Value range [1, 10000]. (default 20) + --storage-class-name string Storage class name of the data volume + --tenancy string Tenancy options, one of: (SharedNode, DedicatedNode) (default "SharedNode") + --termination-policy string The termination policy of cluster. Legal values [DoNotTerminate, Delete, WipeOut]. (default "Delete") + --tolerations strings Tolerations for cluster, such as "key=value:effect,key:effect", for example '"engineType=mongo:NoSchedule", "diskType:NoSchedule"' + --topology-keys stringArray Topology keys for affinity + --version string MySQL Service Version. (default "8.0.30") ``` ### Options inherited from parent commands diff --git a/docs/user_docs/cli/kbcli_cluster_custom-ops.md b/docs/user_docs/cli/kbcli_cluster_custom-ops.md index aed0490b9..8bd6e19e2 100644 --- a/docs/user_docs/cli/kbcli_cluster_custom-ops.md +++ b/docs/user_docs/cli/kbcli_cluster_custom-ops.md @@ -57,35 +57,6 @@ kbcli cluster custom-ops OpsDef --cluster [fl ### SEE ALSO * [kbcli cluster](kbcli_cluster.md) - Cluster command. -* [kbcli cluster custom-ops add-arch-for-dm](kbcli_cluster_custom-ops_add-arch-for-dm.md) - Create a custom ops with opsDef add-arch-for-dm -* [kbcli cluster custom-ops hdfs-balancer](kbcli_cluster_custom-ops_hdfs-balancer.md) - Create a custom ops with opsDef hdfs-balancer -* [kbcli cluster custom-ops hive-server2-apply-account](kbcli_cluster_custom-ops_hive-server2-apply-account.md) - Create a custom ops with opsDef hive-server2-apply-account -* [kbcli cluster custom-ops kafka-quota](kbcli_cluster_custom-ops_kafka-quota.md) - Create a custom ops with opsDef kafka-quota -* [kbcli cluster custom-ops kafka-topic](kbcli_cluster_custom-ops_kafka-topic.md) - Create a custom ops with opsDef kafka-topic -* [kbcli cluster custom-ops kafka-user-acl](kbcli_cluster_custom-ops_kafka-user-acl.md) - Create a custom ops with opsDef kafka-user-acl -* [kbcli cluster custom-ops mongodb-shard-toggle-balancer](kbcli_cluster_custom-ops_mongodb-shard-toggle-balancer.md) - Create a custom ops with opsDef mongodb-shard-toggle-balancer -* [kbcli cluster custom-ops mssql-dynamic-modify-member](kbcli_cluster_custom-ops_mssql-dynamic-modify-member.md) - Create a custom ops with opsDef mssql-dynamic-modify-member -* [kbcli cluster custom-ops mssql-dynamic-modify-member-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-modify-member-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-modify-member-1.0.0 -* [kbcli cluster custom-ops mssql-dynamic-remove-ag](kbcli_cluster_custom-ops_mssql-dynamic-remove-ag.md) - Create a custom ops with opsDef mssql-dynamic-remove-ag -* [kbcli cluster custom-ops mssql-dynamic-remove-ag-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-remove-ag-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-remove-ag-1.0.0 -* [kbcli cluster custom-ops mssql-dynamic-remove-member](kbcli_cluster_custom-ops_mssql-dynamic-remove-member.md) - Create a custom ops with opsDef mssql-dynamic-remove-member -* [kbcli cluster custom-ops mssql-dynamic-remove-member-1.0.0](kbcli_cluster_custom-ops_mssql-dynamic-remove-member-1.0.0.md) - Create a custom ops with opsDef mssql-dynamic-remove-member-1.0.0 -* [kbcli cluster custom-ops nebula-balance-data](kbcli_cluster_custom-ops_nebula-balance-data.md) - Create a custom ops with opsDef nebula-balance-data -* [kbcli cluster custom-ops ob-alter-unit](kbcli_cluster_custom-ops_ob-alter-unit.md) - Create a custom ops with opsDef ob-alter-unit -* [kbcli cluster custom-ops ob-switch-configserver](kbcli_cluster_custom-ops_ob-switch-configserver.md) - Create a custom ops with opsDef ob-switch-configserver -* [kbcli cluster custom-ops pg-update-standby-config](kbcli_cluster_custom-ops_pg-update-standby-config.md) - Create a custom ops with opsDef pg-update-standby-config -* [kbcli cluster custom-ops post-rebuild-for-clickhouse](kbcli_cluster_custom-ops_post-rebuild-for-clickhouse.md) - Create a custom ops with opsDef post-rebuild-for-clickhouse -* [kbcli cluster custom-ops post-scale-for-dmdb](kbcli_cluster_custom-ops_post-scale-for-dmdb.md) - Create a custom ops with opsDef post-scale-for-dmdb -* [kbcli cluster custom-ops post-scale-out-shard-for-clickhouse](kbcli_cluster_custom-ops_post-scale-out-shard-for-clickhouse.md) - Create a custom ops with opsDef post-scale-out-shard-for-clickhouse -* [kbcli cluster custom-ops redis-cluster-rebalance](kbcli_cluster_custom-ops_redis-cluster-rebalance.md) - Create a custom ops with opsDef redis-cluster-rebalance -* [kbcli cluster custom-ops redis-master-account-ops](kbcli_cluster_custom-ops_redis-master-account-ops.md) - Create a custom ops with opsDef redis-master-account-ops -* [kbcli cluster custom-ops redis-reset-master](kbcli_cluster_custom-ops_redis-reset-master.md) - Create a custom ops with opsDef redis-reset-master -* [kbcli cluster custom-ops redis-sentinel-account-ops](kbcli_cluster_custom-ops_redis-sentinel-account-ops.md) - Create a custom ops with opsDef redis-sentinel-account-ops -* [kbcli cluster custom-ops redis-shard-account-ops](kbcli_cluster_custom-ops_redis-shard-account-ops.md) - Create a custom ops with opsDef redis-shard-account-ops -* [kbcli cluster custom-ops remove-remote-arch](kbcli_cluster_custom-ops_remove-remote-arch.md) - Create a custom ops with opsDef remove-remote-arch -* [kbcli cluster custom-ops switchover-for-dm](kbcli_cluster_custom-ops_switchover-for-dm.md) - Create a custom ops with opsDef switchover-for-dm -* [kbcli cluster custom-ops update-license-for-dm](kbcli_cluster_custom-ops_update-license-for-dm.md) - Create a custom ops with opsDef update-license-for-dm -* [kbcli cluster custom-ops update-license-for-kingbase](kbcli_cluster_custom-ops_update-license-for-kingbase.md) - Create a custom ops with opsDef update-license-for-kingbase #### Go Back to [CLI Overview](cli.md) Homepage. From 5c4eba91719f02c0f422fbabcfe494a8ab0cd335 Mon Sep 17 00:00:00 2001 From: wangyelei Date: Thu, 26 Feb 2026 10:47:28 +0800 Subject: [PATCH 5/6] fix bug --- pkg/cmd/addon/addon.go | 4 ++-- pkg/cmd/addon/install.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/addon/addon.go b/pkg/cmd/addon/addon.go index 7716d45b1..54ccc285d 100644 --- a/pkg/cmd/addon/addon.go +++ b/pkg/cmd/addon/addon.go @@ -230,9 +230,9 @@ func newEnableCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra. if isEngineAddon(&o.addon) { fmt.Fprintf(o.Out, "addon %s enabled successfully\n", name) fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n") - fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", name, name, types.ClusterChartsRepoURL))) + fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", name, name, types.ClusterChartsRepoURL))) fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n") - fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", name))) + fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", name))) } } }, diff --git a/pkg/cmd/addon/install.go b/pkg/cmd/addon/install.go index 381b7c2a8..39f5a7ea1 100644 --- a/pkg/cmd/addon/install.go +++ b/pkg/cmd/addon/install.go @@ -152,7 +152,7 @@ func newInstallCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n") fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", o.name, o.name, o.clusterChartRepo))) fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n") - fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", o.name))) + fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", o.name))) }, } cmd.Flags().BoolVar(&o.force, "force", false, "force install the addon and ignore the version check") From 2b9893394820c02a0c1ef41ae16967f04aa6714e Mon Sep 17 00:00:00 2001 From: wangyelei Date: Thu, 26 Feb 2026 10:59:01 +0800 Subject: [PATCH 6/6] fix bug --- pkg/cmd/addon/install.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/addon/install.go b/pkg/cmd/addon/install.go index 39f5a7ea1..26e0810ce 100644 --- a/pkg/cmd/addon/install.go +++ b/pkg/cmd/addon/install.go @@ -150,7 +150,7 @@ func newInstallCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra // avoid unnecessary messages for upgrade fmt.Fprintf(o.Out, "addon %s installed successfully\n", o.name) fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n") - fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", o.name, o.name, o.clusterChartRepo))) + fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version \n", o.name, o.name, o.clusterChartRepo))) fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n") fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", o.name))) },