Skip to content

Commit

Permalink
fix: disable helm pre-upgrade-hook (#394)
Browse files Browse the repository at this point in the history
Co-authored-by: sophon-zt <sophon-zt@users.noreply.github.com>
(cherry picked from commit 3565191)
  • Loading branch information
sophon-zt committed Jul 9, 2024
1 parent 91f736a commit 46be094
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/user_docs/cli/kbcli_cluster_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ kbcli cluster create [NAME] [flags]
### SEE ALSO

* [kbcli cluster](kbcli_cluster.md) - Cluster command.
* [kbcli cluster create elasticsearch](kbcli_cluster_create_elasticsearch.md) - Create a elasticsearch cluster.
* [kbcli cluster create kafka](kbcli_cluster_create_kafka.md) - Create a kafka cluster.
* [kbcli cluster create llm](kbcli_cluster_create_llm.md) - Create a llm cluster.
* [kbcli cluster create mongodb](kbcli_cluster_create_mongodb.md) - Create a mongodb cluster.
Expand Down
5 changes: 3 additions & 2 deletions docs/user_docs/cli/kbcli_cluster_create_xinference.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ kbcli cluster create xinference NAME [flags]

```
--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 2)
--cpu float CPU cores. Value range [0, 64].
--cpu-mode Set to true if no GPU is available
--disable-exporter Enable or disable monitor. (default true)
--gpu float GPU cores. Value range [0, 64]. (default 1)
-h, --help help for xinference
--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 6)
--memory float Memory, the unit is Gi. Value range [0, 1000].
--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 replication mode, the default replicas is 2. Value range [1, 5]. (default 1)
--shm-size string shm size (default "64Mi")
--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")
```
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/kubeblocks/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,11 @@ func (o *InstallOptions) buildChart() *helm.InstallOpts {
}
}

func (o *InstallOptions) disableHelmPreHookJob() {
// disable kubeblocks helm pre hook job
o.ValueOpts.Values = append(o.ValueOpts.Values, "crd.enabled=false")
}

func versionExists(version string) (bool, error) {
if version == "" {
return true, nil
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/kubeblocks/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ func (o *InstallOptions) Upgrade() error {

s = spinner.New(o.Out, spinnerMsg("Upgrading KubeBlocks "+msg))
defer s.Fail()
o.disableHelmPreHookJob()
// upgrade KubeBlocks chart
if err = o.upgradeChart(); err != nil {
return err
Expand Down

0 comments on commit 46be094

Please sign in to comment.