Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add 0.9.1 upgrade guides and update related commands in 0.9.0 #8262

Merged
merged 10 commits into from
Oct 18, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Upgrade to KubeBlocks v0.8
description: Upgrade to KubeBlocks v0.8, operation, tips and notes
keywords: [upgrade, 0.8]
sidebar_position: 2
sidebar_position: 3
sidebar_label: Upgrade to KubeBlocks v0.8
---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
title: Upgrade to KubeBlocks v0.9.1
description: Upgrade to KubeBlocks v0.9.1, operation, tips and notes
keywords: [upgrade, 0.9.1]
sidebar_position: 1
sidebar_label: Upgrade to KubeBlocks v0.9.1
---

# Upgrade to KubeBlocks v0.9.1

:::note

Execute `helm -n kb-system list | grep kubeblocks` to check the current KubeBlocks version you are running before upgrading KubeBlocks.

:::

## Compatibility

KubeBlocks v0.9.1 is compatible with KubeBlocks v0.8 APIs, but compatibility with APIs from versions prior to v0.8 is not guaranteed. If you are using Addons from KubeBlocks v0.7 or earlier (v0.7., v0.6., etc), DO [upgrade KubeBlocks and all Addons to v0.8 first](./upgrade-kubeblocks-to-0.8.md) to ensure service availability before upgrading to v0.9.
zjx20 marked this conversation as resolved.
Show resolved Hide resolved

If you are upgrading from v0.8 to v0.9, it's recommended to enable webhook to ensure the availability.

## Upgrade from KubeBlocks v0.9.0

1. Set keepAddons.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "Preserve Addon resources during upgrade"?

Copy link
Contributor Author

@michelle-0808 michelle-0808 Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "Preserve Addon resources during upgrade"?

Great suggestion! I've added this sentence as the purpose of step 1 in the section "Upgrade from KubeBlocks v0.8" and adjusted related contents in the upgrade guide for v0.9.0.
For the section "Upgrade from v0.9.0", the description is a little different since keepAddon is set as true by default in Helm. Users just need to check its value. But crd.enabled should be set as false to avoid automatic CRD installation.

Copy link
Collaborator

@ldming ldming Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crd.enabled can be set when upgrade kubeblocks. For preserve addon resource, recommend to run follow command:

kubectl annotate addons.extensions.kubeblocks.io -l app.kubernetes.io/name=kubeblocks helm.sh/resource-policy=keep


KubeBlocks v0.8 streamlines the default installed engines. To avoid deleting Addon resources that are already in use during the upgrade, execute the following commands first to keep the Addons in use.

- Check the current KubeBlocks version.

```shell
helm -n kb-system list | grep kubeblocks
```

- Set `crd.enabled` as `false`.

```shell
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo update kubeblocks
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version {VERSION} --set crd.enabled=false
```

Replace `{VERSION}` with your current KubeBlocks version, such as 0.9.0.

- Check Addons.

Execute the following command to ensure that the Addon annotations contain `"helm.sh/resource-policy": "keep"`.

```shell
kubectl get addon -o json | jq '.items[] | {name: .metadata.name, annotations: .metadata.annotations}'
```

2. Install CRD.

To reduce the size of Helm chart, KubeBlocks v0.8 removes CRD from the Helm chart. Before upgrading, you need to install CRD.

```shell
kubectl replace -f https://github.com/apecloud/kubeblocks/releases/download/v0.9.1/kubeblocks_crds.yaml
```

3. Upgrade KubeBlocks.

```shell
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version 0.9.1 --set crd.enabled=false
```

:::warning

To avoid affecting existing database clusters, when upgrading to KubeBlocks v0.9, the versions of already-installed addons will not be upgraded by default. If you want to upgrade the addons to the versions built into KubeBlocks v0.9, execute the following command. Note that this may restart existing clusters and affect availability. Please proceed with caution.

```bash
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version 0.9.1 --set upgradeAddons=true --set crd.enabled=false
```

:::

## Upgrade from KubeBlocks v0.8

1. Set keepAddons.

KubeBlocks v0.8 streamlines the default installed engines. To avoid deleting Addon resources that are already in use during the upgrade, execute the following commands first.

- Check the current KubeBlocks version.

```shell
helm -n kb-system list | grep kubeblocks
```

- Set the value of `keepAddons` as true.

```shell
helm repo add kubeblocks https://apecloud.github.io/helm-charts
helm repo update kubeblocks
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version {VERSION} --set keepAddons=true
```

Replace `{VERSION}` with your current KubeBlocks version, such as 0.8.0.

- Check Addons.

Execute the following command to ensure that the Addon annotations contain `"helm.sh/resource-policy": "keep"`.

```shell
kubectl get addon -o json | jq '.items[] | {name: .metadata.name, annotations: .metadata.annotations}'
```

2. Delete the incompatible OpsDefinition.

```bash
kubectl delete opsdefinitions.apps.kubeblocks.io kafka-quota kafka-topic kafka-user-acl switchover
```

3. Install CRD.

To reduce the size of Helm chart, KubeBlocks v0.8 removes CRD from the Helm chart. Before upgrading, you need to install CRD.

If the network is slow, it's recommended to download the CRD YAML file on your localhost before further operations.

```shell
kubectl replace -f https://github.com/apecloud/kubeblocks/releases/download/v0.9.1/kubeblocks_crds.yaml || kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/v0.9.1/kubeblocks_crds.yaml
```

4. Upgrade KubeBlocks.

The command below sets `--set admissionWebhooks.enabled=true --set admissionWebhooks.ignoreReplicasCheck=true` to enable the webhook, facilitating support for multiple versions related to ConfigConstraint.

```shell
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version 0.9.1 --set upgradeAddons=false --set admissionWebhooks.enabled=true --set admissionWebhooks.ignoreReplicasCheck=true --set crd.enabled=false
```

:::warning

To avoid affecting existing database clusters, when upgrading to KubeBlocks v0.9, the versions of already-installed addons will not be upgraded by default. If you want to upgrade the Addons to the versions built into KubeBlocks v0.9, execute the following command. Note that this may restart existing clusters and affect availability. Please proceed with caution.

```bash
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version 0.9.1 --set upgradeAddons=true --set admissionWebhooks.enabled=true --set admissionWebhooks.ignoreReplicasCheck=true --set crd.enabled=false
```

:::

## Upgrade Addons

If you didn't specify `upgradeAddons` as `true` or your Addon is not included in the default installed addons, you can upgrade Addons by running the commands provided below to use the v0.9.x API.

:::note

- If the Addon you want to upgrade is `mysql`, you need to upgrade this Addon and restart the cluster. Otherwise, the cluster created in KubeBlocks v0.8 cannot be used in v0.9.

- If the Addon you want to use is `clickhouse/milvus/elasticsearch/llm`, you need to upgrade KubeBlocks first and then upgrade this Addon. Otherwise, these Addons cannot be used in KubeBlocks v0.9 normally.

:::

```bash
# Add Helm repo
helm repo add kubeblocks-addons https://apecloud.github.io/helm-charts

# If github is not accessible or the network is very slow for you, please use following repo instead
helm repo add kubeblocks-addons https://jihulab.com/api/v4/projects/150246/packages/helm/stable

# Update helm repo
helm repo update

# Update addon version
helm upgrade -i {addon-release-name} kubeblocks-addons/{addon-name} --version x.y.z -n kb-system
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Upgrade to KubeBlocks v0.9
description: Upgrade to KubeBlocks v0.9, operation, tips and notes
keywords: [upgrade, 0.9]
sidebar_position: 1
sidebar_position: 2
sidebar_label: Upgrade to KubeBlocks v0.9
---

Expand All @@ -18,7 +18,7 @@ Execute `helm -n kb-system list | grep kubeblocks` to check the current KubeBloc

## Compatibility

KubeBlocks 0.9 is compatible with KubeBlocks 0.8 APIs, but compatibility with APIs from versions prior to v0.8 is not guaranteed. If you are using addons from KubeBlocks 0.7 or earlier (v0.7., 0.6., etc), DO [upgrade KubeBlocks and all addons to v0.8 first](upgrade-kubeblocks-to-0.8.md) to ensure service availability before upgrading to v0.9.
KubeBlocks 0.9 is compatible with KubeBlocks 0.8 APIs, but compatibility with APIs from versions prior to v0.8 is not guaranteed. If you are using addons from KubeBlocks 0.7 or earlier (0.6, etc), DO [upgrade KubeBlocks and all addons to v0.8 first](upgrade-kubeblocks-to-0.8.md) to ensure service availability before upgrading to v0.9.

## Upgrade from KubeBlocks v0.8

Expand All @@ -40,7 +40,7 @@ KubeBlocks 0.9 is compatible with KubeBlocks 0.8 APIs, but compatibility with AP
helm -n kb-system upgrade kubeblocks kubeblocks/kubeblocks --version {VERSION} --set keepAddons=true
```

Replace `{VERSION}` with your current KubeBlocks version, such as 0.9.0.
Replace `{VERSION}` with your current KubeBlocks version, such as 0.8.0.

- Check addons.

Expand All @@ -61,7 +61,7 @@ KubeBlocks 0.9 is compatible with KubeBlocks 0.8 APIs, but compatibility with AP
To reduce the size of Helm chart, KubeBlocks v0.8 removes CRD from the Helm chart. Before upgrading, you need to install CRD.

```shell
kubectl replace -f https://github.com/apecloud/kubeblocks/releases/download/v0.9.0/kubeblocks_crds.yaml
kubectl replace -f https://github.com/apecloud/kubeblocks/releases/download/v0.9.0/kubeblocks_crds.yaml || kubectl create -f https://github.com/apecloud/kubeblocks/releases/download/v0.9./kubeblocks_crds.yaml
zjx20 marked this conversation as resolved.
Show resolved Hide resolved
```

4. Upgrade KubeBlocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Upgrade to KubeBlocks v0.8
description: Upgrade to KubeBlocks v0.8, operation, tips and notes
keywords: [upgrade, 0.8]
sidebar_position: 2
sidebar_position: 3
sidebar_label: Upgrade to KubeBlocks v0.8
---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: Upgrade to KubeBlocks v0.9.1
description: Upgrade to KubeBlocks v0.9.1, operation, tips and notes
keywords: [upgrade, 0.9.1]
sidebar_position: 1
sidebar_label: Upgrade to KubeBlocks v0.9.1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Upgrade to KubeBlocks v0.9.1

:::note

Execute `kbcli version` to check the current KubeBlocks version you are running before upgrading KubeBlocks.

:::

## Compatibility

KubeBlocks v0.9.1 is compatible with KubeBlocks v0.8 APIs, but compatibility with APIs from versions prior to v0.8 is not guaranteed. If you are using Addons from KubeBlocks v0.7 or earlier (v0.6, etc), DO [upgrade KubeBlocks and all addons to v0.8 first](./upgrade-kubeblocks-to-0.8.md) to ensure service availability before upgrading to v0.9.

If you are upgrading from v0.8 to v0.9, it's recommended to enable webhook to ensure the availability of the upgrade from v0.8 to v0.9.

## Upgrade from KubeBlocks 0.9.0

1. Download kbcli v0.9.1.

```bash
curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash -s 0.9.1
```

2. Upgrade KubeBlocks.

```bash
kbcli kb upgrade --version 0.9.1 --set crd.enabled=false
```

:::warning

To avoid affecting existing database clusters, when upgrading to KubeBlocks v0.9, the versions of already-installed Addons will not be upgraded by default. If you want to upgrade the Addons to the versions built into KubeBlocks v0.9, execute the following command. Note that this may restart existing clusters and affect availability. Please proceed with caution.

```bash
kbcli kb upgrade --version 0.9.1 --set crd.enabled=false --set upgradeAddons=true
```

:::

`kbcli` will automatically add the annotation `"helm.sh/resource-policy": "keep"` to ensure that existing addons are not deleted during the upgrade.

## Upgrade from KubeBlocks v0.8

1. Download kbcli v0.9.1.

```bash
curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash -s 0.9.1
```

2. Upgrade KubeBlocks.

```bash
kbcli kb upgrade --version 0.9.1 --set admissionWebhooks.enabled=true --set admissionWebhooks.ignoreReplicasCheck=true --set crd.enabled=false
```

:::warning

To avoid affecting existing database clusters, when upgrading to KubeBlocks v0.9, the versions of already-installed Addons will not be upgraded by default. If you want to upgrade the Addons to the versions built into KubeBlocks v0.9, execute the following command. Note that this may restart existing clusters and affect availability. Please proceed with caution.

```bash
kbcli kb upgrade --version 0.9.1 --set upgradeAddons=true --set admissionWebhooks.enabled=true --set admissionWebhooks.ignoreReplicasCheck=true --set crd.enabled=false
```

:::

`kbcli` will automatically add the annotation `"helm.sh/resource-policy": "keep"` to ensure that existing Addons are not deleted during the upgrade.

## Upgrade addons

If you didn't specify `upgradeAddons` as `true` or your Addon is not included in the default installed Addons, you can upgrade Addons by the options provided below to use the v0.9 API.

:::note

- If the Addon you want to upgrade is `mysql`, you need to upgrade this Addon and restart the cluster. Otherwise, the cluster created in KubeBlocks v0.8 cannot be used in v0.9.

- If the Addon you want to use is `clickhouse/milvus/elasticsearch/llm`, you need to upgrade KubeBlocks first and then upgrade this Addon. Otherwise, these Addons cannot be used in KubeBlocks v0.9 normally.

:::

```bash
# View the Addon index list
kbcli addon index list

# Update one index and the default index is kubeblocks
kbcli addon index update kubeblocks

# Search available Addon versions
kbcli addon search {addon-name}

# Install an Addon
kbcli addon install {addon-name} --version x.y.z

# Upgrade this Addon to a certain version
kbcli addon upgrade {addon-name} --version x.y.z

# Force to upgrade to a certain version
kbcli addon upgrade {addon-name} --version x.y.z --force

# View the available Addon versions
kbcli addon list | grep {addon-name}
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Upgrade to KubeBlocks v0.9
description: Upgrade to KubeBlocks v0.9, operation, tips and notes
keywords: [upgrade, 0.9]
sidebar_position: 1
sidebar_position: 2
sidebar_label: Upgrade to KubeBlocks v0.9
---

Expand All @@ -21,7 +21,7 @@ Execute `kbcli version` to check the current KubeBlocks version you are running,

## Compatibility

KubeBlocks 0.9 is compatible with KubeBlocks 0.8 APIs, but compatibility with APIs from versions prior to v0.8 is not guaranteed. If you are using addons from KubeBlocks 0.7 or earlier (v0.7., 0.6., etc), DO [upgrade KubeBlocks and all addons to v0.8 first](upgrade-kubeblocks-to-0.8.md) to ensure service availability before upgrading to v0.9.
KubeBlocks 0.9 is compatible with KubeBlocks 0.8 APIs, but compatibility with APIs from versions prior to v0.8 is not guaranteed. If you are using addons from KubeBlocks 0.7 or earlier (0.6, etc), DO [upgrade KubeBlocks and all addons to v0.8 first](upgrade-kubeblocks-to-0.8.md) to ensure service availability before upgrading to v0.9.

## Upgrade from KubeBlocks v0.8

Expand Down Expand Up @@ -49,7 +49,6 @@ KubeBlocks 0.9 is compatible with KubeBlocks 0.8 APIs, but compatibility with AP

kbcli will automatically add the annotation `"helm.sh/resource-policy": "keep"` to ensure that existing addons are not deleted during the upgrade.


## Upgrade addons

If you didn't specify `upgradeAddons` as `true` or your addon is not included in the default installed addons, you can upgrade addons by the options provided below to use the v0.9.0 API.
Expand All @@ -62,11 +61,25 @@ If the addon you want to use is `clickhouse/milvus/elasticsearch/llm`, you need

:::


```bash
# View the Addon index list
kbcli addon index list

# Update one index and the default index is kubeblocks
kbcli addon index update kubeblocks

kbcli addon upgrade xxx --force
#Search available Addon versions
kbcli addon search <addonName>

# Install an Addon
kbcli addon install <addonName> --version x.y.z

# Upgrade this Addon to a certain version
kbcli addon upgrade <addonName> --version x.y.z

# Force to upgrade to a certain version
kbcli addon upgrade <addonName> --version x.y.z --force

# View the available Addon versions
kbcli addon list | grep <addonName>
```
Loading