Cloud Native 13 min read

Step-by-Step Guide to Upgrading Kubernetes Nodes to v1.15.12

This tutorial walks you through downloading the latest Kubernetes packages, preparing master and node services, adjusting nginx proxy settings, cordoning and draining nodes, replacing binaries and certificates, restarting services, and verifying the upgrade across a two‑node cluster.

Raymond Ops
Raymond Ops
Raymond Ops
Step-by-Step Guide to Upgrading Kubernetes Nodes to v1.15.12

1. Download Software Packages

Download the latest Kubernetes packages from GitHub (e.g., https://github.com/...).

image
image

2. Upgrade Description

Upgrade includes master node and worker nodes, targeting version v1.15.12.

Master services: apiserver, controller‑manager, kube‑scheduler.

Node services: kubelet and kube‑proxy.

Because apiserver is behind nginx, comment out the upgraded node in the nginx upstream to avoid access issues.

Master and node run on the same server, so they are upgraded together.

3. Determine Node Upgrade Order

Check node information: kubectl get node Check pod distribution and choose the node with fewer pods for migration: kubectl get pod -o wide -n kube-system Since the distribution is similar, select the node on 10.4.7.21 for upgrade.

4. Modify nginx Proxy Configuration

Edit the nginx configuration on both 10.4.7.21 and 10.4.7.22, commenting out the apiserver entry for the node being upgraded (example for 10.4.7.21):

vim /etc/nginx/nginx.conf
upstream kube-apiserver {
    # server 10.4.7.21:6443 max_fails=3 fail_timeout=30s;
    server 10.4.7.22:6443 max_fails=3 fail_timeout=30s;
}
nginx -t
nginx -s reload

5. Delete First Node

Cordon the node to make it unschedulable: kubectl cordon hdss7-21.host.com Drain the node, evicting pods while ignoring daemonsets and forcing deletion of local data:

kubectl drain hdss7-21.host.com --delete-local-data --ignore-daemonsets --force

Explanation of flags: --delete-local-data removes emptyDir data, --ignore-daemonsets prevents daemonset pods from being recreated, and --force also removes pods not managed by a controller.

Verify pod distribution after draining: kubectl get pod -o wide -n kube-system Delete the node from the cluster:

kubectl delete node hdss7-21.host.com

6. Upgrade First Node

Extract the new version and replace binaries:

cd /opt/src/
 tar -zxvf kubernetes-server-linux-amd64-v1.15.12.tar.gz
 mv kubernetes /opt/kubernetes-v1.15.12
 cd /opt/kubernetes-v1.15.12/
 rm -f kubernetes-src.tar.gz
 cd server/bin/
 rm -f *.tar *_tag
 # list binaries to confirm
 ll

Copy certificates:

cp /opt/kubernetes/server/bin/certs/* certs/
 ls certs/

Copy startup scripts:

cp /opt/kubernetes/server/bin/*.sh .
 ls

Copy configuration files:

cp /opt/kubernetes/conf/* /opt/kubernetes-v1.15.12/conf/
 ls /opt/kubernetes-v1.15.12/conf/

Recreate the symlink for the Kubernetes directory:

cd /opt/
 rm -rf kubernetes
 ln -s /opt/kubernetes-v1.15.12 /opt/kubernetes
 ll

7. Restart Node Services

Check service status with supervisorctl: supervisorctl status Restart kubelet and kube‑proxy on the upgraded node:

supervisorctl restart kube-kubelet-7-21
supervisorctl restart kube-proxy-7-21

Verify the node version:

kubectl get node

8. Restart Master Services

supervisorctl restart kube-apiserver-7-21
supervisorctl restart kube-controller-manager-7-21
supervisorctl restart kube-scheduler-7-21

Monitor logs to ensure the services start without errors.

9. Upgrade Second Node

Repeat the same procedure on the remaining node (10.4.7.22). After completing the steps, verify service status and node versions:

supervisorctl status
kubectl get node

10. Restore nginx Proxy

Re‑edit the nginx upstream to include both servers:

vim /etc/nginx/nginx.conf
upstream kube-apiserver {
    server 10.4.7.21:6443 max_fails=3 fail_timeout=30s;
    server 10.4.7.22:6443 max_fails=3 fail_timeout=30s;
}
nginx -t
nginx -s reload

11. Test Platform

Open the Kubernetes dashboard to confirm all components are healthy (screenshots omitted for brevity).

12. Reallocate Pods

Delete a pod from the overloaded node (e.g., a coredns pod). The scheduler will recreate it on the less loaded node:

kubectl delete pod coredns-64f49f5655-smzzz -n kube-system

Observe the pod restarting on the other node.

image
image
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KubernetesNGINXCluster ManagementkubectlNode Upgrade
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.