![](/uploads/1/2/5/8/125806353/619659452.jpg)
Docker Desktop for Mac and Docker Desktop for Windows provide a standalone Kubernetes server that runs on your development machine, with kubectl installed by default. This installation is separate from the Kubernetes deployment on a UCP cluster. Kubernetes being a standard of deploying cloud applications, let’s try to use this embedded Kubernetes directly provided by Docker Desktop instead of using another Kubernetes installation like by installing minikube. First, check that a recent version of Docker Desktop is installed. Click on the whale in status bar and click on About Docker menu.
Estimated reading time: 3 minutes Docker Desktop includes a standalone Kubernetes server and client,as well as Docker CLI integration. The Kubernetes server runs locally withinyour Docker instance, is not configurable, and is a single-node cluster.
The Kubernetes server runs within a Docker container on your local system, andis only for local testing. When Kubernetes support is enabled, you can deployyour workloads, in parallel, on Kubernetes, Swarm, and as standalone containers.Enabling or disabling the Kubernetes server does not affect your otherworkloads.
See Docker Desktop for Mac > Getting started toenable Kubernetes and begin testing the deployment of your workloads onKubernetes.
Use Docker commands
You can deploy a stack on Kubernetes with
docker stack deploy
, thedocker-compose.yml
file, and the name of the stack.You can see the service deployed with the
kubectl get services
command.Specify a namespace
By default, the
default
namespace is used. You can specify a namespace withthe --namespace
flag.Run
kubectl get services -n my-app
to see only the services deployed in themy-app
namespace.Override the default orchestrator
While testing Kubernetes, you may want to deploy some workloads in swarm mode.Use the
DOCKER_STACK_ORCHESTRATOR
variable to override the default orchestrator fora given terminal session or a single Docker command. This variable can be unset(the default, in which case Kubernetes is the orchestrator) or set to swarm
orkubernetes
. The following command overrides the orchestrator for a singledeployment, by setting the variableat the start of the command itself.Alternatively, the
--orchestrator
flag may be set to swarm
or kubernetes
when deploying to override the default orchestrator for that deployment.Note: Deploying the same app in Kubernetes and swarm mode may lead toconflicts with ports and service names.
![For For](/uploads/1/2/5/8/125806353/993139347.png)
Use the kubectl command
The mac Kubernetes integration provides the Kubernetes CLI commandat
/usr/local/bin/kubectl
. This location may not be in your shell’s PATH
variable, so you may need to type the full path of the command or add it tothe PATH
. For more information about kubectl
, see theofficial kubectl
documentation.You can test the command by listing the available nodes:Example app
Docker has created the following demo app that you can deploy to swarm mode orto Kubernetes using the
docker stack deploy
command.If you already have a Kubernetes YAML file, you can deploy it using the
mac, edge, kubernetes, kubectl, orchestrationkubectl
command.![](/uploads/1/2/5/8/125806353/619659452.jpg)