按照之前的多节点的图配置的

链接:

多节点部署k8s(5):配置master和node多节点-配置master02

1、查看当前版本

	[root@k8s-master1 ~]# kubectl version
	Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.3", GitCommit:"435f92c719f279a3a67808c80521ea17d5715c66", GitTreeState:"clean", BuildDate:"2018-11-26T12:57:14Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
	Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.3", GitCommit:"435f92c719f279a3a67808c80521ea17d5715c66", GitTreeState:"clean", BuildDate:"2018-11-26T12:46:57Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}

2、升级master(停止服务——更换新版本的执行文件——启动服务)

	[root@k8s-master1 /]# cd /opt/kubernetes/
	[root@k8s-master1 kubernetes]# cp -r ./bin ./bin.bak
	[root@k8s-master1 kubernetes]# systemctl stop kube-scheduler kube-controller-manager kube-apiserver
	[root@k8s-master1 kubernetes]# rm -rf ./bin/*
	[root@k8s-master1 kubernetes]# cp /root/kubernetes/server/bin/{kubectl,kube-scheduler,kube-apiserver,kube-controller-manager} ./bin
	[root@k8s-master1 kubernetes]# ls ./bin
	[root@k8s-master1 kubernetes]# systemctl start kube-scheduler kube-controller-manager kube-apiserver

3、升级node(停止服务——更换新版本的执行文件——启动服务)

	[root@k8s-node1 ~]# systemctl stop kubelet kube-proxy
	[root@k8s-node1 ~]# cd /opt/kubernetes/
	[root@k8s-node1 kubernetes]# cp -r ./bin ./bin.bak
	[root@k8s-node1 kubernetes]# rm -rf ./bin/{kubelet,kube-proxy}
	[root@k8s-node1 kubernetes]# scp root@192.168.100.10:/root/kubernetes/node/bin/{kubelet,kube-proxy} ./bin/
	[root@k8s-node1 kubernetes]# systemctl start kubelet kube-proxy

4、检查

	[root@k8s-master1 /]# kubectl version
		Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
		Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:05:50Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
	[root@k8s-master1 /]# kubectl get cs
		NAME                 STATUS    MESSAGE             ERROR
		controller-manager   Healthy   ok                  
		scheduler            Healthy   ok                  
		etcd-2               Healthy   {"health":"true"}   
		etcd-1               Healthy   {"health":"true"}   
		etcd-0               Healthy   {"health":"true"}
	[root@k8s-master1 /]# kubectl get nodes
		NAME             STATUS   ROLES    AGE   VERSION
		192.168.100.30   Ready    <none>   9d    v1.15.3
		192.168.100.40   Ready    <none>   9d    v1.15.3


Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐