Monday 18 April 2022

CKA Kubernetes ( K8S ) Cluster Maintenance

 The preparation for the CKA (Certified Kubernetes Administrator) requires lots of practice and practice. Fortunately, we have lots of online playgrounds to keep practicing, there are lots of free courseware available and lots of paid as well are available. In addition to that, we get two attempts to clear the exam




In the CKA exam definitely we can expect questions on the cluster maintenance, also this will be high score question. So if we practice well on this then we can save time and score high on these questions.

OS Upgrades

• When a node in the cluster is brought down then the pods inside will become inaccessible
• The pods will be accessible again if the node comes back within 5 mins
• Same way to do is
○ kubectl drain node01 -> This will move the pods to a different node and mark the node as cordon which means no new scheduling of pod can happen in this node
○ kubectl uncordon node01 -> after the OS upgrade, the node should be uncordon so scheduling of pod can happen in this node
○ kubectl cordon node01 -> Like without draining the pod, we can simply mark as cordon so no new scheduling happens here

Kubernetes release

• The versioning is v1.13.0 -> major.minor.bug_fixes
• https://github.com/kubernetes/kubernetes
• Only latest 3 versions of k8s will be supported and the older releases will become unsupported
• When master node is upgraded the control plane component is not accessible
• Upgrade Strategy to worker node
○ All at once - will have a down time
○ Rolling updates 
○ Bring new nodes with new version and remove old nodes

Backup and Restore

• Can take backup in three different ways
○ Resource Configuration
§ kubectl get all -A -o yaml > all-resources.yaml
§ There are tools like ARK / Velero
○ ETCD 
§ the storage directory can be backed up as it is
§ ETCD comes up with its snapshot tool
§ export ETCDCTL_API=3
§ etcdctl snapshot save snapshot.db
§ service kube-apiserver stop
§ etcdctl snapshot restore snapshot.db
§ systemctl daemon-reload
§ service etcd restart
§ service kube-apiserver start

No comments:

Post a Comment