A guide on how to deploy to Swarm cluster and some sample deployment scripts.
Docker Swarm is the choice for PaaS so that developers don't have to worry about the state of their applications and not of the infrastructure. The platform provides you integrated:
- Deploying and scaling applications
- Logging
- Your application can be containerized.
- A Dockerfile is available to package the application as a Docker image.
- A Docker Hub account to push Docker images.
- Application Docker image has been pushed to Docker hub.
- Have your application manifest ready according to Docker stack YAML.
NOTE: At the moment, deployment to Swarm is manual only. Integration with Concourse is WIP.
-
Find out the Swarm Masters' IP and ports (from DevOps Team), say
10.2.3.4
. -
SSH to the Swarm master and copy your stack yaml (and other config files, if any) on the master in a temporary directory.
-
Assuming Docker stack YAML (and other configuration files) is present at
/tmp/
on Swarm master and stack configuration is inmyapp-stack.yml
, run following command to deploy stack to Swarm:export STACK_NAME="myapp-stack" cd /tmp docker stack deploy $STACK_NAME -c myapp-stack.yml
NOTE: Ensure that you are directly able to connect to Swarm Managers from your machine.
WIP
Logs for any containers deployed on Swarm are automatically sent to ELK stack running on the same Swarm cluster, provided the application in container is putting logs on stdout
or stderr
streams (instead of writing it to a file).
Logs can be seen on Kibana by accessing port 5601
of any Swarm node on a browser.