O'Reilly logo

Mastering Docker - Third Edition by Scott Gallagher, Russ McKendrick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Kubernetes and other Docker tools

When we enabled Kubernetes, we selected Kubernetes as the default orchestrator for Docker stack commands. In the previous chapter, the Docker stack command would launch our Docker Compose files in Docker Swarm. The Docker Compose we used looked like the following:

version: "3"services:  cluster:    image: russmckendrick/cluster    ports:      - "80:80"    deploy:      replicas: 6      restart_policy:        condition: on-failure      placement:        constraints:          - node.role == worker

Before we launch the application on Kubernetes, we need to make a slight adjustment and remove the placement, which leaves our file looking like the following:

version: "3"services:  cluster:    image: russmckendrick/cluster    ports:      - "80:80"    deploy:      replicas: 6 restart_policy: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required