Skip to content

Week 13

aswesty edited this page May 8, 2024 · 1 revision

Weekly Update on Terraform and Docker Swarm Integration

This week's work built upon previous weeks' efforts integrating Terraform with Docker Swarm, tailored specifically to our project needs. Our implementations have been generated ontop of the examples provided in lectures and exercises. Our infrastructure was not fully automated in the preceding weeks, so it seemed essential to update as much as possible with Terraform.

We spent time adapting the code and debugging in a staging environment, encountering several challenging bugs. Most turned out to be typographical errors, which were quickly resolved once identified. Additionally, our repeated attempts to deploy our bootstrap.sh script presented challenges. We hadn't accounted for all the elements generated, necessitating complete destruction before a new deployment could proceed. This provided us with valuable insights into our script.

Onwards, we used the command terraform destroy -auto-approve, which effectively cleaned up after our previous deployments.

After successfully getting Terraform running, we updated the GitHub workflow.

We then looked into how we could run Prometheus on a docker swarm. We managed to deploy this successfully, and created a new dashboard at Grafana, to monitor the activity.

We parameterized the Terraform implementation to accept different environments for deployment, such as staging and production.

We integrated Docker Swarm with our Terraform setup to effectively manage our containers. By provisioning the Docker Swarm infrastructure via Terraform, we automated the scaling and management of our containers across multiple nodes, hereby we gain resilience and scalability. At this point, the server/vm for monitoring and logging and the database is not integrated in Terraform.

To solve, integrate, and deploy we have used the provided resources from the course, as well as Google, stack overflow, chatGPT, and official guidelines provided by DigitalOcean.

Clone this wiki locally