kubelet版本选择_升级 kubeadm/kubectl/kubelet 版本
查看该版本的容器镜像版本:kubeadmconfigimageslist输出如下:kubeadmconfigimageslistk8s.gcr.io/kube-apiserver:v1.12.1k8s.gcr.io/kube-controller-manager:v1.12.1k8s.gcr.io/kube-scheduler:v1.12.1k8s.gcr.io/kube-proxy:...
查看该版本的容器镜像版本:kubeadm config images list
输出如下:kubeadm config images list
k8s.gcr.io/kube-apiserver:v1.12.1
k8s.gcr.io/kube-controller-manager:v1.12.1
k8s.gcr.io/kube-scheduler:v1.12.1
k8s.gcr.io/kube-proxy:v1.12.1
k8s.gcr.io/pause:3.1
k8s.gcr.io/etcd:3.2.24
k8s.gcr.io/coredns:1.2.2
拉镜像
脚本在此!我发现了一个技巧,很多人自己可能有 GCE 的服务,他们利用该服务自动拉取了一些 gcr ,即我们 kubernetes 所需要的镜像并且推送到 dockerhub. 因此现在就有一种方法,因为被墙而拉取不下来的镜像,你可以去 dockerhub 找找,说不准有惊喜!但pull 下来的镜像需要重新 tag 一下。echo ""
echo "=========================================================="
echo "Pull Kubernetes v1.12.1 Images from aliyuncs.com ......"
echo "=========================================================="
echo ""
MY_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openthings
## 拉取镜像
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.12.1
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.12.1
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.12.1
docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.12.1
docker pull ${MY_REGISTRY}/k8s-gcr-io-etcd:3.2.24
docker pull ${MY_REGISTRY}/k8s-gcr-io-pause:3.1
docker pull ${MY_REGISTRY}/k8s-gcr-io-coredns:1.2.2
## 添加Tag
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.12.1 k8s.gcr.io/kube-apiserver:v1.12.1
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.12.1 k8s.gcr.io/kube-scheduler:v1.12.1
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.12.1 k8s.gcr.io/kube-controller-manager:v1.12.1
docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.12.1 k8s.gcr.io/kube-proxy:v1.12.1
docker tag ${MY_REGISTRY}/k8s-gcr-io-etcd:3.2.24 k8s.gcr.io/etcd:3.2.24
docker tag ${MY_REGISTRY}/k8s-gcr-io-pause:3.1 k8s.gcr.io/pause:3.1
docker tag ${MY_REGISTRY}/k8s-gcr-io-coredns:1.2.2 k8s.gcr.io/coredns:1.2.2
echo ""
上面的命令保存成脚本,然后执行。就可以了!
!!!但是这里也有一个坑!就是名字要求,我遇到的问题:需要手动修改镜像名称!k8s.gcr.io/kube-controller-manager:v1.12.1
k8s.gcr.io/kube-controller-manager-amd64:v1.12.1
相应地作修改即可!
升级集群
使用kubeadm upgrade plan ,输出的版本升级信息如下:COMPONENT CURRENT AVAILABLE
API Server v1.11.2 v1.12.1
Controller Manager v1.11.2 v1.12.1
Scheduler v1.11.2 v1.12.1
Kube Proxy v1.11.2 v1.12.1
CoreDNS 1.1.3 1.2.2
Etcd 3.2.18 3.2.24
确保上面的容器镜像已经下载(如果没有提前下载,可能被网络阻隔导致挂起),然后执行升级:kubeadm upgrade apply v1.12.1
看到下面信息,就OK了。[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.12.1". Enjoy!
相应的 Node 节点也要拉取镜像,并且安装对应的kubelet版本。
验证$ kubeadm versionClient Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:46:06Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:36:14Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
更多推荐
所有评论(0)