Docker Desktop for Mac Kubernetes Installation¶
Docker Desktop for Mac Kubernetes Installation refers to the process of configuring a local Kubernetes cluster on macOS using the integrated environment provided by Docker Desktop. This setup allows developers to run a single-node cluster locally for development and testing purposes, avoiding the need for more complex infrastructure setup^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
Installation Overview¶
Docker Desktop provides a built-in Kubernetes feature that simplifies the creation of a local cluster^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]. This guide is applicable to environments such as Docker Desktop version 4.8.1 running Kubernetes v1.24.0 on macOS^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
Steps to Install¶
1. Install Docker Desktop¶
To begin, download the macOS installer from the official Docker documentation^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
- Download the
docker.dmgfile. - Drag the Docker icon into the Applications folder.
- Launch Docker.app to complete the installation^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
2. Enable Kubernetes¶
Once Docker Desktop is running, the Kubernetes cluster must be enabled through the application settings^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
- Open Docker Desktop and click the Settings (gear icon).
- Navigate to the Kubernetes tab.
- Check the box labeled Enable Kubernetes.
- Click Apply & Restart^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
This process triggers the download and initialization of necessary container images, which may take some time^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
3. Verify Status¶
After the initialization process completes, the Docker Desktop dashboard should display a green "running" status indicator for Kubernetes, and the associated Kubernetes containers will be visible within the application^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
Verification via CLI¶
Users can verify the cluster's health and version using the kubectl command-line tool^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
- Cluster Info: Run
kubectl cluster-infoto display the cluster service addresses^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]. - Nodes: Run
kubectl get nodesto list the available nodes in the cluster^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md]. - Version: Run
kubectl version --shortto check the version of the Kubernetes client and server^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].
Context¶
Using a local Kubernetes environment is a standard practice in modern backend development. It allows developers to manage the complexity of distributed systems—ranging from various web frameworks and databases to load balancing and auto-scaling—using a platform that sits above simple containerization^[400-devops__06-Kubernetes__k8s-ithelp__Day4__README.md].