Deploying A Sample Voting Application
Let’s deploy a more complex application – the classic Docker sample voting app – to further explore Docker Desktop’s capabilities.
Step 1: Enable Kubernetes In Docker Desktop
- Navigate to Docker Desktop settings.
- Click on “Kubernetes”
- Check the “Enable Kubernetes” checkbox.
Step 2: Verify Kubernetes Cluster
- Check the state of your Docker Desktop cluster with the following command.
kubectl get nodes
Step 3: Run The Voting App
- Deploy the sample voting app:
kubectl apply -f https://raw.githubusercontent.com/docker/docker-birthday/master/resources/kubernetes-docker-desktop/vote.yaml
Step 4: Check App Components
- Check the pods for the voting app with the following command:
kubectl -n vote get pods
Step 5: Use the App
- Access the voting app in your browser at http://localhost:5000
- Vote for Cats or Dogs, and check the results at http://localhost:5001
Step 6: Check Resilience
- Test Kubernetes’ resilience by removing a container with following command.
- Observe that Kubernetes replaces the removed container.
docker container rm -f $(docker container ls -f name='k8s_result*' --format '{{.ID}}')
Step 7: Teardown Your Environment
Reset your Kubernetes cluster and remove the demo app:
- Open Docker Desktop settings.
- Click on “Kubernetes.”
- Click the “Reset Kubernetes Cluster” button.
How To Use Docker Desktop To Deploy Kubernetes Clusters ?
Docker Desktop has revolutionized local development environments by seamlessly integrating Kubernetes, a powerful container orchestration platform. This article gives an idea of how to use Docker Desktop to deploy Kubernetes clusters, which also includes step-by-step instructions and troubleshooting advice. This thorough instruction will enable you to fully utilize Kubernetes on your local system, regardless of your level of experience with containerization.