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: ...

Get Mastering Docker - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.