You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This lab tests your skills on upgrading a kubernetes cluster. We have a production cluster with applications running on it. Let us explore the setup first.
What is the current version of the cluster?
controlplane $ kubectl get node
NAME STATUS ROLES AGE VERSION
controlplane Ready master 8m11s v1.18.0
node01 Ready <none> 7m39s v1.18.0
How many nodes can host workloads in this cluster?
Inspect the applications and taints set on the nodes.
You are tasked to upgrade the cluster. User's accessing the applications must not be impacted. And you cannot provision new VMs. What strategy would you use to upgrade the cluster?
Upgrade one node at a time while moving workloads to other.
What is the latest stable version available for upgrade?
Use kubeadm tool
controlplane $ kubeadm upgrade plan
.
COMPONENT CURRENT AVAILABLE
API Server v1.18.0 v1.18.15
Controller Manager v1.18.0 v1.18.15
Scheduler v1.18.0 v1.18.15
Kube Proxy v1.18.0 v1.18.15
CoreDNS 1.6.7 1.6.7
Etcd 3.4.3 3.4.3-0
You can now apply the upgrade by executing the following command:
kubeadm upgrade apply v1.18.15
We will be upgrading the master node first. Drain the master node of workloads and mark it UnSchedulable
controlplane $ kubectl drain controlplane --ignore-daemonsets
node/controlplane cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/kube-flannel-ds-amd64-4plkl, kube-system/kube-keepalived-vip-vff7m, kube-system/kube-proxy-h9bcg
evicting pod default/blue-8455cd8cd7-tmsvk
evicting pod default/blue-8455cd8cd7-fqsz8evicting pod default/blue-8455cd8cd7-hdvjv
evicting pod default/blue-8455cd8cd7-lcbgc
evicting pod default/red-59d898f784-t5src
evicting pod default/blue-8455cd8cd7-wd8g8
evicting pod default/red-59d898f784-blfx7
evicting pod kube-system/coredns-66bff467f8-87kss
evicting pod kube-system/coredns-66bff467f8-sfv25
evicting pod kube-system/katacoda-cloud-provider-69dc659fc-2z6l2
I0122 15:40:56.209205 8518 request.go:621] Throttling request took 1.171958663s, request: GET:https://172.17.0.46:6443/api/v1/namespaces/default/pods/blue-8455cd8cd7-hdvjv
pod/katacoda-cloud-provider-69dc659fc-2z6l2 evicted
pod/blue-8455cd8cd7-lcbgc evicted
pod/blue-8455cd8cd7-tmsvk evictedpod/red-59d898f784-blfx7 evicted
pod/red-59d898f784-t5src evicted
pod/blue-8455cd8cd7-wd8g8 evicted
pod/blue-8455cd8cd7-fqsz8 evicted
pod/blue-8455cd8cd7-hdvjv evicted
pod/coredns-66bff467f8-87kss evicted
pod/coredns-66bff467f8-sfv25 evicted
node/controlplane evicted
controlplane $
Upgrade the master/controlplane components to exact version v1.19.0
Upgrade kubeadm tool (if not already), then the master components, and finally the kubelet.
Practice referring to the kubernetes documentation page.
Note: While upgrading kubelet, if you hit dependency issue while running the apt-get upgrade kubelet command, use the apt install kubelet=1.19.0-00 command instead