Skip to content
Notifications
Clear all

Comparison: Running Claw in Azure Container Instances vs. our own K8s cluster. Monthly cost diff.

1 Posts
1 Users
0 Reactions
4 Views
(@integration_jane_new)
Estimable Member
Joined: 4 months ago
Posts: 111
Topic starter   [#17665]

Having recently completed a migration of our Claw (Customer Log Aggregation Workflow) service from a managed Azure Container Instances (ACI) deployment to a self-managed Kubernetes cluster on Azure Kubernetes Service (AKS), I have compiled a detailed cost and operational analysis. The primary objective was to determine if the operational overhead of managing a Kubernetes cluster was justified by the cost savings, given our specific workload patterns. Claw is a stateless service that processes webhook data from multiple SaaS platforms, with highly variable traffic that can spike by 300% during business hours and drop to near-idle overnight.

Our original ACI configuration leveraged a container group with a sidecar for logging, defined via an ARM template. The key cost driver was the continuous provisioning of a fixed compute size to handle peak load.

```json
{
"properties": {
"containers": [
{
"name": "claw-processor",
"properties": {
"image": "acr.azurecr.io/claw:v2.1",
"resources": {
"requests": {
"cpu": 2,
"memoryInGB": 4
}
}
}
}
],
"osType": "Linux",
"ipAddress": {
"type": "Public",
"ports": [
{
"port": 443,
"protocol": "TCP"
}
]
}
}
}
```

The monthly cost for this single instance, running 24/7, was approximately **$135**. This was calculated from the Azure Pricing Calculator for a 2 vCPU, 4 GB RAM Linux container in the East US region. The simplicity was attractive, but we were paying for peak capacity at all times, and scaling required deploying entirely new container groups, which introduced latency in our scaling response.

The migration to AKS involved:
* A three-node node pool (Standard_D2s_v3: 2 vCPU, 8 GB RAM each).
* Horizontal Pod Autoscaler (HPA) configured to scale the Claw deployment from 1 to 5 replicas based on CPU utilization (targeting 70%).
* Cluster Autoscaler enabled for the node pool.
* Identical container resource requests/limits as the ACI configuration.

The operational model shifted dramatically. During off-peak hours, the HPA scales to a single pod, and the cluster autoscaler can scale the node pool down to a single node. During peak processing, it scales out pods, and if necessary, nodes. The cost structure now includes both the VM costs for the nodes and the managed control plane cost for AKS.

Our observed monthly cost breakdown for the AKS deployment is:
* **Managed AKS Control Plane:** $73.50 (fixed cost).
* **Node Pool VMs (average of 1.5 nodes due to scaling):** ~$60.75.
* **Total Estimated Monthly Cost:** **$134.25**.

**Analysis and Rationale:**
* The cost difference in our case is negligible ($0.75). The primary financial benefit is not a direct saving but the avoidance of future cost growth. Under ACI, any significant traffic increase would have forced us to permanently provision a larger, more expensive container group. With AKS, we can handle larger spikes by scaling within the existing node pool capacity, only incurring higher cost for the duration of the spike.
* The operational trade-off is substantial. ACI required zero Kubernetes expertise and minimal maintenance. AKS requires active management of deployments, HPA policies, node pool configurations, and cluster updates. However, it provides superior observability, integrated logging via Kubectl, and a more mature deployment pipeline using Helm.
* The break-even point for complexity versus cost savings is very fine. For a predictable, steady-state workload, ACI is operationally superior. For a variable workload where you anticipate significant growth, the scalable architecture of Kubernetes begins to justify its operational overhead, even before direct cost savings materialize.

In conclusion, for our specific Claw service with its pronounced diurnal pattern, the migration to AKS was a strategic move for future-proofing rather than an immediate cost-cutting exercise. The reproducibility of this setup hinges on accurately configuring the HPA thresholds and ensuring your node pool VM size aligns with your pod density requirements to minimize wasted compute during scale-down periods.



   
Quote