Replacing AWS EKS with Nomad and WireGuard on Hetzner: How We Cut Infrastructure Spend by 72% for a Lagos Logistics Engine
Faced with currency devaluation and exploding AWS EKS costs, a high-volume Nigerian logistics platform was spending $5,800/month on infrastructure. Here is how we migrated their core engine to HashiCorp Nomad and WireGuard on bare-metal servers, lowering costs to $1,610/month while cutting deployment times by 75%.
In late 2023, the Nigerian Naira experienced severe devaluation against the US Dollar. For a high-volume B2B logistics platform processing over 80,000 parcel dispatches monthly across Lagos, Ibadan, and Port Harcourt, their cloud infrastructure bill remained constant in USD—roughly $5,800 per month. In Naira terms, their operating costs nearly doubled within ninety days. Infrastructure went from consuming 8% of gross revenue to burning nearly 18% of their operational margins.
The stack was a standard AWS setup: a managed Elastic Kubernetes Service (EKS) cluster spanning three Availability Zones in eu-west-1 (Ireland), an RDS Multi-AZ PostgreSQL instance, Application Load Balancers, and NAT Gateways routing outbound traffic. Beyond the raw FX shock, the platform suffered from cost inefficiencies inherent to small Kubernetes setups—control plane overhead, idle worker node capacity maintained to handle morning dispatch spikes, and high cross-AZ bandwidth charges.
When the engineering management team engaged Neobot Tech, the goal was straightforward: bring monthly infrastructure expenses under $2,000 without compromising 99.9% application availability or increasing operating complexity for their four-person engineering team. This case study details how we decommissioned AWS EKS and rebuilt the system using HashiCorp Nomad, WireGuard, and Hetzner bare-metal servers, dropping their cloud spend to $1,610 per month.

The Situation: FX Devaluation and the $5,800 AWS Bill
Operating cloud infrastructure in West Africa presents unique structural challenges. Most tech startups bill local merchants in Nigerian Naira (NGN) while paying cloud providers in US Dollars. As covered in our breakdown of Dual-Currency SaaS Billing in Go: Multi-Tenant Pricing with Dynamic FX Indexing, unpredictable exchange rates quickly erode margins if fixed USD commitments remain unaddressed.
Before migration, the client's monthly breakdown on AWS looked like this:
- AWS EKS Control Plane: $73.00
- EC2 Worker Nodes (6x t3a.xlarge): $752.00
- AWS RDS PostgreSQL (db.m6g.xlarge Multi-AZ): $1,280.00
- NAT Gateways (Hourly + Data Processing): $610.00
- EBS Volumes & Provisioned IOPS (gp3): $420.00
- Data Transfer (Cross-AZ + Egress to internet): $1,450.00
- CloudWatch, ALB, and GuardDuty: $1,235.00
- Total: $5,820.00/month
The root cause of the inflated bill was structural over-provisioning. Kubernetes requires dedicated CPU and memory reservations for system components (kubelet, kube-proxy, aws-node, CoreDNS, ingress controllers, and telemetry agents). On a t3a.xlarge instance (4 vCPU, 16GB RAM), nearly 1.2GB of RAM and 0.4 vCPU were consumed before running a single line of business code.
Furthermore, cross-AZ traffic charges accumulated rapidly. The dispatch engine used gRPC for inter-service communication across node instances scattered across three availability zones. AWS charges $0.01 per GB for intra-region data transfer between AZs. Processing millions of location ping updates and real-time route optimizations across zones created an invisible tax that grew alongside operational volume.
Constraints: Unstable Transit, FX Risk, and Team Overhead
We operated under four non-negotiable operational constraints:
- Strict Budget Ceiling: The total bill, including offsite backups and telemetry, had to stay under $2,000/month (a hard cap enforced by the board).
- Zero Loss of Zero-Downtime Deployments: The business processes live dispatch requests between 6:00 AM and 9:00 PM West Africa Time (WAT). Pipeline rollouts could not drop active HTTP requests or WebSocket connections to dispatch mobile apps.
- Low Maintenance Complexity: The team consisted of four engineers. They could not afford to spend 20 hours a week writing complex Custom Resource Definitions (CRDs), debugging CNI plugin crashes, or managing upstream Kubernetes version deprecation cycles.
- Network Resilience over Flaky Local Transit: While servers were hosted in European datacenters, the engineering team in Lagos and merchant webhooks across West Africa frequently faced transit fiber cuts. SSH deployments and deployment scripts had to tolerate high latency and dropped connections.
What We Tried First: Why Spot Instances and K3s-on-EC2 Failed
Before abandoning AWS entirely, we attempted two incremental optimization paths.
Attempt 1: AWS Spot Instances with Karpenter
We configured Karpenter to provision Spot instances for non-critical background job workers. Within two weeks, we abandoned this approach. In the eu-west-1 region, t3a and c5 Spot instance pools experienced frequent terminations during peak European business hours—which coincided exactly with West African morning dispatch windows. Sudden terminations forced fleet re-schedulings that disrupted order distribution queues, causing cascading retries in Redis.
Attempt 2: Self-Managed K3s on AWS EC2
We replaced EKS with a lightweight K3s cluster on raw EC2 instances. This saved $73/month on the EKS management fee and reduced control plane RAM consumption. However, it did not resolve the primary cost drivers: AWS NAT Gateway hourly fees ($0.045/hour per gateway plus $0.045/GB processed) and EBS block storage fees. NAT Gateways alone were costing $610/month simply to route outbound API requests to external SMS and payment providers. NAT Gateways are essentially a tax on default cloud subnet designs.
The Architecture: Bare-Metal Nomad, WireGuard, and Hetzner
To achieve true cost efficiency, we moved the primary compute footprint off AWS to Hetzner Dedicated Servers in Germany, while establishing a secure, encrypted mesh network using WireGuard.
Why HashiCorp Nomad Instead of Kubernetes?
Kubernetes is an excellent tool for organizations with dedicated platform teams, but for smaller teams, it introduces excessive operational overhead. HashiCorp Nomad is a single, lightweight binary (under 60MB) that acts as both orchestrator and scheduler. A Nomad client node consumes less than 80MB of RAM, compared to 1.5GB+ for a typical Kubernetes node agent stack.
Nomad treats native binaries, Docker containers, and Java applications as first-class citizens. Job specifications are written in clear, concise HCL (HashiCorp Configuration Language), avoiding the multi-layered abstraction layers common in Kubernetes YAML definitions.
# nomad/jobs/dispatch-engine.nomad
job "dispatch-engine" {
region = "global"
datacenters = ["hetzner-hel1", "hetzner-fsn1"]
type = "service"
group "api" {
count = 4
update {
max_parallel = 1
min_healthy_time = "15s"
healthy_deadline = "3m"
auto_revert = true
canary = 1
}
network {
mode = "bridge"
port "http" {
to = 8080
}
}
service {
name = "dispatch-api"
port = "http"
provider = "nomad"
check {
type = "http"
path = "/healthz"
interval = "10s"
timeout = "2s"
}
}
task "server" {
driver = "docker"
config {
image = "registry.internal.neobot/logistics/dispatch:v2.4.1"
ports = ["http"]
}
resources {
cpu = 1500 # MHz
memory = 2048 # MB
}
env {
BIND_ADDR = "0.0.0.0:8080"
DB_HOST = "10.100.0.10" # Private WireGuard IP of primary DB
}
}
}
}
The Mesh Network: WireGuard Systemd Integration
Because Hetzner dedicated servers exist on public internet subnets, we established an encrypted kernel-level overlay network using WireGuard. Every node in the cluster—whether a bare-metal server in Finland or a cloud instance in Germany—communicates exclusively over private 10.100.0.0/16 IP addresses.
We configured /etc/systemd/network/50-wg0.netdev and /etc/systemd/network/50-wg0.network directly via Ansible, ensuring network interfaces initialize before the Nomad daemon starts. Cross-node traffic travels over encrypted WireGuard tunnels using ChaCha20-Poly1305 encryption, eliminating the need for complex CNI plugins like Calico or Cilium.
Handling Ingress and Hardware Load Balancing
To manage incoming traffic without expensive cloud load balancers, we deployed two Hetzner Cloud vCPU instances running HAProxy and Keepalived behind Hetzner Floating IPs. Traffic flows directly from client applications to HAProxy, which terminates TLS and routes requests over the WireGuard mesh directly to Nomad dynamic service ports.
For service discovery, we leveraged Nomad's native service discovery engine introduced in Nomad 1.4, completely avoiding the operational overhead of running a separate HashiCorp Consul cluster.
| Cost Component | AWS EKS Original Stack | Hetzner + Nomad Stack | Monthly Savings ($) | | :--- | :--- | :--- | :--- | | Control Plane | $73.00 (EKS Fee) | $0.00 (Nomad embedded in cluster) | $73.00 | | Compute Nodes | $752.00 (6x t3a.xlarge) | $320.00 (4x AX52 Dedicated AMD Ryzen 7) | $432.00 | | Database | $1,280.00 (RDS Multi-AZ) | $280.00 (2x Dedicated NVMe Server + Streaming Repl) | $1,000.00 | | Networking/NAT | $610.00 (AWS NAT Gateways) | $0.00 (Direct WireGuard routing + native IPv4/6) | $610.00 | | Storage / IOPS | $420.00 (AWS EBS gp3 IOPS) | $0.00 (Included PCIe Gen4 NVMe local drives) | $420.00 | | Data Transfer | $1,450.00 (Cross-AZ + Egress) | $140.00 (Hetzner 20TB free/server + low egress) | $1,310.00 | | Telemetry & Monitoring| $1,235.00 (Datadog/CloudWatch) | $380.00 (Self-hosted SigNoz on dedicated VM) | $855.00 | | Total | $5,820.00/mo | $1,610.00/mo | $4,210.00/mo (72.3%) |
To keep telemetry costs managed alongside this infrastructure shift, we deployed SigNoz on a dedicated node, following the principles outlined in our comparison of SigNoz vs. Grafana LGTM vs. Datadog: Telemetry Costs and Outage Diagnostics for African Microservices.
Concrete Outcomes and Metrics
Three months after completing the cutover, the platform metrics verified the decision:
- Total Cloud Spend Drop: Reduced monthly run-rate from $5,820 to $1,610, saving $50,520 annually. In local terms, this insulated operating budgets against continuing foreign exchange volatility.
- Deployment Velocity: Average deployment times dropped from 14 minutes on EKS (rolling pod termination + slow image pulls) to 3.5 minutes using Nomad canary updates and local Docker registry caching.
- Compute Utilization Efficiency: Average CPU utilization per server rose from 14% on AWS to 62% on Hetzner. NVMe disk I/O performance improved significantly, dropping p99 database query latencies from 42ms on AWS EBS gp3 to 4ms on local PCIe Gen4 NVMe drives.
- Uptime: Maintained 99.94% operational availability across the quarter, exceeding the 99.9% target SLA.
Playbook: How to Deploy Nomad + WireGuard on Bare Metal
For teams looking to replicate this deployment architecture, follow this repeatable implementation sequence.
Step 1: Configure WireGuard Mesh on Server Provisioning
Do not use manual wg-quick commands for production nodes. Define your interface directly in systemd-networkd via Ansible or cloud-init during host provisioning.
Create /etc/systemd/network/10-wg0.netdev:
[NetDev]
Name=wg0
Kind=wireguard
Description=Wireguard Mesh Network
[WireGuard]
PrivateKey=YOUR_SERVER_PRIVATE_KEY_HERE
ListenPort=51820
[WireGuardPeer]
PublicKey=PEER_SERVER_PUBLIC_KEY
AllowedIPs=10.100.0.2/32
Endpoint=YOUR_PEER_PUBLIC_IP:51820
PersistentKeepalive=25
Create /etc/systemd/network/10-wg0.network:
[Match]
Name=wg0
[Network]
Address=10.100.0.1/24
Enable and start systemd-networkd:
systemctl enable --now systemd-networkd
Step 2: Bootstrap HashiCorp Nomad Server Node
Install the lightweight Nomad package and configure /etc/nomad.d/nomad.hcl on server nodes. Bind cluster communication interfaces strictly to the WireGuard network device (wg0).
# /etc/nomad.d/nomad.hcl
data_dir = "/var/lib/nomad"
bind_addr = "10.100.0.1" # WireGuard private IP
region = "global"
datacenter = "hetzner-fsn1"
server {
enabled = true
bootstrap_expect = 3
}
client {
enabled = true
network_interface = "wg0"
}
plugin "raw_exec" {
config {
enabled = true
}
}
Start the service across your three server nodes:
systemctl enable --now nomad
Step 3: Configure Hetzner Cloud Controller Manager for Ingress Routing
If you use a mix of Hetzner Cloud instances for load balancers alongside bare-metal nodes, integrate the Hetzner Cloud Controller Manager to automatically manage floating IP routing and firewall rules directly via API.
Set up automated state backups for your primary PostgreSQL database running on bare metal by using systemd timers to snapshot write-ahead logs (WAL) every 15 minutes to an S3-compatible offsite bucket. This guarantees disaster recovery without paying for expensive cloud managed database engines.
Avoid adding complex orchestration tooling before your compute footprint actually demands it. For many engineering teams operating in emerging markets, managed Kubernetes setups represent an unnecessary operational cost. Simple architectures built on bare-metal hardware, lightweight orchestrators, and encrypted overlay networks often deliver better performance, lower operational overhead, and significantly higher profit margins.
Neobot Engineering Standard
Every system deployed by Neobot Tech incorporates enterprise baseline practices. We continuously audit our database topologies, REST API query paths, and frontend modular bundles to prevent latency spikes and ensure top-tier security posture.
Discussion
Comments Coming Soon
We are currently migrating our discussion engine to a new real-time database schema. Check back shortly to join the conversation.