Harness the Power of Kubernetes with Docker Desktop
Guide to K8s deployment using docker
Introduction
Docker Desktop, a robust tool for containerization, extends its capabilities by integrating a standalone Kubernetes server and client. This feature streamlines the deployment process and allows users to test their workloads locally. In this blog post, we’ll explore the seamless integration of Docker Desktop with Kubernetes, providing a step-by-step guide to enable and disable Kubernetes, along with essential commands for efficient deployment.
Enabling Kubernetes on Docker Desktop
Turning on Kubernetes
- Navigate to the Docker Dashboard and select “Settings.”
- In the left sidebar, click on “Kubernetes.”
- Check the “Enable Kubernetes” checkbox.
- Click “Apply & Restart” to save the settings and install the necessary images for the Kubernetes server.
Once enabled, Kubernetes runs locally within your Docker instance, offering a single-node cluster for efficient local testing. It operates within a Docker container on your machine and doesn’t impact other workloads.
Monitoring Kubernetes Status
After enabling Kubernetes, a dedicated status bar appears in the Docker Dashboard footer and Docker menu. This visual cue provides real-time information about the Kubernetes server’s status.
Note: Docker Desktop doesn’t automatically upgrade the Kubernetes cluster with each update. To ensure you have the latest version, you can manually reset the Kubernetes cluster.
Interacting with Kubernetes Using kubectl
Configuring kubectl
Docker Desktop integrates the Kubernetes CLI command at /usr/local/bin/kubectl
on Mac and C:\Program Files\Docker\Docker\Resources\bin\kubectl.exe
on Windows. For Linux users, the kubectl binary is not included, and manual installation is required.
To use kubectl:
- If not in your shell’s PATH, type the full path or add it to the PATH variable.
- Ensure kubectl points to
docker-desktop
by running:
$ kubectl config get-contexts
$ kubectl config use-context docker-desktop
Tip: Run the kubectl command in a CMD or PowerShell terminal to avoid empty results in
kubectl config get-contexts
. If issues persist, set thekubeconfig
environment variable to the location of the.kube/config
file.
Verifying Kubernetes Setup
Test your kubectl setup by listing available nodes:
$ kubectl get nodes
The output should display information about the Docker Desktop node, indicating its status, roles, age, and version.
For more in-depth information about kubectl commands, refer to the kubectl documentation.
Disabling Kubernetes on Docker Desktop
Turning off Kubernetes
- In the Docker Dashboard, select the Settings icon.
- Navigate to “Kubernetes” in the left sidebar.
- Uncheck the “Enable Kubernetes” checkbox.
- Click “Apply & Restart” to save the settings.
Disabling Kubernetes stops and removes Kubernetes containers and removes the kubectl command from your machine.
Conclusion

Docker Desktop’s seamless integration with Kubernetes enhances your containerization workflow, enabling local testing and deployment. By following these steps, you can effortlessly harness the power of Kubernetes for efficient container orchestration. Whether you are a seasoned developer or new to containerization, Docker Desktop provides a user-friendly interface for managing Kubernetes, empowering you to build and deploy containerized applications with ease.
Liked the author? Connect with Khushiyant
Let’s be friends! You can find me on Twitter, and LinkedIn. Interested in having me speak at your event? Comment Below or mail me at khushiyant2002@gmail.com