Getting Started with Kubernetes
Kubernetes is a powerful container orchestration platform that automates the deployment, scaling, and management of containerized applications. This guide will help you set up a local Kubernetes environment using Docker Desktop and learn essential commands.
Enable Kubernetes in Docker Desktop
Follow these steps to set up a single-node Kubernetes cluster using Docker Desktop:
Open Docker Desktop
Launch Docker Desktop on your system.
Access Settings
Click on the ⚙️ Settings (or Preferences on macOS).
Navigate to Kubernetes Tab
Go to the Kubernetes section in the settings menu.
Enable Kubernetes
Check the "Enable Kubernetes" option.
Optional: Check "Show system containers (advanced)" if you want to see Kubernetes system pods.
Apply Changes
Click "Apply & Restart". Docker Desktop will download Kubernetes components and start a single-node cluster.
Note:
The initial setup may take several minutes as Docker Desktop downloads the necessary Kubernetes components. Once completed, you'll have a fully functional local Kubernetes cluster.
Essential Kubernetes Commands
Cluster Information
kubectl cluster-info
Display cluster information
kubectl get nodes
List all nodes in the cluster
kubectl version
Show Kubernetes client and server version