In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
这篇文章主要为大家展示了"Kubernetes 1.12.1如何快速升级",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"Kubernetes 1.12.1如何快速升级"这篇文章吧。
Kubernetes 1.12.1快速升级,包括升级kubeadm/kubectl/kubelet版本、拉取镜像、升级Kubernetes集群三个主要步骤。
1、升级kubeadm/kubectl/kubelet版本sudo apt install kubeadm=1.12.1-00 kubectl=1.12.1-00 kubelet=1.12.1-00
查看该版本的容器镜像版本:
kubeadm config images list
输出如下:
~# kubeadm config images listk8s.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:v1.12.1k8s.gcr.io/pause:3.1k8s.gcr.io/etcd:3.2.24k8s.gcr.io/coredns:1.2.22、拉取容器镜像
我给镜像到了杭州机房的容器仓库里,拉取还是比较快的。
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.1docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.12.1docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.12.1docker pull ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.12.1docker pull ${MY_REGISTRY}/k8s-gcr-io-etcd:3.2.24docker pull ${MY_REGISTRY}/k8s-gcr-io-pause:3.1docker pull ${MY_REGISTRY}/k8s-gcr-io-coredns:1.2.2## 添加Tagdocker tag ${MY_REGISTRY}/k8s-gcr-io-kube-apiserver:v1.12.1 k8s.gcr.io/kube-apiserver:v1.12.1docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-scheduler:v1.12.1 k8s.gcr.io/kube-scheduler:v1.12.1docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-controller-manager:v1.12.1 k8s.gcr.io/kube-controller-manager:v1.12.1docker tag ${MY_REGISTRY}/k8s-gcr-io-kube-proxy:v1.12.1 k8s.gcr.io/kube-proxy:v1.12.1docker tag ${MY_REGISTRY}/k8s-gcr-io-etcd:3.2.24 k8s.gcr.io/etcd:3.2.24docker tag ${MY_REGISTRY}/k8s-gcr-io-pause:3.1 k8s.gcr.io/pause:3.1docker tag ${MY_REGISTRY}/k8s-gcr-io-coredns:1.2.2 k8s.gcr.io/coredns:1.2.2echo ""echo "=========================================================="echo "Pull Kubernetes v1.12.1 Images FINISHED."echo "into registry.cn-hangzhou.aliyuncs.com/openthings, "echo " by openthings@https://my.oschina.net/u/2306127."echo "=========================================================="echo ""
保存为shell脚本,然后执行。
或者,下载脚本:https://github.com/openthings/kubernetes-tools/blob/master/kubeadm/2-images/
3、升级Kubernetes集群
先查看一下需要升级的各个组件的版本。
使用kubeadm upgrade plan ,输出的版本升级信息如下:
COMPONENT CURRENT AVAILABLEAPI Server v1.11.2 v1.12.1Controller Manager v1.11.2 v1.12.1Scheduler v1.11.2 v1.12.1Kube Proxy v1.11.2 v1.12.1CoreDNS 1.1.3 1.2.2Etcd 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!4、工作节点的升级
每个工作节点需要拉取上面对应版本的镜像,以及安装kubelet的对应版本。
Verify~$ kubectl 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"}
Get Pod
kubectl get pod --all-namespaces
view list.
以上是"Kubernetes 1.12.1如何快速升级"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.