5.2.2 upgrade to 5.3.1 documentation
If you have not installed the historical version of Rainbond, please refer to Quick Installation
version change
Console upgrade
To upgrade from v5.2.2-release to v5.3.1-release, you need to upgrade the console and the cluster respectively.The current chapter section describes the console upgrade steps.Video tutorials are provided throughout the process, see the end of the article for details.
database backup
Before upgrading the console, you need to back up and upgrade the database used by the console.By default, the operation needs to enter the rbd-db-0
database container environment to operate. If your Rainbond is connected to an external database, please backup and upgrade (sql) as appropriate.
- backup
# Log in to rbd-db-0 for data backup, the object is console region library
kubectl exec -ti rbd-db-0 -n rbd-system -- bash
mysqldump -uroot -p${MYSQL_ROOT_PASSWORD} --databases console > /var/lib /mysql/console.sql
mysqldump -uroot -p${MYSQL_ROOT_PASSWORD} --databases region > /var/lib/mysql/region.sql
# The backup file is located in the following location of the master node by default, if your cluster does not use the default nfs share storage, then you need to manually find the persistence path of
-db8 ls /opt/rainbond/data/db*/mysql/*.sql
- Upgrade the console library
# Log in to rbd-db-0 to perform operations
kubectl exec -ti rbd-db-0 -n rbd-system -- bash
curl https://grstatic.oss-cn-shanghai.aliyuncs.com/docs/5.3/upgrade /5.2.2-5.3.0.sql -o /5.2.2-5.3.0.sql
curl https://grstatic.oss-cn-shanghai.aliyuncs.com/docs/5.3/upgrade/5.3.0- 5.3.1.sql -o /5.3.0-5.3.1.sql
mysql -uroot -p${MYSQL_ROOT_PASSWORD} -Dconsole -e 'source /5.2.2-5.3.0.sql'
mysql -uroot -p${MYSQL_ROOT_PASSWORD} -Dconsole -e 'source/5.3.0-5.3.1.sql'
Update 5.2.2 Console
kubectl apply -f https://grstatic.oss-cn-shanghai.aliyuncs.com/docs/5.3/upgrade/rbd-app-ui-5.2.2.1-rbdcomponent.yaml
Confirm the status of rbd-app-ui:
kubectl get po -l name=rbd-app-ui -n rbd-system
NAME READY STATUS RESTARTS AGE
rbd-app-ui-7c6877cc9f-ph5pc 1/1 Running 0 90s
Install the new version of the console
- Install Apps from Open Source App Stores Rainbond - Open Source
- Register the console database originally used by the cluster in the deployed Rainbond-Open Source application in the form of a third-party component, fill in the static registration address:
rbd-db-rw.rbd-system:3306
, add the required connection information Environment variable, replacingMysql5.7
databases in Rainbond-Open Source.Database If your Rainbond is connected to an external database, please add the corresponding environment variables directly for theRainbond-console
andcluster installation driver service
that depend on the database.After the replacement of the database is complete, update the two service components described above.The specific environment variables added are shown in the following table:
Connection information environment variable name | environment variable value |
---|---|
DB_TYPE | mysql |
MYSQL_DB | console |
MYSQL_USER | root |
MYSQL_PASS | <查询 rbd-db-0 容器中 ${MYSQL_ROOT_PASSWORD} 值> |
Change the cluster API address to the gateway IP. If your cluster has multiple gateways, please fill in the VIP or load balancer address.
Process the original console
The original console refers to the rbd-app-ui-xxxxxxxxx-xxxx
pods created by default in the rbd-system
namespace during installation, and the rbdcomponents, deployment and other resources involved in maintaining these pods.Since it involves the replacement of new and old resources, it is strongly recommended to perform the operation steps of the original console after the subsequent cluster-side upgrade operation.
By editing the rbdcomponents resource customized by Rainbond, the following configuration can be performed for the original console to complete the upgrade action:
- Mirror address use
registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.3.1-release-allinone
- Add environment variable DB_TYPE=mysql
- Add new pvc mount
All changes are made in spec
paragraph:
kubectl edit rbdcomponents.rainbond.io rbd-app-ui -n rbd-system
spec:
env:
- name: DB_TYPE
value: mysql
volumeMounts:
- mountPath: /root/.ssh
name: app
subPath : ssh
image: registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond:v5.3.1-release-allinone
imagePullPolicy: IfNotPresent
priorityComponent: false
replicas: 1
resources: {}
After installing the Rainbond-Open Source console in the cluster, the original console can exist as an operation and maintenance backdoor. It is only enabled when the Rainbond-Open Source fault cannot be accessed. Usually, you can set
replicas
to 0 to close it. pod to achieve the purpose of saving resources.
Cluster side upgrade
To upgrade from v5.2.2-release to v5.3.1-release, you need to upgrade the console and the cluster respectively.The current chapter describes the cluster-side upgrade steps.Video tutorials are provided throughout the process, see the end of the article for details.
Update Rainbond CRD resources
# Load CRD configuration file
kubectl apply -f https://grstatic.oss-cn-shanghai.aliyuncs.com/docs/5.3/upgrade/monitoring.coreos.com_servicemonitors.yaml
Update the rainbond-operator component
# Delete the old rainbond-operator statefulset
kubectl delete sts rainbond-operator -n rbd-system
# Create a new rainbond-operator deployment
kubectl apply -f https://grstatic.oss-cn-shanghai.aliyuncs.com/ docs/5.3/upgrade/rainbond-operator-deployment-v2.0.1.yaml
Update build private server components
# Delete rbdcomponent
of rbd-repo kubectl delete rbdcomponents.rainbond.io rbd-repo -n rbd-system
# Create a new component rbd-resource-proxy
kubectl apply -f https://grstatic.oss-cn-shanghai. aliyuncs.com/docs/5.3/upgrade/rbd-resource-proxy-rbdcomponent-v5.3.1-release.yaml
Update grctl command
docker run -it --rm -v /:/rootfs registry.cn-hangzhou.aliyuncs.com/goodrain/rbd-grctl:v5.3.1-release copy
mv /usr/local/bin/rainbond-grctl /usr/local/bin/grctl && grctl install
Execute the upgrade command
grctl cluster upgrade --new-version=v5.3.1-release
Update other functional images
# Login
function Login_registry(){
inner_registry=$(kubectl get rainbondcluster -n rbd-system -o yaml | grep -v 'f:domain' | grep domain | awk '{print $2}')
registry_user=$(kubectl get rainbondcluster -n rbd-system -o yaml | grep -v 'f:username' | grep username | awk '{print $2}')
registry_pass=$(kubectl get rainbondcluster -n rbd-system -o yaml | grep -v 'f:password ' | grep password | awk '{print $2}')
docker login --username ${registry_user} --password ${registry_pass} ${inner_registry}
}
# Pull image and replace, push
function Other_images(){
from_registory=registry.cn-hangzhou.aliyuncs.com /goodrain
to_registory=goodrain.me
for image in builder runner rbd-init-probe rbd-mesh-data-panel
do
docker pull $from_registory/$image:v5.3.1-release
docker tag $from_registory/$image:v5.3.1 -release $to_registory/$image
docker push $to_registory/$image
done
}
# start update
Login_registry && Other_images
Create Maven source build default configuration (optional)
This step is used to create a default settings.xml configuration required for building the java maven source code. In most scenarios, it is used to declare the private server address, user name, password and other information within the enterprise.When you do not need to customize, Rainbond will generate the Alibaba Cloud private server address by default.Therefore, this step is optional.
grctl build maven-setting add --file <absolute path of user-defined settings.xml file>
rebuild the plugin
Enter the plug-in management page, click Build on the respective management pages of the export network management plug-in
and service integrated network management plug-in
to update it.For the service components that have installed the above plugins, you need to reinstall the plugins to make them take effect after building the plugins.
Backup latest console
Upgrade verification
- Observe whether the platform version is
v5.3.1-release
in the Enterprise Information column on the overview page - On the cluster page, check whether the platform version of the connected cluster is
v5.3.1-release
- Check
rbd-api
rbd-chaos
rbd-eventlog
rbd-gateway
rbd-monitor
rbd-mq
rbd-node
rbd-webcli
rbd-worker
Service, whether the tag of the image it uses isv5.3.1-release
- Try to build the java maven project from source and verify that the
rbd-resource-proxy
service is working properly - Follow the
New Features
chapter, try the new features one by one, and verify if they work properly
Offline upgrade
Currently Rainbond v5.3.1-release does not provide offline upgrade packages.However, all resources in the upgrade process, including configuration files and images, can be processed offline.Users can download and localize these resources by themselves, and import them into the offline Rainbond v5.2.2-release environment for upgrade operations.
Note that:
- It is not necessary to install the Rainbond-Open Source console for the offline environment, just refer to the documentation to process the original console
- To add environment variable
DISABLE_DEFAULT_APP_MARKET = true
for console component.This variable is used to avoid frequent requests from the console to the open source app store in an offline environment - When preparing for offline mirroring, do not omit the mirrors corresponding to
rainbond-operator
andrbd-resource-proxy
The mirror addresses are defined in thedeployment.yaml
configuration file that starts them
video tutorial
Haoyu Technology officially conducted an online live broadcast on March 11, 2021. It taught the whole process upgrading from5.2.2-release to 5.3.0-release, and provided playback. Users can click the link to go online. Watch this video.
This video demonstrates "the whole process of upgrading from Rainbond 5.2.2-release to 5.3.0-release", which is still useful for upgrading from 5.2.2-release to 5.3.1-release.