Kubernetes Basics - Node Commands

Essential commands for working with Kubernetes nodes

Get Nodes

kubectl get nodes

Displays a list of all nodes in the Kubernetes cluster.

Usage:

Use this command to see all nodes in your cluster, their status, roles, age, and Kubernetes version.

Example Output:

NAME             STATUS   ROLES           AGE   VERSION
docker-desktop   Ready    control-plane   45d   v1.27.2

Get Nodes (Wide Output)

kubectl get nodes -o wide

Shows detailed information about nodes including internal IPs and OS information.

Additional Information:

  • INTERNAL-IP → The internal IP address of the node
  • EXTERNAL-IP → The external IP address (if available)
  • OS-IMAGE → Operating system running on the node
  • KERNEL-VERSION → Kernel version of the node
  • CONTAINER-RUNTIME → Container runtime (Docker, containerd, etc.)

Describe Node

kubectl describe node [node-name]

Shows detailed information about a specific node.

Example:

kubectl describe node docker-desktop

This command provides comprehensive details about the specified node.

Information Provided:

  • Node conditions and status
  • Capacity and allocatable resources
  • System information
  • Pods running on the node
  • Events related to the node

About Kubernetes Nodes

What is a Node?

A node is a worker machine in Kubernetes, previously known as a minion. A node may be a VM or physical machine, depending on the cluster. Each node contains the services necessary to run pods and is managed by the control plane.

Nodes are the fundamental building blocks of a Kubernetes cluster where containerized applications run.

Node Components

  • kubelet - An agent that runs on each node
  • kube-proxy - Network proxy that maintains network rules
  • Container Runtime - Software responsible for running containers
  • Node Resources - CPU, memory, and storage available on the node

Node Status

A node's status contains the following information:

  • Addresses - Hostname, internal IP, external IP
  • Conditions - OutOfDisk, Ready, MemoryPressure, PIDPressure, DiskPressure, NetworkUnavailable
  • Capacity and Allocatable - Describes resources available on the node
  • Info - General information about the node