We use optional first-party traffic analytics to improve the blog. You can accept or decline — nothing is measured before you choose.

Privacy policy

Skip to content
NyverraNyverra
⌘K
HomeArticlesCorporate site
🇺🇸
Nyverra

Editorial channel

Articles on technology, operations and partners — infrastructure, monitoring and critical environments.

Social media

Explore

  • Home
  • Articles
  • Categories
  • Tags
  • Authors
  • About
  • Contact
  • RSS
  • Corporate site

Nyverra

  • Our services
  • Case studies
  • Partners

Contact

Email[email protected]WhatsApp(62) 99309-1592Client portalITSM · tickets and SLA

Rua RB 18, S/N — Casa 01, Sala 01 · Residencial Buriti · Senador Canedo – GO, Brazil · ZIP 75260-459

Hours: Mon–Fri, 8am–6pm

© 2026 Nyverra. All rights reserved.

CNPJ: 61.571.209/0001-08 · State registration: 20.291.265-5 · D-U-N-S®: 57-323-5796

blog.nyverra.com.br

Terms of usePrivacyCookies
Back to top
  1. Home
  2. Kubernetes
  3. Kubernetes Course 20 — Safe Node Upgrades
Kubernetes
#Curso Kubernetes#Kubernetes#K8S

Kubernetes Course 20 — Safe Node Upgrades

Wedson LopesWedson Lopes
31 de outubro de 20264 min de leitura

Every cluster needs maintenance: update the OS, the kubelet, increase RAM, replace disks. The difference between a smooth window and an incident is the process.

This chapter closes Season 2 with the upgrade we actually did: workers from 8 GiB to 16 GiB.

Course seal: tested on Kubernetes 1.35 and Ubuntu 24.04.

Before touching any node

Pre-flight checklist:

  • Free capacity on other nodes to receive pods.
  • PDBs for critical workloads.
  • Anti-affinity (databases, Elasticsearch, RabbitMQ).
  • Quorum (etcd, RabbitMQ, Redis Sentinel).
  • Node-local storage (local-path) and PVCs.
  • DaemonSets that need to run on the node.
  • Recent backup and tested restore.
kubectl get nodes -o wide
kubectl top nodes
kubectl get pdb -A
kubectl get pods -A -o wide | grep <node>

The process, one node at a time

1. Cordon

kubectl cordon k8s-worker-01

No new pods are scheduled there; existing ones continue.

2. Drain

kubectl drain k8s-worker-01 --ignore-daemonsets --delete-emptydir-data

The drain respects PDBs. If it gets stuck, do not use --force without understanding: find out which PDB is blocking.

kubectl get pdb -A
kubectl describe pdb <pdb>

3. Validate rescheduling

kubectl get pods -A -o wide | grep -v Running
kubectl -n <ns> get pods -o wide

Pods with mandatory anti-affinity may stay Pending until the node returns. It's expected — but you need to know which ones.

4. Shut down/update

  • Increase RAM on the VM/host.
  • Update the OS and kubelet, if applicable.
  • Reboot.

5. Bring up and uncordon

kubectl uncordon k8s-worker-01
kubectl get nodes
kubectl get pods -A -o wide | grep k8s-worker-01

6. Validate before the next one

  • Nodes Ready.
  • Critical workloads healthy.
  • Quorum restored.
  • PDBs with allowed disruptions.
  • Metrics without anomalies.

Order matters

In a cluster with data:

  1. Node without database/state first.
  2. Replicas before the primary.
  3. Primary last (with planned failover).
  4. Never two nodes at the same time.

In our case, the worker with the Postgres primary was the last one.

What went wrong in our upgrade

  • MinIO all on one node. All 4 pods were on the same worker; draining that node would bring down the object storage. We moved the pods beforehand (cordon + recycling), but found the image was not cached on another node — ErrImagePull.
  • MinIO PDB minAvailable: 3. Draining a node with 2 pods violated the PDB. We temporarily adjusted it to 2.
  • Postgres primary on the node. The drain required failover; the primary PDB was blocking. We performed a controlled failover beforehand.
  • Pods Pending due to anti-affinity. With one node down, Elasticsearch and RabbitMQ could not maintain 3 replicas. Expected; we documented it.
  • Aggressive HPA. In another incident, 10 backend pods stressed memory and brought down Postgres. Capacity is not just CPU.

Kubernetes version upgrade

For the kubelet:

kubectl drain <node> --ignore-daemonsets --delete-emptydir-data
sudo apt-mark unhold kubeadm kubelet kubectl
sudo apt install -y kubeadm=1.35.x-1.1 kubelet=1.35.x-1.1 kubectl=1.35.x-1.1
sudo kubeadm upgrade node
sudo systemctl restart kubelet
kubectl uncordon <node>

Masters first (one at a time), then workers. Never skip minor versions.

Common errors

Symptom Cause
Drain stuck PDB with no disruptions
Pods Pending after drain anti-affinity/capacity
local-path PVC stuck volume is from old node
DaemonSet missing taint without toleration
Postgres without quorum primary/replica on same node
Node does not return Ready kubelet/CNI/clock
HPA scales too much memory budget ignored

Checklist

  • [ ] Capacity on remaining nodes.
  • [ ] PDBs reviewed.
  • [ ] Anti-affinity/quorum mapped.
  • [ ] Recent backup.
  • [ ] Cordon + drain + validation.
  • [ ] One node at a time.
  • [ ] Uncordon and validation before the next.
  • [ ] PDBs restored to original value.

Glossary

  • cordon: prevents new pods on the node.
  • drain: evicts pods from the node.
  • uncordon: frees the node.
  • eviction: removal respecting PDB.
  • quorum: majority for consensus.
  • anti-affinity: distribution rule.

Next

Season 2 concluded. In Season 3, we will package the application with Helm, version it in GitOps, set up CI/CD, harden security, measure capacity, and close with SLO and DR.

Next: Kubernetes Course 21 — Helm: packaging the application

Share

Keep reading

Read also

  • Kubernetes Course 21 — Helm: Packaging the Application
    Kubernetes

    Kubernetes Course 21 — Helm: Packaging the Application

    Charts, values, templating, and hooks: how to move away from kubectl apply -f and version the application deployment as a real package.

    31 de outubro de 20264 min de leitura
  • Kubernetes Course 19 — Backup and Restore: Velero, etcd, and Drill
    Kubernetes

    Kubernetes Course 19 — Backup and Restore: Velero, etcd, and Drill

    A backup that has never been restored is not a backup. Etcd, Velero, logical dumps, and a drill with measured RPO/RTO.

    31 de outubro de 20263 min de leitura
  • Kubernetes Course 22 — GitOps with ArgoCD
    Kubernetes

    Kubernetes Course 22 — GitOps with ArgoCD

    Git as source of truth: Application, syncPolicy, self-heal, prune, and what to do when the cluster and the repository disagree.

    31 de outubro de 20264 min de leitura

Nyverra

Need specialist help?

  • Infrastructure services
  • Case studies
  • Partners

Comments

No comments yet

Be the first to share your thoughts on this article.

Leave a comment

Newsletter

Get new articles

Subscribe to receive Nyverra blog posts in your inbox. We will send a confirmation link.

​