Kubernetes【升级】 CKS 2021【11】---Cluster Hardening - Upgrade Kubernetes
文章目录
- 1. 介绍
- 2. Practice - Create outdated cluster
- 3. Upgrade master node
- 4. Upgrade worker node
1. 介绍
2. Practice - Create outdated cluster
参考链接:
https://github.com/killer-sh/cks-course-environment/tree/master/cluster-setup/previous
# master
bash <(curl -s https://raw.githubusercontent.com/killer-sh/cks-course-environment/master/cluster-setup/previous/install_master.sh)# worker
bash <(curl -s https://raw.githubusercontent.com/killer-sh/cks-course-environment/master/cluster-setup/previous/install_worker.sh)
3. Upgrade master node
root@master:~/cks/create_cluster# k drain master --ignore-daemonsets
node/master cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/calico-node-ngbm8, kube-system/kube-proxy-lfkn9
node/master drained
root@master:~/cks/create_cluster# k get node
NAME STATUS ROLES AGE VERSION
master Ready,SchedulingDisabled control-plane,master 42h v1.20.1
node1 Ready <none> 42h v1.20.1
node2 Ready <none> 42h v1.20.1root@master:~/cks/create_cluster# apt-cache show kubeadm |grep -e '1.20'
Version: 1.20.2-00
Filename: pool/kubeadm_1.20.2-00_amd64_38fa4593055ef1161d4cb322437eedda95186fb850819421b8cf75f3a943dc51.deb
Version: 1.20.1-00
Filename: pool/kubeadm_1.20.1-00_amd64_7cd8d4021bb251862b755ed9c240091a532b89e6c796d58c3fdea7c9a72b878f.deb
Version: 1.20.0-00
Filename: pool/kubeadm_1.20.0-00_amd64_18afc5e3855cf5aaef0dbdfd1b3304f9e8e571b3c4e43b5dc97c439d62a3321a.debroot@master:~/cks/create_cluster# apt-get install kubeadm=1.20.2-00 kubectl=1.20.2-00 kubelet=1.20.2-00
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:rename
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:kubeadm kubectl kubelet
3 upgraded, 0 newly installed, 0 to remove and 146 not upgraded.
Need to get 34.5 MB of archives.
After this operation, 32.8 kB of additional disk space will be used.
Get:1 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 kubelet amd64 1.20.2-00 [18.9 MB]
Get:2 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 kubectl amd64 1.20.2-00 [7,940 kB]
Get:3 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 kubeadm amd64 1.20.2-00 [7,706 kB]
Fetched 34.5 MB in 7s (4,914 kB/s)
(Reading database ... 110090 files and directories currently installed.)
Preparing to unpack .../kubelet_1.20.2-00_amd64.deb ...
Unpacking kubelet (1.20.2-00) over (1.20.1-00) ...
Preparing to unpack .../kubectl_1.20.2-00_amd64.deb ...
Unpacking kubectl (1.20.2-00) over (1.20.0-00) ...
Preparing to unpack .../kubeadm_1.20.2-00_amd64.deb ...
Unpacking kubeadm (1.20.2-00) over (1.20.0-00) ...
Setting up kubelet (1.20.2-00) ...
Setting up kubectl (1.20.2-00) ...
Setting up kubeadm (1.20.2-00) ...root@master:~/cks/create_cluster# kubeadm upgrade plan
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.20.0
[upgrade/versions] kubeadm version: v1.20.2
I0426 23:07:55.970280 68360 version.go:251] remote version is much newer: v1.21.0; falling back to: stable-1.20
[upgrade/versions] Latest stable version: v1.20.6
[upgrade/versions] Latest stable version: v1.20.6
[upgrade/versions] Latest version in the v1.20 series: v1.20.6
[upgrade/versions] Latest version in the v1.20 series: v1.20.6Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT CURRENT AVAILABLE
kubelet 2 x v1.20.1 v1.20.61 x v1.20.2 v1.20.6Upgrade to the latest version in the v1.20 series:COMPONENT CURRENT AVAILABLE
kube-apiserver v1.20.0 v1.20.6
kube-controller-manager v1.20.0 v1.20.6
kube-scheduler v1.20.0 v1.20.6
kube-proxy v1.20.0 v1.20.6
CoreDNS 1.7.0 1.7.0
etcd 3.4.13-0 3.4.13-0You can now apply the upgrade by executing the following command:kubeadm upgrade apply v1.20.6Note: Before you can perform this upgrade, you have to update kubeadm to v1.20.6._____________________________________________________________________The table below shows the current state of component configs as understood by this version of kubeadm.
Configs that have a "yes" mark in the "MANUAL UPGRADE REQUIRED" column require manual config upgrade or
resetting to kubeadm defaults before a successful upgrade can be performed. The version to manually
upgrade to is denoted in the "PREFERRED VERSION" column.API GROUP CURRENT VERSION PREFERRED VERSION MANUAL UPGRADE REQUIRED
kubeproxy.config.k8s.io v1alpha1 v1alpha1 no
kubelet.config.k8s.io v1beta1 v1beta1 no
_____________________________________________________________________root@master:~/cks/create_cluster# kubeadm upgrade apply v1.20.6
root@master:~/cks/create_cluster# k get nodes
NAME STATUS ROLES AGE VERSION
master Ready,SchedulingDisabled control-plane,master 42h v1.20.2
node1 Ready <none> 42h v1.20.1
node2 Ready <none> 42h v1.20.1root@master:~/cks/create_cluster# k uncordon master
node/master uncordoned
root@master:~/cks/create_cluster# k get node
NAME STATUS ROLES AGE VERSION
master Ready control-plane,master 42h v1.20.2
node1 Ready <none> 42h v1.20.1
node2 Ready <none> 42h v1.20.1
4. Upgrade worker node
root@master:~/cks/create_cluster# k get node
NAME STATUS ROLES AGE VERSION
master Ready control-plane,master 42h v1.20.2
node1 Ready <none> 42h v1.20.1
node2 Ready <none> 42h v1.20.1root@master:~/cks/create_cluster# k drain node1 --ignore-daemonsets
node/node1 already cordonedroot@master:~/cks/create_cluster# k uncordon node1
node/node1 uncordonedroot@node1:~# kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:57:36Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}root@master:~/cks/create_cluster# apt-cache show kubeadm |grep -e '1.20'
Version: 1.20.2-00
Filename: pool/kubeadm_1.20.2-00_amd64_38fa4593055ef1161d4cb322437eedda95186fb850819421b8cf75f3a943dc51.deb
Version: 1.20.1-00
Filename: pool/kubeadm_1.20.1-00_amd64_7cd8d4021bb251862b755ed9c240091a532b89e6c796d58c3fdea7c9a72b878f.deb
Version: 1.20.0-00
Filename: pool/kubeadm_1.20.0-00_amd64_18afc5e3855cf5aaef0dbdfd1b3304f9e8e571b3c4e43b5dc97c439d62a3321a.debroot@master:~/cks/create_cluster# apt-get install kubeadm=1.20.2-00 kubectl=1.20.2-00 kubelet=1.20.2-00
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:rename
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:kubeadm kubectl kubelet
3 upgraded, 0 newly installed, 0 to remove and 146 not upgraded.
Need to get 34.5 MB of archives.
After this operation, 32.8 kB of additional disk space will be used.
Get:1 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 kubelet amd64 1.20.2-00 [18.9 MB]
Get:2 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 kubectl amd64 1.20.2-00 [7,940 kB]
Get:3 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 kubeadm amd64 1.20.2-00 [7,706 kB]
Fetched 34.5 MB in 7s (4,914 kB/s)
(Reading database ... 110090 files and directories currently installed.)
Preparing to unpack .../kubelet_1.20.2-00_amd64.deb ...
Unpacking kubelet (1.20.2-00) over (1.20.1-00) ...
Preparing to unpack .../kubectl_1.20.2-00_amd64.deb ...
Unpacking kubectl (1.20.2-00) over (1.20.0-00) ...
Preparing to unpack .../kubeadm_1.20.2-00_amd64.deb ...
Unpacking kubeadm (1.20.2-00) over (1.20.0-00) ...
Setting up kubelet (1.20.2-00) ...
Setting up kubectl (1.20.2-00) ...
Setting up kubeadm (1.20.2-00) ...root@node1:~# kubeadm version
root@node1:~# kubectl version
root@node1:~# kubelet version
root@master:~/cks/create_cluster# k get node
NAME STATUS ROLES AGE VERSION
master Ready control-plane,master 42h v1.20.2
node1 Ready <none> 42h v1.20.2
node2 Ready <none> 42h v1.20.1
root@master:~/cks/create_cluster# k uncordon node1
node/node1 uncordoned
Kubernetes【升级】 CKS 2021【11】---Cluster Hardening - Upgrade Kubernetes相关推荐
- Kubernetes CKS 2021【3】---Cluster Setup - Dashboard
Kubernetes 访问 Dashboard tags: Dashboard 文章目录 Kubernetes 访问 Dashboard 1. 简介 2. 默认 dashboard 权限 3. 验证 ...
- 从 Debian 10 (Buster) 升级到 Debian 11 (Bullseye)
从 Debian 10 (Buster) 升级到 Debian 11 (Bullseye) 经过 克林斯曼奥泰约 - 2021 年 9 月 6 日 7008 4 经过大约 2 年的开发,Debian ...
- aix升级新安装oracle,准备在AIX上安装或升级到Oracle 11.2.0.3的注意事项
准备在AIX上安装或升级到Oracle 11.2.0.3的注意事项 详见文档: Oracle Database Release Notes 11g Release 2 (11.2) for IBM A ...
- oracle10.2 迁移,实战:Oracle10.2.0.4异机迁移并升级到Oracle 11.2.0.4
环境: 源库:192.168.8.132 Oracle10.2.0.4 目标库:192.168.8.133 oracle11.2.0.4 OS:linux 5.4-64位 将原10G的库迁移到新主机 ...
- CCO x Hologres:实时数仓高可用架构再次升级,双11大规模落地
简介:本文将会介绍今年是如何在去年基础上进行实时数仓高可用架构升级,并成功大规模落地双11. 作者 | 梅酱 来源 | 阿里技术公众号 一 2021年双11总结 2021年阿里巴巴双11期间,由CCO ...
- 首页推荐流支持快捷修改兴趣标签,问答支持展示gif【2021.11.8】
hello,大家好,这里是「CSDN产品周报」第17期.本次更新主要涉及首页和问答两个产品模块,具体细节请往下看. 一.首页优化 1.「推荐」信息流新增「修改兴趣标签」按钮 从用户需求的角度考虑,对内 ...
- 【不忘初心】Win10_LTSC2021_19044.1381_X64_可更新[纯净精简版][2.52G](2021.11.20)
此版可正常更新补丁,母版来自UUP WIN10_LTSC2021 19044.1288集成补丁到19044.1381为了保证稳定初心的系统全部都是离线精简和优化,非二次封装.系统纯净.流畅.进程少无任 ...
- oracle10g升级教程,异机升级Oracle10R2 到11.2.0.4步骤
异机升级Oracle10R2 到11.2.0.4步骤 发布时间:2020-08-18 01:03:38 来源:ITPUB博客 阅读:103 作者:pingdanorcale 环境 目前环境10.2.0 ...
- 【不忘初心】Windows11 22000.318 X64 四合一[纯净精简版][2.62G](2021.11.10)
此版可正常更新补丁,WIN11全新的UI界面出炉!可以说这一次Windows 11全新升级,无论是从Logo上还是UI界面设计,都有很大的变化,母版来自UUP WIN11_22000.318,为了保证 ...
最新文章
- 一劳永逸,iOS 自定义 ActionSheet 封装流程
- centos 编译 mysql_centos 编译安装mysql
- java设计模式观察者模式_Java设计模式(9)——观察者模式
- OpenGL transformation变换的实例
- linux 配置apache的虚拟主机
- Android 8.0 新特性(一) - 可下载字体
- Latex如何在文本中插入数学符号
- numpy常用公式收集
- 用函数求出平均分、最高分和最低分
- 【术语】本地部署、云化部署、混合部署
- 通过付款码来区分是属于支付宝、微信、还是银行
- vectorvn1610报价_VECTORVN1610
- [物理学与PDEs]第4章习题1 反应力学方程组形式的化约 - 动量方程与未燃流体质量平衡方程...
- SLM—仿真过程与数据管理平台
- 一英寸芯片大小_芯片特征尺寸背后的秘密是什么
- java线程池使用详解
- Python 字典用法详解(超全)
- svga插件_svga动画插件,直播svga礼物展示
- 织梦/DedeCMS v5.5首页栏目添加广告的方法
- 目前python最新版本是什么,目前使用的python版本是