Running Kubernetes Locally

Step-by-step guide to setting up Kubernetes with Docker Desktop and learning essential kubectl commands for container orchestration.

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:

1

Open Docker Desktop

Launch Docker Desktop on your system.

2

Access Settings

Click on the ⚙️ Settings (or Preferences on macOS).

3

Navigate to Kubernetes Tab

Go to the Kubernetes section in the settings menu.

4

Enable Kubernetes

Check the "Enable Kubernetes" option.

Optional: Check "Show system containers (advanced)" if you want to see Kubernetes system pods.

5

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