Skip to content

Commit 46ffae6

Browse files
author
sangam14
committed
update
1 parent d3b5795 commit 46ffae6

File tree

2 files changed

+93
-1
lines changed

2 files changed

+93
-1
lines changed

content/docs/kubernetes/etcd-backup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "etcd Backup and Restore"
33
description: "etcd Backup and Restore"
4-
weight: 5
4+
weight: 6
55
---
66

77

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: "kubeadm upgrade & downgrade "
3+
description: " Perform Version Upgrades on a Kubernetes Cluster using kubeadm"
4+
weight: 5
5+
---
6+
7+
8+
Perform Version Upgrades on a Kubernetes Cluster using kubeadm
9+
10+
Upgrading a Kubernetes cluster involves updating its core components, which include the Kubernetes API Server, Scheduler, Controller Manager, etcd, and Kubelets. Kubeadm simplifies this process by managing the container versions of these control plane components. Additional tasks such as renewing certificates and updating kubelet configurations are also handled by Kubeadm, utilizing the kubeadm upgrade commands.
11+
12+
When planning an upgrade, you must first decide on the target version. Updates to major APIs typically accompany minor version releases (e.g., from 1.25 to 1.26), while patch releases (e.g., 1.26.0 to 1.26.1) focus on fixes and security enhancements. It's important to note that Kubeadm supports upgrading only one minor version at a time. For instance, to upgrade from version 1.24 to 1.26, you must first upgrade to 1.25 and then proceed to 1.26. The version of the kubeadm tool itself dictates the highest Kubernetes version to which you can upgrade (e.g., kubeadm 1.25.0 cannot upgrade a cluster to Kubernetes 1.26.0).
13+
14+
The upgrade process of the control-plane node involves several key steps:
15+
1. Obtain the latest Kubernetes binaries.
16+
2. Install the newer kubeadm version.
17+
3. Use kubeadm upgrade plan to review and acquire the latest versions of the control plane components.
18+
4. Execute the upgrade.
19+
5. Update the kubelet and kubectl installations on the node.
20+
21+
During the upgrade, it may be necessary to drain the node of reschedulable workloads using `kubectl drain`, ensuring to uncordon the node afterward with `kubectl uncordon` to allow workloads to return.
22+
23+
Here's how to upgrade a Kubernetes control plane node from v1.25.0 to v1.26.0 on Ubuntu 20.04:
24+
- Begin by updating the apt repository.
25+
26+
```
27+
28+
$ sudo apt update
29+
30+
sudo apt install kubeadm=1.26.0-00
31+
32+
```
33+
34+
### check upgrade plan
35+
36+
37+
```
38+
sudo kubeadm upgrade plan
39+
40+
Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
41+
COMPONENT CURRENT AVAILABLE
42+
kubelet 1 x v1.25.0 v1.26.0
43+
44+
Upgrade to the latest stable version:
45+
46+
COMPONENT CURRENT AVAILABLE
47+
kube-apiserver v1.25.0 v1.26.0
48+
kube-controller-manager v1.25.0 v1.26.0
49+
kube-scheduler v1.25.0 v1.26.0
50+
kube-proxy v1.25.0 v1.26.0
51+
CoreDNS 1.6.7 1.7.0
52+
etcd 3.5.3-0 3.5.5-1
53+
54+
You can now apply the upgrade by executing the following command:
55+
kubeadm upgrade apply v1.26.0
56+
57+
Note: Before you can perform this upgrade, you have to update kubeadm to v1.26.0.
58+
59+
_____________________________________________________________________
60+
61+
62+
The table below shows the current state of component configs as understood by this version of kubeadm.
63+
Configs that have a "yes" mark in the "MANUAL UPGRADE REQUIRED" column require manual config upgrade or
64+
resetting to kubeadm defaults before a successful upgrade can be performed. The version to manually
65+
upgrade to is denoted in the "PREFERRED VERSION" column.
66+
67+
API GROUP CURRENT VERSION PREFERRED VERSION MANUAL UPGRADE REQUIRED
68+
kubeproxy.config.k8s.io v1alpha1 v1alpha1 no
69+
kubelet.config.k8s.io v1beta1 v1beta1 no
70+
_____________________________________________________________________
71+
72+
```
73+
### use upgrade command
74+
75+
```
76+
sudo kubeadm upgrade apply v1.26.0
77+
78+
[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.26.0". Enjoy!
79+
80+
[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets if you haven't already done so.
81+
82+
```
83+
84+
##### update to desire version
85+
86+
```
87+
88+
sudo apt install kubelet=1.26.0-00 kubectl=1.26.0-00
89+
90+
Setting up kubelet (1.26.0-00) ...
91+
Setting up kubectl (1.26.0-00) ...
92+
```

0 commit comments

Comments
 (0)