本次调整改动比较大,会停服务。
1. salt配置
git clone --depth 1 -b v3.7 https://github.com/goodrain/rainbond-install.git
mv /srv/salt /srv/salt_v3.6
cp -a rainbond-install/install/salt /srv/salt
cd /srv/salt/install/files/k8s
cp -a /srv/salt_v3.6/kubernetes/server/install/ssl .
cp -a /srv/salt_v3.6/kubernetes/server/install/kubecfg .
docker run --rm -v /srv/salt/install/files/misc:/sysdir rainbond/cni:rbd_v3.7 tar zxf /pkg.tgz -C /sysdir
docker run --rm -v /srv/salt/install/files/misc:/sysdir rainbond/cni:k8s_v3.7 tar zxf /pkg.tgz -C /sysdir
cp -a /srv/salt/install/files/misc/bin/grctl /usr/local/bin/grctl
cp -a /srv/salt/install/files/misc/bin/grcert /usr/local/bin/grcert
2. 更新rainbond.sls
# 修改rbd-pkgs
rbd-pkgs:
common:
- gr-docker-engine
- tar
- ntpdate
- wget
- curl
- tree
- lsof
- htop
- nload
- net-tools
- telnet
- rsync
- git
- dstat
- salt-master
- salt-minion
- salt-ssh
- iotop
- lvm2
- ntpdate
- pwgen
centos:
- nfs-utils
- portmap
- perl
- bind-utils
- iproute
- bash-completion
- createrepo
- centos-release-gluster
- glusterfs-server
debian:
- nfs-kernel-server
- nfs-common
- dnsutils
- python-pip
- python-apt
- apt-transport-https
- uuid-runtime
- iproute2
- systemd
# 修改镜像版本, builder版本改为3.7, adapter,rbd-db版本还是3.6
其他3.6都改为3.7
# 文件目录/srv/pillar/rainbond.sls,操作前请备份
具体可以参考示例rainbond.sls
3. 更新镜像
请参考镜像更新脚本
4. 同步配置
salt manage01 state.sls image.ssl
salt manage01 state.sls image.rsync
salt "*" state.sls common.node_conf
salt "*" cmd.run 'mkdir -pv /opt/rainbond/health/'
salt "*" state.sls common.health
5. 停服务
dc-compose stop
systemctl stop kube-scheduler
systemctl stop kube-controller-manager
systemctl stop kube-apiserver
systemctl stop calico
systemctl stop etcd
systemctl stop kubelet
systemctl stop node
systemctl stop docker
systemctl disable node
systemctl disable calico.service
systemctl disable etcd.service
cd /etc/systemd/system/
systemctl disable kube*
mkdir /opt/rainbond/backup
mv /etc/systemd/system/calico.service /opt/rainbond/backup/
mv /etc/systemd/system/kube* /opt/rainbond/backup/
mv /etc/systemd/system/node.service /opt/rainbond/backup/
6. 修改docker配置
/opt/rainbond/envs/docker.sh
# 新增如下
-H 127.0.0.1:2376
systemctl start docker
7. 启动服务
salt manage01 state.sls image.rsync
salt "*" state.sls base.node
8. 更新数据库
wget https://raw.githubusercontent.com/goodrain/rainbond-console/V3.7/sql/3.7.sql
docker cp 3.7.sql rbd-db:/root
din rbd-db
mysql
use console;
source /root/3.7.sql
update region_info set ssl_ca_cert="/etc/goodrain/region.goodrain.me/ssl/ca.pem",cert_file="/etc/goodrain/region.goodrain.me/ssl/client.pem",key_file="/etc/goodrain/region.goodrain.me/ssl/client.key.pem";
9. 调整计算节点
1. 修改docker的启动脚本,新增-H 127.0.0.1:2376
2. 配置etcdctl命令(cp -a etcdctl /usr/local/bin/etcdctl)
当升级Rainbond 遇到问题时,请按要求收集相关信息通过 Github 提供给 Rainbond开发者。