Skip to content

Commit

Permalink
chore: support wait-addons flag for kb install (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldming authored Jun 11, 2024
1 parent 158ba56 commit be42fec
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ create-kbcli-embed-charts-dir:

build-single-kbcli-embed-chart.%: chart=$(word 2,$(subst ., ,$@))
build-single-kbcli-embed-chart.%:
$(HELM) dependency update addons/addons/$(chart) --skip-refresh
$(HELM) package addons/addons/$(chart)
$(HELM) dependency update addons/addons-cluster/$(chart) --skip-refresh
$(HELM) package addons/addons-cluster/$(chart)
- bash -c "diff <($(HELM) template $(chart)-*.tgz) <($(HELM) template pkg/cluster/charts/$(chart).tgz)" > chart.diff
@if [ -s chart.diff ]; then \
mv $(chart)-*.tgz pkg/cluster/charts/$(chart).tgz; \
Expand Down
2 changes: 1 addition & 1 deletion addons
Submodule addons updated 719 files
1 change: 0 additions & 1 deletion docs/user_docs/cli/kbcli_cluster_create_xinference.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ kbcli cluster create xinference NAME [flags]
--replicas int The number of replicas, for standalone mode, the replicas is 1, for replication mode, the default replicas is 2. Value range [1, 5]. (default 1)
--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")
--version string Cluster version.
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/user_docs/cli/kbcli_kubeblocks_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ kbcli kubeblocks install [flags]
-f, --values strings Specify values in a YAML file or a URL (can specify multiple)
--version string KubeBlocks version
--wait Wait for KubeBlocks to be ready, including all the auto installed add-ons. It will wait for a --timeout period (default true)
--wait-addons Wait for auto installed add-ons. It will wait for a --timeout period (default true)
```

### Options inherited from parent commands
Expand Down
Binary file modified pkg/cluster/charts/apecloud-mysql-cluster.tgz
Binary file not shown.
Binary file modified pkg/cluster/charts/mongodb-cluster.tgz
Binary file not shown.
Binary file modified pkg/cluster/charts/postgresql-cluster.tgz
Binary file not shown.
Binary file modified pkg/cluster/charts/redis-cluster.tgz
Binary file not shown.
Binary file modified pkg/cluster/charts/xinference-cluster.tgz
Binary file not shown.
14 changes: 8 additions & 6 deletions pkg/cmd/kubeblocks/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ type Options struct {
HelmCfg *helm.Config

// Namespace is the current namespace the command running in
Namespace string
Client kubernetes.Interface
Dynamic dynamic.Interface
Timeout time.Duration
Wait bool
Namespace string
Client kubernetes.Interface
Dynamic dynamic.Interface
Timeout time.Duration
Wait bool
WaitAddons bool
}

type InstallOptions struct {
Expand Down Expand Up @@ -159,6 +160,7 @@ func newInstallCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra
cmd.Flags().BoolVar(&o.Check, "check", true, "Check kubernetes environment before installation")
cmd.Flags().DurationVar(&o.Timeout, "timeout", 300*time.Second, "Time to wait for installing KubeBlocks, such as --timeout=10m")
cmd.Flags().BoolVar(&o.Wait, "wait", true, "Wait for KubeBlocks to be ready, including all the auto installed add-ons. It will wait for a --timeout period")
cmd.Flags().BoolVar(&o.WaitAddons, "wait-addons", true, "Wait for auto installed add-ons. It will wait for a --timeout period")
cmd.Flags().BoolVar(&p.force, flagForce, p.force, "If present, just print fail item and continue with the following steps")
cmd.Flags().StringVar(&o.PodAntiAffinity, "pod-anti-affinity", "", "Pod anti-affinity type, one of: (Preferred, Required)")
cmd.Flags().StringArrayVar(&o.TopologyKeys, "topology-keys", nil, "Topology keys for affinity")
Expand Down Expand Up @@ -375,7 +377,7 @@ You can check the KubeBlocks status by running "kbcli kubeblocks status"

// waitAddonsEnabled waits for auto-install addons status to be enabled
func (o *InstallOptions) waitAddonsEnabled() error {
if !o.Wait {
if !o.Wait || !o.WaitAddons {
return nil
}

Expand Down

0 comments on commit be42fec

Please sign in to comment.