You've built a solid Kubernetes platform on AWS EKS. Your team loves the control. But developers keep asking: "Can we just run Lambda functions here?" They want event-driven scaling without managing Knative or wrestling with cold starts on AWS Lambda proper. KEDA answers that request directly.
Why Run Lambda on Kubernetes?
AWS Lambda is convenient until it isn't. Hard timeouts (15 min), package size limits (250 MB unzipped), VPC cold-start penalties, and vendor lock-in drive teams to seek alternatives. Running Lambda-compatible functions on EKS gives you longer execution, larger artifacts, full VPC control at startup, and portability. KEDA provides the event-driven glue that makes it feel serverless.
Architecture Overview
Deploy your function code as a container image to ECR. Wrap it in a thin HTTP handler (AWS Lambda Runtime Interface Emulator or a custom shim). Deploy a Kubernetes Deployment + Service. Add a KEDA ScaledObject targeting an event source — SQS, Kafka, Kinesis, or Prometheus metrics. KEDA drives the HPA; pods scale to zero when idle.
Authentication Without IAM Keys
Never bake AWS credentials into pods. Use IRSA (IAM Roles for Service Accounts). Annotate the ServiceAccount with the role ARN that has SQS ReceiveMessage/DeleteMessage permissions. KEDA's AWS scalers honor IRSA automatically when the pod runs on EKS.
Container Image Requirements
Your image must listen on port 8080 (configurable) and accept HTTP POST with a JSON body matching the Lambda event structure. Use the public AWS Lambda base images or build your own with the Runtime Interface Emulator (RIE) baked in. Keep the image under 1 GB for fast pulls; multi-stage builds help.
Handling Cold Starts
Kubernetes cold starts differ from Lambda. Node scheduling, image pull, and container init add latency. Mitigate with: pre-pulled images via DaemonSet, node pools with reserved capacity, and KEDA's minReplicaCount > 0 for latency-sensitive paths. For true zero-scale, accept 3-8s first-request latency.
"KEDA turns Kubernetes into a serverless platform without the opinionated baggage of Knative.
— Platform Lead, Fintech Unicorn
Observability Hooks
Emit structured logs (JSON) to stdout. Sidecar Fluent Bit ships to CloudWatch or OpenSearch. Export Prometheus metrics: function duration, error count, queue lag. KEDA exposes scaler metrics (keda_scaler_metric_value) — alert on sustained high lag to catch scaler misconfiguration.
Cost Comparison at Scale
| Metric | Lambda (1M invocations) | KEDA on EKS (t3.medium) | Notes |
|---|---|---|---|
| Compute | $20.00 | $30.37 | 3 pods × 730h |
| Request | $0.20 | $0 | Included |
| Data Transfer | $0.09 | $0.09 | Same |
| Total | $20.29 | $30.46 | EKS wins >5M invocations/mo |
Deploy This Week
- Enable KEDA operator via Helm in the keda namespace.
- Create IRSA role for SQS/Kinesis access.
- Build and push your function image to ECR.
- Apply Deployment, Service, ServiceAccount, ScaledObject.
- Send test events; verify scale-to-zero after cooldown.
✦
You now have Lambda-style event-driven scaling on infrastructure you own. No 15-minute timeout. No 250 MB limit. No cold-start lottery inside someone else's VPC. Next step: wire a canary deployment with Argo Rollouts and let KEDA scale each version independently.





