These resources will create a 3 manager node Docker Swarm, deploy Traefik, Gitlab, Gitlab Runner and whoami services. With resources under kong-deployment, you can spin up Kong with PostgreSQL, and have it configured with purpose built Docker image.
- Debian-based system is presumed
- Your SSH key being authorized on the hosts
ssh-copy-id -i ~/.ssh/id_rsa user@host- Run the playbook
ansible-playbook -K -i ansible/applifting-inventory.yml ansible/main.yml- Create two Docker secrets
printf <password> | docker secret create gitlab_root_password -
printf <anotherpassword> | docker secret create kong_postgres_password -- Deploy the stack with Traefik, Gitlab, Gitlab Runner and whoami
docker stack deploy -c applifting-deployment/applifting-stack.yml applifting- Deploy the stack with Kong and whoami
docker stack deploy -c kong-deployment/kong-stack.yml kong- If run for first time, run Kong configuration image when kong_kong service is running
docker run --network=kong_kong-net michalkozakgd/applifting-devops-task:8b864d8a- Register Gitlab Runner
# Find where is Runner deployed
docker service ps applifting_gitlab-runner
# Exec into it on the correct node
docker exec -it <container_id> gitlab-runner registerKONG_CONSUMER_PASSWORDfor /whoami basic-authKONG_PG_PASSWORDfor Kong PostgreSQL passwordSSH_PRIVATE_KEYfor SSH key to connect to the Docker Swarm
Ansible Docker Swarm role is forked from Jobin James.