Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_create_kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kbcli cluster create kafka NAME [flags]
--memory float Memory, the unit is Gi. Value range [0.5, 1000]. (default 0.5)
--meta-storage float Metadata Storage size, the unit is Gi. Value range [1, 10000]. (default 5)
--meta-storage-class string The StorageClass for Kafka Metadata Storage.
--mode string Mode for Kafka kraft cluster, 'combined' is combined Kafka controller and broker,'separated' is broker and controller running independently. Legal values [combined, separated]. (default "combined")
--mode string Mode for Kafka kraft cluster, 'combined' is combined Kafka controller and broker,'separated' is broker and controller running independently. Legal values [combined, separated, withZookeeper-10]. (default "combined")
--monitor-enable Enable monitor for Kafka. (default true)
--monitor.limit.cpu float (default 0.5)
--monitor.limit.memory float (default 1)
Expand All @@ -47,6 +47,7 @@ kbcli cluster create kafka NAME [flags]
--pod-anti-affinity string Pod anti-affinity type, one of: (Preferred, Required) (default "Preferred")
--replicas int The number of Kafka broker replicas for combined mode. Legal values [1, 3, 5]. (default 1)
--sasl-enable Enable authentication using SASL/PLAIN for Kafka.
--sasl-scram-enable Enable authentication using SASL/SCRAM for Kafka.
--storage float Data Storage size, the unit is Gi. Value range [1, 10000]. (default 10)
--storage-class string The StorageClass for Kafka Data Storage.
--storage-enable Enable storage for Kafka.
Expand Down
5 changes: 4 additions & 1 deletion pkg/cmd/kubeblocks/kubeblocks_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package kubeblocks
import (
"context"
"encoding/json"
"fmt"
"strings"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -82,7 +83,9 @@ func getKBObjects(dynamic dynamic.Interface, namespace string, addons []*extensi
ctx := context.TODO()

// get CRDs
crds, err := dynamic.Resource(types.CRDGVR()).List(ctx, metav1.ListOptions{})
crds, err := dynamic.Resource(types.CRDGVR()).List(ctx, metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=%s", constant.AppNameLabelKey, types.KubeBlocksChartName),
})
appendErr(err)
kbObjs[types.CRDGVR()] = &unstructured.UnstructuredList{}

Expand Down
10 changes: 7 additions & 3 deletions pkg/cmd/kubeblocks/kubeblocks_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,15 @@ func mockName() string {
}

func mockCRD() []runtime.Object {
label := map[string]string{constant.AppNameLabelKey: types.KubeBlocksChartName}
clusterCRD := v1.CustomResourceDefinition{
TypeMeta: metav1.TypeMeta{
Kind: "CustomResourceDefinition",
APIVersion: "apiextensions.k8s.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "clusters.apps.kubeblocks.io",
Name: "clusters.apps.kubeblocks.io",
Labels: label,
},
Spec: v1.CustomResourceDefinitionSpec{
Group: types.AppsAPIGroup,
Expand All @@ -174,7 +176,8 @@ func mockCRD() []runtime.Object {
APIVersion: "apiextensions.k8s.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "clusterdefinitions.apps.kubeblocks.io",
Name: "clusterdefinitions.apps.kubeblocks.io",
Labels: label,
},
Spec: v1.CustomResourceDefinitionSpec{
Group: types.AppsAPIGroup,
Expand All @@ -188,7 +191,8 @@ func mockCRD() []runtime.Object {
APIVersion: "apiextensions.k8s.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "actionsets.dataprotection.kubeblocks.io",
Name: "actionsets.dataprotection.kubeblocks.io",
Labels: label,
},
Spec: v1.CustomResourceDefinitionSpec{
Group: types.DPAPIGroup,
Expand Down