1. 程式人生 > 其它 >|NO.Z.00092|——————————|^^ 升級 ^^|——|KuberNetes&二進位制升級.V03|-----------------------|kubernetes_master|k8s-master02元件|

|NO.Z.00092|——————————|^^ 升級 ^^|——|KuberNetes&二進位制升級.V03|-----------------------|kubernetes_master|k8s-master02元件|



[CloudNative:KuberNetes&二進位制升級.V03]                                                            [Applications.KuberNetes] [|DevOps|kubernetes|二進位制升級|kubernetes.v1.17.0——>v1.19.5] [|master元件|kube-apiserver/kube-controller-manager/kube-scheduler/kube-proxy.v1.17.0——>v1.19.5|]








一、kubernetes升級k8s-master02節點元件

### --- 檢視k8s-master02相關元件版本
~~~     檢視kube-apiserver kube-controller-manager kube-scheduler kube-proxy元件的版本

[root@k8s-master02 ~]# /usr/local/bin/kube-apiserver --version
Kubernetes v1.17.0
[root@k8s-master02 ~]# /usr/local/bin/kube-controller-manager --version
Kubernetes v1.17.0
[root@k8s-master02 ~]# /usr/local/bin/kube-scheduler --version
Kubernetes v1.17.0
[root@k8s-master02 ~]# /usr/local/bin/kube-proxy --version
Kubernetes v1.17.0
二、備份k8s-master02相關元件歷史版本配置
### --- 備份kube-apiserver kube-controller-manager kube-scheduler kube-proxy服務檔案

[root@k8s-master02 ~]# which kube-apiserver kube-controller-manager kube-scheduler kube-proxy
/usr/local/bin/kube-apiserver
/usr/local/bin/kube-controller-manager
/usr/local/bin/kube-scheduler
/usr/local/bin/kube-proxy
[root@k8s-master02 ~]# mkdir /usr/local/bin/bak/
[root@k8s-master02 ~]# cp /usr/local/bin/kube-apiserver /usr/local/bin/bak/
[root@k8s-master02 ~]# cp /usr/local/bin/kube-controller-manager /usr/local/bin/bak/
[root@k8s-master02 ~]# cp /usr/local/bin/kube-scheduler /usr/local/bin/bak/
[root@k8s-master02 ~]# cp /usr/local/bin/kube-proxy /usr/local/bin/bak/
三、停止k8s-master02相關元件服務
### --- 停止相關元件的服務 

[root@k8s-master02 ~]# systemctl stop kube-apiserver kube-controller-manager kube-scheduler kube-proxy
四、升級k8s-master02相關元件
### --- 升級相關元件服務

[root@k8s-master01 ~]# scp upgrade/master/kubernetes/server/bin/kube-apiserver k8s-master02:/usr/local/bin/
kube-apiserver                                                                                                                                    100%  110MB   3.9MB/s   00:27    
You have new mail in /var/spool/mail/root
[root@k8s-master01 ~]# scp upgrade/master/kubernetes/server/bin/kube-controller-manager k8s-master02:/usr/local/bin/
kube-controller-manager                                                                                                                           100%  102MB   3.8MB/s   00:26    
[root@k8s-master01 ~]# scp upgrade/master/kubernetes/server/bin/kube-scheduler k8s-master02:/usr/local/bin/
kube-scheduler                                                                                                                                    100%   40MB   4.2MB/s   00:09    
[root@k8s-master01 ~]# scp upgrade/master/kubernetes/server/bin/kube-proxy k8s-master02:/usr/local/bin/
kube-proxy  
五、啟動k8s-master02相關元件服務
### --- 啟動相關元件服務 

[root@k8s-master02 ~]# systemctl daemon-reload
[root@k8s-master02 ~]# systemctl restart kube-apiserver kube-controller-manager kube-scheduler kube-proxy
六、檢視k8s-master02相關元件版本
### --- 檢視相關元件版本

[root@k8s-master02 ~]# /usr/local/bin/kube-apiserver --version
Kubernetes v1.19.5
[root@k8s-master02 ~]# /usr/local/bin/kube-controller-manager --version
Kubernetes v1.19.5
[root@k8s-master02 ~]# /usr/local/bin/kube-scheduler --version
Kubernetes v1.19.5
[root@k8s-master02 ~]# /usr/local/bin/kube-proxy --version
Kubernetes v1.19.5








===============================END===============================


Walter 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



來自為知筆記(Wiz)