本次调整改动比较大,会停服务。

1. salt配置

  1. git clone --depth 1 -b v3.7 https://github.com/goodrain/rainbond-install.git
  2. mv /srv/salt /srv/salt_v3.6
  3. cp -a rainbond-install/install/salt /srv/salt
  4. cd /srv/salt/install/files/k8s
  5. cp -a /srv/salt_v3.6/kubernetes/server/install/ssl .
  6. cp -a /srv/salt_v3.6/kubernetes/server/install/kubecfg .
  7. docker run --rm -v /srv/salt/install/files/misc:/sysdir rainbond/cni:rbd_v3.7 tar zxf /pkg.tgz -C /sysdir
  8. docker run --rm -v /srv/salt/install/files/misc:/sysdir rainbond/cni:k8s_v3.7 tar zxf /pkg.tgz -C /sysdir
  9. cp -a /srv/salt/install/files/misc/bin/grctl /usr/local/bin/grctl
  10. cp -a /srv/salt/install/files/misc/bin/grcert /usr/local/bin/grcert

2. 更新rainbond.sls

  1. # 修改rbd-pkgs
  2. rbd-pkgs:
  3. common:
  4. - gr-docker-engine
  5. - tar
  6. - ntpdate
  7. - wget
  8. - curl
  9. - tree
  10. - lsof
  11. - htop
  12. - nload
  13. - net-tools
  14. - telnet
  15. - rsync
  16. - git
  17. - dstat
  18. - salt-master
  19. - salt-minion
  20. - salt-ssh
  21. - iotop
  22. - lvm2
  23. - ntpdate
  24. - pwgen
  25. centos:
  26. - nfs-utils
  27. - portmap
  28. - perl
  29. - bind-utils
  30. - iproute
  31. - bash-completion
  32. - createrepo
  33. - centos-release-gluster
  34. - glusterfs-server
  35. debian:
  36. - nfs-kernel-server
  37. - nfs-common
  38. - dnsutils
  39. - python-pip
  40. - python-apt
  41. - apt-transport-https
  42. - uuid-runtime
  43. - iproute2
  44. - systemd
  45. # 修改镜像版本, builder版本改为3.7, adapter,rbd-db版本还是3.6
  46. 其他3.6都改为3.7
  47. # 文件目录/srv/pillar/rainbond.sls,操作前请备份

具体可以参考示例rainbond.sls

3. 更新镜像

请参考镜像更新脚本

4. 同步配置

  1. salt manage01 state.sls image.ssl
  2. salt manage01 state.sls image.rsync
  3. salt "*" state.sls common.node_conf
  4. salt "*" cmd.run 'mkdir -pv /opt/rainbond/health/'
  5. salt "*" state.sls common.health

5. 停服务

  1. dc-compose stop
  2. systemctl stop kube-scheduler
  3. systemctl stop kube-controller-manager
  4. systemctl stop kube-apiserver
  5. systemctl stop calico
  6. systemctl stop etcd
  7. systemctl stop kubelet
  8. systemctl stop node
  9. systemctl stop docker
  10. systemctl disable node
  11. systemctl disable calico.service
  12. systemctl disable etcd.service
  13. cd /etc/systemd/system/
  14. systemctl disable kube*
  15. mkdir /opt/rainbond/backup
  16. mv /etc/systemd/system/calico.service /opt/rainbond/backup/
  17. mv /etc/systemd/system/kube* /opt/rainbond/backup/
  18. mv /etc/systemd/system/node.service /opt/rainbond/backup/

6. 修改docker配置

  1. /opt/rainbond/envs/docker.sh
  2. # 新增如下
  3. -H 127.0.0.1:2376
  4. systemctl start docker

7. 启动服务

  1. salt manage01 state.sls image.rsync
  2. salt "*" state.sls base.node

8. 更新数据库

  1. wget https://raw.githubusercontent.com/goodrain/rainbond-console/V3.7/sql/3.7.sql
  2. docker cp 3.7.sql rbd-db:/root
  3. din rbd-db
  4. mysql
  5. use console;
  6. source /root/3.7.sql
  7. 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. 1. 修改docker的启动脚本,新增-H 127.0.0.1:2376
  2. 2. 配置etcdctl命令(cp -a etcdctl /usr/local/bin/etcdctl)

当升级Rainbond 遇到问题时,请按要求收集相关信息通过 Github 提供给 Rainbond开发者