Labs ICT
Pro Login

Nodes

The worker machines that run your containers

Nodes — The Worker Machines

A Node is a physical or virtual machine that runs your containers. Every cluster has at least one node. Nodes are the workers where the actual work happens.

Each node runs the components needed to host pods: kubelet, kube-proxy, and a container runtime.

Node Components


  ┌──────────────────────────────────────────┐
  │                Node                      │
  │  ┌────────────┐  ┌────────────────────┐ │
  │  │   kubelet  │  │    kube-proxy      │ │
  │  │ (agent)    │  │ (network rules)    │ │
  │  └──────┬─────┘  └────────────────────┘ │
  │         │                                │
  │  ┌──────┴──────────────────────────────┐ │
  │  │        Container Runtime            │ │
  │  │   (containerd, CRI-O, etc.)         │ │
  │  └─────────────────────────────────────┘ │
  │  ┌──────────┐  ┌──────────┐             │
  │  │  Pod A   │  │  Pod B   │             │
  │  └──────────┘  └──────────┘             │
  └──────────────────────────────────────────┘

kubelet — The node agent. It watches the API server for pods assigned to this node and ensures the containers in those pods are running and healthy.

kube-proxy — Maintains network rules that allow traffic to reach your pods. It implements Services by forwarding connections to the correct pod.

Container Runtime — The software that actually runs containers. Kubernetes supports any runtime that implements the CRI (Container Runtime Interface).

Node Status

When you run kubectl get nodes, you will see a STATUS column. Common statuses include:

Ready — The node is healthy and ready to accept pods.

NotReady — The node is not healthy. Pods will not be scheduled here.

SchedulingDisabled — The node is cordoned off and no new pods will be placed on it.

Node Labels and Taints


# Add a label to a node
kubectl label node node1 disktype=ssd

# Use the label in a pod spec
apiVersion: v1
kind: Pod
metadata:
  name: gpu-pod
spec:
  nodeSelector:
    disktype: ssd
  containers:
    - name: app
      image: my-app

# Taint a node (repel pods without matching tolerations)
kubectl taint nodes node1 key=value:NoSchedule

Labels let you select which nodes a pod can run on. Taints do the opposite — they repel pods unless the pod explicitly tolerates the taint.

Managing Nodes


# List all nodes
kubectl get nodes

# Get detailed info about a node
kubectl describe node node1

# Drain a node (move pods off before maintenance)
kubectl drain node1 --ignore-daemonsets

# Uncordon a node (make it schedulable again)
kubectl uncordon node1

# Delete a node from the cluster
kubectl delete node node1