mysql连接测试不成功的原因有哪些
248
2022-09-11
|NO.Z.00091|——————————|^^ 升级 ^^|——|KuberNetes&二进制升级.V02|——|kubernetes_master|k8s-master01组件|
一、kubernetes升级说明
### --- kubernetes升级说明 ~~~ 在升级的时候建议最后去升级controller-manager ~~~ 在升级的过程中最好把controller-manager停掉, ~~~ 在升级的过程中可能会造成pod的漂移,造成业务pod漂移。 ~~~ 在升级的过程中节点挂掉,pod漂移,业务宕机 ~~~ 若是controller-manager的版本过高,kubelet版本过低;就会造成循环的去创建pod或者有些api版本不符合报错 ~~~ 在升级过程中,一般都是把controller-manager停掉;等升级完所有的节点,包括升级完kubelet再启动controller-manager,再升级 ~~~ # 第二种方案:把这个节点下线在升级,与controller-manager在哪里都是没有影响的
### --- kubernetes升级方案 ~~~ 方案一:本地直接升级,停止controller-manager再去升级 ~~~ 方案二:停止所升级节点,再升级kubernetes相关组件;controller-manager是不可以停止掉的 ~~~ 方案三:设置成不可调度的方式,再去升级
### --- 此环境升级采用方案: ~~~ 此环境升级kubernetes方案:把节点下线;容器会漂移到其它节点,然后再升级这个节点相关组件 ~~~ 优点一:升级节点pod提前漂移了,系统业务不会受到影响 ~~~ 缺点一:若是不下线不漂移;直接升级kubelet,在升级完之后节点上的容器会重启;升级完之后哈希值会变,哈希值变化之后,容器就会重启。先下线,或者设置成不可调度的方式,再滚动发布。pod会滚动重新发布 ~~~ 缺点:升级过程中,pod来回漂移会造成pod多次重启;若是在本地直接升级会造成服务中断;若是多副本,是没有任何问题的。
二、下载kubernetes.v1.19.5版本包
### --- 下载kubernetes-server.v1.19.5 ~~~ # 下载kubernetes-server.1.19.5版本的资源包 [root@k8s-master01 master]# wget -c # 查看下载的版本包 [root@k8s-master01 master]# ll -rw-r--r-- 1 root root 309852159 Dec 10 2020 kubernetes-server-linux-amd64.tar.gz
~~~ # 解压kubernetes版本包 [root@k8s-master01 master]# tar -zxvf kubernetes-server-linux-amd64.tar.gz
~~~ # 查看当前版本包下kubernetes版本 ~~~ 注:Client可以看到它的版本号为:1.19.5 ~~~ 注:Server版本号为1.17.0;还是历史版本号;升级完成之后会发生更改 [root@k8s-master01 bin]# pwd /root/upgrade/master/kubernetes/server/bin [root@k8s-master01 bin]# ./kubectl version Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.5", GitCommit:"e338cf2c6d297aa603b50ad3a301f761b4173aa6", GitTreeState:"clean", BuildDate:"2020-12-09T11:18:51Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.17.0", GitCommit:"8a62859e515889f07e3e3be6a1080413f17cf2c3", GitTreeState:"clean", BuildDate:"2021-04-15T03:19:55Z", GoVersion:"go1.15.10", Compiler:"gc", Platform:"linux/amd64"}
一、kubernetes升级k8s-master01节点组件:kubernetes升级kube-apiserver
### --- kubernetes升级kube-apiserver ~~~ # 查看kube-apiserver历史版本 [root@k8s-master01 ~]# /usr/local/bin/kube-apiserver --version Kubernetes v1.17.0
~~~ # 备份kube-apiserver版本 [root@k8s-master01 ~]# which kube-apiserver /usr/local/bin/kube-apiserver [root@k8s-master01 ~]# mkdir /usr/local/bin/api.bac [root@k8s-master01 ~]# cp /usr/local/bin/kube-apiserver /usr/local/bin/api.bac/
~~~ # 停止kube-apiserver服务 [root@k8s-master01 ~]# systemctl stop kube-apiserver
~~~ # 升级kube-apiserver服务 [root@k8s-master01 ~]# cp upgrade/master/kubernetes/server/bin/kube-apiserver /usr/local/bin/ cp: overwrite ‘/usr/local/bin/kube-apiserver’? y
~~~ # 查看kube-apiserver版本 [root@k8s-master01 ~]# /usr/local/bin/kube-apiserver --version Kubernetes v1.19.5
~~~ # 启动kube-apiserver服务 [root@k8s-master01 ~]# systemctl daemon-reload [root@k8s-master01 ~]# systemctl restart kube-apiserver
二、kubernetes升级kube-controller-manager
### --- kubernetes升级kube-controller-manager ~~~ # 查看kube-controller-manager历史版本 [root@k8s-master01 ~]# /usr/local/bin/kube-controller-manager --version Kubernetes v1.17.0
~~~ # 备份kube-controller-manager版本 [root@k8s-master01 ~]# which kube-controller-manager /usr/local/bin/kube-controller-manager [root@k8s-master01 ~]# mkdir /usr/local/bin/controller.bak [root@k8s-master01 ~]# cp /usr/local/bin/kube-controller-manager /usr/local/bin/controller.bak/
~~~ # 停止kube-controller-manager服务 [root@k8s-master01 ~]# systemctl stop kube-controller-manager
~~~ # 升级kube-controller-manager服务 [root@k8s-master01 ~]# cp upgrade/master/kubernetes/server/bin/kube-controller-manager /usr/local/bin/ cp: overwrite ‘/usr/local/bin/kube-controller-manager’? y
~~~ # 查看kube-controller-manager版本 [root@k8s-master01 ~]# /usr/local/bin/kube-controller-manager --version Kubernetes v1.19.5
~~~ # 启动kube-controller-manager服务 [root@k8s-master01 ~]# systemctl daemon-reload [root@k8s-master01 ~]# systemctl restart kube-controller-manager
三、kubernetes升级kube-scheduler
### --- kubernetes升级kube-scheduler ~~~ # 查看kube-scheduler历史版本 [root@k8s-master01 ~]# /usr/local/bin/kube-scheduler --version Kubernetes v1.17.0
~~~ # 备份kube-scheduler版本 [root@k8s-master01 ~]# which kube-scheduler /usr/local/bin/kube-scheduler [root@k8s-master01 ~]# mkdir /usr/local/bin/scheduler.bak [root@k8s-master01 ~]# cp /usr/local/bin/kube-scheduler /usr/local/bin/scheduler.bak/
~~~ # 停止kube-scheduler服务 [root@k8s-master01 ~]# systemctl stop kube-scheduler
~~~ # 升级kube-scheduler服务 [root@k8s-master01 ~]# cp upgrade/master/kubernetes/server/bin/kube-scheduler /usr/local/bin/ cp: overwrite ‘/usr/local/bin/kube-scheduler’? y
~~~ # 查看kube-scheduler版本 [root@k8s-master01 ~]# /usr/local/bin/kube-scheduler --version Kubernetes v1.19.5
~~~ # 启动kube-scheduler服务 [root@k8s-master01 ~]# systemctl daemon-reload [root@k8s-master01 ~]# systemctl restart kube-scheduler
四、kubernetes升级kube-proxy
### --- kubernetes升级kube-proxy ~~~ # 查看kube-proxy历史版本 [root@k8s-master01 ~]# /usr/local/bin/kube-proxy --version Kubernetes v1.17.0
~~~ # 备份kube-proxy版本 [root@k8s-master01 ~]# which kube-proxy /usr/local/bin/kube-proxy [root@k8s-master01 ~]# mkdir /usr/local/bin/proxy.bak [root@k8s-master01 ~]# cp /usr/local/bin/kube-proxy /usr/local/bin/proxy.bak/
~~~ # 停止kube-proxy服务 [root@k8s-master01 ~]# systemctl stop kube-proxy
~~~ # 升级kube-proxy服务 [root@k8s-master01 ~]# cp upgrade/master/kubernetes/server/bin/kube-proxy /usr/local/bin/ cp: overwrite ‘/usr/local/bin/kube-proxy’? y
~~~ # 查看kube-proxy版本 [root@k8s-master01 ~]# /usr/local/bin/kube-proxy --version Kubernetes v1.19.5
~~~ # 启动kube-proxy服务 [root@k8s-master01 ~]# systemctl daemon-reload [root@k8s-master01 ~]# systemctl restart kube-proxy
五、查看集群状态
### --- 查看集群状态 [root@k8s-master01 ~]# kubectl cluster-info Kubernetes master is running at https://192.168.1.20:8443 CoreDNS is running at Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~