instruction: Explain Deployment and orchestration
output: Back
  Ask AI
  Start typing to search or try
  Contact support
  Guides
  Get started
  Manuals
  Deployment and orchestration
  Explore the essentials of container orchestration with Docker.
  Deployment
  10 minutes
  Â« Back to all guides
  Deployment and orchestration
  Page options
  Copy page as Markdown for LLMs
  View page as plain text
  Ask questions with Docs AI
  Claude
  Open in Claude
  Containerization provides an opportunity to move and scale applications to
  clouds and data centers. Containers effectively guarantee that those applications run the
  same way anywhere, allowing you to quickly and easily take advantage of all
  these environments. Additionally, as you scale your applications up, you need some
  tooling to help automate the maintenance of those applications, enable the
  replacement of failed containers automatically, and manage the roll-out of
  updates and reconfigurations of those containers during their lifecycle.
  Tools to manage, scale, and maintain containerized applications are called
  orchestrators. Two of the most popular orchestration tools are Kubernetes and
  Docker Swarm. Docker Desktop provides development environments for both of these
  orchestrators.
  The advanced modules teach you how to:
  Set up and use a Kubernetes environment on your development machine
  Set up and use a Swarm environment on your development machine
  Turn on Kubernetes
  Docker Desktop sets up Kubernetes for you quickly and easily. Follow the setup and validation instructions appropriate for your operating system:
  Mac and Linux
  Windows
  From the Docker Dashboard, navigate to
  Settings
  , and select the
  Kubernetes
  tab.
  Select the checkbox labeled
  Enable Kubernetes
  , and select
  Apply
  . Docker Desktop automatically sets up Kubernetes for you. You'll know that Kubernetes has been successfully enabled when you see a green light beside 'Kubernetes
  running
  ' in
  Settings
  To confirm that Kubernetes is up and running, create a text file called
  pod.yaml
  with the following content:
  apiVersion
  kind
  metadata
  name
  demo
  spec
  containers
  name
  testpod
  image
  alpine:latest
  command
  "ping"
  "8.8.8.8"
  This describes a pod with a single container, isolating a simple ping to 8.8.8.8.
  In a terminal, navigate to where you created
  pod.yaml
  and create your pod:
  kubectl apply -f pod.yaml
  Check that your pod is up and running:
  kubectl get pods
  You should see something like:
  NAME READY STATUS RESTARTS AGE
  demo 1/1 Running
  Check that you get the logs you'd expect for a ping process:
  kubectl logs demo
  You should see the output of a healthy ping process:
  PING 8.8.8.8
  data bytes
  bytes from 8.8.8.8:
  time
  21.393 ms
  bytes from 8.8.8.8:
  time
  15.320 ms
  bytes from 8.8.8.8:
  time
  11.111 ms
  Finally, tear down your test pod:
  kubectl delete -f pod.yaml
  Windows
  From the Docker Dashboard, navigate to
  Settings
  , and select the
  Kubernetes
  tab.
  Select the checkbox labeled
  Enable Kubernetes
  , and select
  Apply
  . Docker Desktop automatically sets up Kubernetes for you. You'll know that Kubernetes has been successfully enabled when you see a green light beside 'Kubernetes
  running
  ' in the
  Settings
  menu.
  To confirm that Kubernetes is up and running, create a text file called
  pod.yaml
  with the following content:
  apiVersion
  kind
  metadata
  name
  demo
  spec
  containers
  name
  testpod
  image
  alpine:latest
  command
  "ping"
  "8.8.8.8"
  This describes a pod with a single container, isolating a simple ping to 8.8.8.8.
  In PowerShell, navigate to where you created
  pod.yaml
  and create your pod:
  kubectl apply -f pod.yaml
  Check that your pod is up and running:
  kubectl get pods
  You should see something like:
  NAME READY STATUS RESTARTS AGE
  demo 1/1 Running
  Check that you get the logs you'd expect for a ping process:
  kubectl logs demo
  You should see the output of a healthy ping process:
  PING 8.8.8.8
  data bytes
  bytes from 8.8.8.8:
  time
  21.393 ms
  bytes from 8.8.8.8:
  time
  15.320 ms
  bytes from 8.8.8.8:
  time
  11.111 ms
  Finally, tear down your test pod:
  kubectl delete -f pod.yaml
  Enable Docker Swarm
  Docker Desktop runs primarily on Docker Engine, which has everything you need to run a Swarm built in. Follow the setup and validation instructions appropriate for your operating system:
  Windows
  Open a terminal, and initialize Docker Swarm mode:
  docker swarm init
  If all goes well, you should see a message similar to the following:
  Swarm initialized: current node
  tjjggogqpnpj2phbfbz8jd5oq
  is now a manager.
  To add a worker to this swarm, run the following command:
  docker swarm join --token SWMTKN-1-3e0hh0jd5t4yjg209f4g5qpowbsczfahv2dea9a1ay2l8787cf-2h4ly330d0j917ocvzw30j5x9 192.168.65.3:2377
  To add a manager to this swarm, run
  'docker swarm join-token manager'
  and follow the instructions.
  Run a simple Docker service that uses an alpine-based filesystem, and isolates a ping to 8.8.8.8:
  docker service create --name demo alpine:latest ping 8.8.8.8
  Check that your service created one running container:
  docker service ps demo
  You should see something like:
  ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
  463j2s3y4b5o demo.1 alpine:latest docker-desktop Running Running
  seconds ago
  Check that you get the logs you'd expect for a ping process:
  docker service logs demo
  You should see the output of a healthy ping process:
  demo.1.463j2s3y4b5o@docker-desktop
  PING 8.8.8.8
  data bytes
  demo.1.463j2s3y4b5o@docker-desktop
  bytes from 8.8.8.8:
  time
  13.005 ms
  demo.1.463j2s3y4b5o@docker-desktop
  bytes from 8.8.8.8:
  time
  13.847 ms
  demo.1.463j2s3y4b5o@docker-desktop
  bytes from 8.8.8.8:
  time
  41.296 ms
  Finally, tear down your test service:
  docker service rm demo
  Windows
  Open a PowerShell, and initialize Docker Swarm mode:
  docker swarm init
  If all goes well, you should see a message similar to the following:
  Swarm initialized: current node
  tjjggogqpnpj2phbfbz8jd5oq
  is now a manager.
  To add a worker to this swarm, run the following command:
  docker swarm join --token SWMTKN-1-3e0hh0jd5t4yjg209f4g5qpowbsczfahv2dea9a1ay2l8787cf-2h4ly330d0j917ocvzw30j5x9 192.168.65.3:2377
  To add a manager to this swarm, run
  'docker swarm join-token manager'
  and follow the instructions.
  Run a simple Docker service that uses an alpine-based filesystem, and isolates a ping to 8.8.8.8:
  docker service create --name demo alpine:latest ping 8.8.8.8
  Check that your service created one running container:
  docker service ps demo
  You should see something like:
  ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
  463j2s3y4b5o demo.1 alpine:latest docker-desktop Running Running
  seconds ago
  Check that you get the logs you'd expect for a ping process:
  docker service logs demo
  You should see the output of a healthy ping process:
  demo.1.463j2s3y4b5o@docker-desktop
  PING 8.8.8.8
  data bytes
  demo.1.463j2s3y4b5o@docker-desktop
  bytes from 8.8.8.8:
  time
  13.005 ms
  demo.1.463j2s3y4b5o@docker-desktop
  bytes from 8.8.8.8:
  time
  13.847 ms
  demo.1.463j2s3y4b5o@docker-desktop
  bytes from 8.8.8.8:
  time
  41.296 ms
  Finally, tear down your test service:
  docker service rm demo
  Conclusion
  At this point, you've confirmed that you can run simple containerized workloads in Kubernetes and Swarm. The next step is to write a YAML file that describes how to run and manage these containers.
  Deploy to Kubernetes
  Deploy to Swarm
  CLI references
  Further documentation for all CLI commands used in this article are available here:
  kubectl apply
  kubectl get
  kubectl logs
  kubectl delete
  docker swarm init
  docker service *