k8s 版本升级

kubernetes 状态
$ kubectl get node
NAME                          STATUS   ROLES    AGE    VERSION
k8s-master01.gdfsxxds.rjyun   Ready    master   105d   v1.14.0
k8s-master02.gdfsxxds.rjyun   Ready    master   105d   v1.14.0
k8s-master03.gdfsxxds.rjyun   Ready    master   105d   v1.14.0
k8s-node01.gdfsxxds.rjyun     Ready    <none>   105d   v1.14.0
k8s-node02.gdfsxxds.rjyun     Ready    <none>   105d   v1.14.0
k8s-node03.gdfsxxds.rjyun     Ready    <none>   105d   v1.14.0
k8s-node04.gdfsxxds.rjyun     Ready    <none>   105d   v1.14.0

 

在所有 master 节点下载镜像,脚本内容
$ cat pull_image.sh
MY_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openthings
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.15.0
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.15.0
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.15.0
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.15.0

docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.15.0  registry.aliyuncs.com/google_containers/kube-apiserver:v1.15.0
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.15.0 registry.aliyuncs.com/google_containers/kube-controller-manager:v1.15.0
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.15.0  registry.aliyuncs.com/google_containers/kube-scheduler:v1.15.0
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.15.0  registry.aliyuncs.com/google_containers/kube-proxy:v1.15.0

 

在 master01 节点进行操作
yum -y install kubeadm-1.15.0 kubelet-1.15.0 kubectl-1.15.0

升级检查和方案
$ kubeadm upgrade plan
执行更新操作
$ kubeadm upgrade apply v1.15.0
$ systemctl daemon-reload
$ systemctl restart kubelet

 

在其他master 和 node 节点分别执行
yum -y install kubeadm-1.15.0 kubelet-1.15.0 kubectl-1.15.0
systemctl daemon-reload
systemctl restart kubelet

 

检查集群版本
$  kubectl get node
NAME                          STATUS   ROLES    AGE    VERSION
k8s-master01.gdfsxxds.rjyun   Ready    master   105d   v1.15.0
k8s-master02.gdfsxxds.rjyun   Ready    master   105d   v1.15.0
k8s-master03.gdfsxxds.rjyun   Ready    master   105d   v1.15.0
k8s-node01.gdfsxxds.rjyun     Ready    <none>   105d   v1.15.0
k8s-node02.gdfsxxds.rjyun     Ready    <none>   105d   v1.15.0
k8s-node03.gdfsxxds.rjyun     Ready    <none>   105d   v1.15.0
k8s-node04.gdfsxxds.rjyun     Ready    <none>   105d   v1.15.0

  

posted @ 2020-01-20 11:41  lixinliang  阅读(3835)  评论(0编辑  收藏  举报