Skip to content

Deploy to a cheap infrastructure with Cloudflare, Hetzner, Terraform, Docker and Kubernetes

miguelperezcolom edited this page Aug 5, 2024 · 1 revision

The demo project is deployed to a cheap infrastructure (approx. 15 eur/month). Here I explain how it is achieved.

Please notice that any application built with Spring boot and Mateu is, in the end, just an executable jar. You can run it locally or you can deploy it to any server and run it there. The interesting point here is that we are gonna create a more production ready deployment (scalable, reliable, ...) doing it as per today's standard devops way.

This means that we are gonna use:

  • Cloudfare as DNS/CDN/proxy and for providing the certificates for https
  • Hetzner as cloud provider. We will use servers, the load balancer, private networks and firewalls
  • Terraform for creating our infrastructure in Hetzner
  • Kubernetes to orchestrate our containers
  • Docker and Docker Hub
  • WireGuard for the VPN

This can indeed be seen in action at https://demo.mateu.io

Bonus tasks:

  • Set up observability (send our logs to a log aggregator, traces, metrics and alarms)
  • Set up a database server (e.g. postgresql)
  • Secure our UI using Cloud-Iam (Keycloak), Auth0, Supertokens, Cognito, ....
  • Create a distributed UI from several micro services
  • Add a service mesh (e.g. Istio) for capabilities like zero-trust security, observability, and advanced traffic management
  • Blue-Green and Canary deployments

TBD

Clone this wiki locally