Development environments from AWS to Hetzner Cloud
Development and test environments on AWS cost $40k a month. We moved them to a Kubernetes platform on Hetzner Cloud and changed how the team creates and uses them. They now cost $1.5k a month.
- Before
$40,000/ mo- After
- $1,500 / mo
- Saved per year
- $462K
- Lower by
- 96%
- Change
- AWS to Hetzner Cloud
- Duration
- 2 months
- Client
- Blood diagnostics company
What we changed
- 01Monitoring and cost by environment, service and team
- 02Kubernetes platform on Hetzner Cloud: clusters from code, upgrades, maintenance
- 03Split CI and CD, permanent and ephemeral environments
- 04Architecture review with the team: fewer services, device data on Redis Streams
- 05Training, cost in everyday decisions, runbooks
The situation
The company grew quickly, and its development setup grew with it. Development and test environments ran on EKS, in AWS accounts separate from production. Each test got its own environment, and new features were often built as new Ruby on Rails services. This is a common way for a fast-moving team to work.
Monitoring had not caught up yet, so it was hard to see what was running, who needed it and what it cost. Over time the development bill reached $40k a month.
What we did
1. Made usage visible
We set up monitoring for the clusters and the workloads, and broke the cost down by environment, service and team. With these numbers the team could see what was running, who was using it and what it cost.
2. Built a Kubernetes platform on Hetzner Cloud
Workloads cannot just be moved from EKS to another provider. They need a platform to run on, and the platform needs to be maintained. We built:
- tooling that creates a cluster from code
- the Hetzner cloud controller manager and CSI driver, so load balancers and volumes work the same way as on EKS
- ingress and automatic TLS certificates
- monitoring and logs for the platform itself
- tooling for maintenance: Kubernetes and component upgrades, node replacement
3. Split CI and CD
The old pipeline built and deployed in one step, straight to EKS. We split it in two:
- CI builds and tests the image once and pushes it to the registry.
- CD deploys that same image to an environment. Development goes to Hetzner, production stays on AWS.
4. Permanent and ephemeral environments
We split the environments into two kinds:
- Permanent environments that the whole team shares. There are only a few of them, and each has an owner.
- Ephemeral environments for testing. One is created from a branch and deleted when the branch is merged or after a fixed time.
5. Reviewed the architecture together with the team
- Number of services. Each new service adds memory, database connections, a pipeline and something to maintain. We went through the services with the developers and showed where new code could live in an existing service.
- Device data between services. Data from the devices was passed from service to service over REST. Every hop meant another request, more compute and more traffic. We moved this flow to Redis Streams: a service writes the data once, and the services that need it read it from the stream.
6. Worked with the team
The goal was for the team to run all of this on their own after we left.
- Training on the platform. How to create and remove environments, deploy, read the monitoring and upgrade the clusters.
- Cost in everyday work. We showed management and the developers how to read the cost data and what each environment and service costs. Cost became part of normal decisions: who creates an environment is responsible for it, and a new service is weighed against what it adds to the bill.
- Documentation. Runbooks for the platform and the maintenance tasks, so the knowledge stays with the team.
Result
The project took 2 months. The development bill went from $40k to $1.5k a month, 96% less, and the team runs the platform themselves.