Upgrading with ocboot
This article introduces how to upgrade the service version to a specific version with ocboot.
tip
ocboot can only upgrade environments deployed with ocboot. If your environment was deployed with docker-compose, please refer to this document for upgrading:
Prerequisites
It is recommended to upgrade to adjacent versions, such as upgrading from v3.8.x to v3.10.x with the following steps:
- v3.8.x => v3.9.x
- v3.9.x => v3.10.x
In general, the upgrade steps are as follows:
Use the ocboot tool we wrote to upgrade. This tool mainly calls ansible to upgrade all nodes in the cluster.
- Use git to pull the latest code of ocboot and switch to the tag of
v3.11.12. - Use the
./ocboot.py upgradecommand in ocboot for version upgrade.
View current version
You can use kubectl to view the current version of the cluster.
# 使用 kubectl 获得当前集群的版本
$ kubectl -n onecloud get onecloudclusters default -o=jsonpath='{.spec.version}'
v3.10.15 # 发现当前版本为 v3.10.15
Clone ocboot tool
If you already have the ocboot tool locally, skip this step and update the code to the corresponding branch.
# Install ansible locally
$ python3 -m pip install --upgrade pip setuptools wheel
$ python3 -m pip install 'ansible<=9.0.0' paramiko
Clone the ocboot tool to your local environment.
# Use git clone the ocboot deployment tool locally
$ git clone -b release/3.11 https://github.com/yunionio/ocboot && cd ./ocboot