If you’ve been following Kubernetes tooling, you’ve probably already been through the Lens saga: Lens went commercial, OpenLens emerged as the community fork, then FreeLens appeared when OpenLens maintenance slowed. The pattern is familiar — a useful desktop tool, a licensing decision, a fork, another fork.
Radar is not a fork. It’s a different approach to the same problem: giving engineers a useful interface for Kubernetes clusters without the friction of kubectl for every task. Built by Skyhook (YC-backed, Google Cloud Partner), it’s been live since 2025, has 1.7k+ GitHub stars, releases weekly, and the founder reaches out to the community directly. That’s usually a good signal that someone is genuinely building in public.
This article covers what Radar actually does, where it pulls ahead of OpenLens and FreeLens, and when those tools are still the right choice.
The State of Kubernetes Desktop Tooling in 2026
Before getting into Radar specifically, it’s worth naming the landscape clearly:
Lens — the original. Electron-based, polished, now commercial (Mirantis). The free Personal tier is non-commercial only. Pro is ~$22-35/user/month.
OpenLens — the community fork of Lens before Mirantis closed exec/logs/shell in v6.3 (January 2023). Maintenance has slowed significantly. No active release cadence.
FreeLens — a more active community fork, filling the gap left by OpenLens’ decline. Restores the missing features. No commercial backing.
k9s — terminal TUI, fast, keyboard-driven, single-cluster. Different audience.
Radar — Go binary, Apache 2.0, team-oriented, topology and event timeline focused.
The problem with OpenLens and FreeLens is not that they’re bad tools — they’re genuinely useful for the solo developer with one or two clusters. The problem is that they’re single-cluster-at-a-time desktop apps with no concept of team, no persistent state, and no awareness of the modern Kubernetes ecosystem (ArgoCD, Flux, Karpenter, KEDA). As your infrastructure grows, you outgrow them.
What Radar Actually Is
Radar is available in two forms:
Radar OSS — a single ~30MB Go binary, Apache 2.0, free forever. Can run locally (desktop app) or deployed in-cluster via Helm. No sidecars, no feature gates.
Radar Cloud — same binary, adds a hosted control plane with fleet aggregation and shared URLs for team incident response. Free for up to 3 clusters (24-hour timeline retention); Team is $149/cluster/month (scoped RBAC, 3-day retention) and Enterprise $299/cluster/month (SAML/OIDC SSO, SCIM, 30-day retention). Priced per cluster, not per user — users are unlimited, and annual plans get 20% off.
The per-cluster pricing is a deliberate design decision — teams don’t pay more as they add engineers, only as they add clusters. For a 20-person platform engineering team managing 5 clusters, Radar Cloud Team runs $745/month ($1,495/month on Enterprise if you need SSO/SCIM). The equivalent Lens Pro seats would cost $2,200-4,200/month.
For most self-hosted environments, the OSS version is sufficient and costs nothing.
Radar’s home view on a 3-node Talos cluster: workload counts, CPU/memory requests, Helm releases and active issues in one screen.
Key Features
Topology View
This is the most visually distinctive feature. Radar renders a live service graph for your cluster: deployments, services, ingresses, cross-namespace dependencies, and east-west traffic flows — all in a single view without running kubectl get all -A and stitching the output together mentally.
OpenLens and FreeLens have resource list views. They show you what exists. Radar shows you how things connect — which is what you actually need when debugging why Service A can’t reach Service B.
Topology view of the observability namespace (kube-prometheus-stack, Loki, Grafana): ingress → service → workload → pod.
Persistent Event Timeline
Kubernetes events are ephemeral by default — they expire after approximately one hour. When something breaks at 2am and you’re looking at it at 9am, the events that explain what happened are gone. Logs may still be there if you’re running a log aggregator, but the Kubernetes-level events (pod restarts, scheduling failures, node pressure events, probe failures) are gone.
Radar retains events. The OSS version extends this beyond the default 1-hour cluster retention. Radar Cloud retains up to 30 days on the Enterprise tier (3 days on Team). You can rewind the timeline to any point and reconstruct what the cluster looked like at that moment.
Neither OpenLens nor FreeLens have any event retention beyond what the cluster itself provides.
The event timeline groups changes per resource and app, so you can scroll back instead of racing the 1-hour event TTL.
GitOps Integration (ArgoCD + Flux)
Radar auto-detects ArgoCD and Flux and surfaces sync state, drift, and health directly in the UI. You can see whether a deployment is in sync, when it last synced, and whether it drifted from the desired state in Git.
In OpenLens and FreeLens, ArgoCD resources appear as generic Kubernetes custom resources. You can see the CRDs, but there’s no purpose-built understanding of what they mean — no sync status visualization, no diff view, no rollback trigger.
GitOps view: every ArgoCD Application with sync state, health, source and last sync — the degraded and out-of-sync ones surface at the top.
Helm Management
Radar tracks Helm releases with full revision history and supports one-click rollbacks from the UI. This is similar to what OpenLens/FreeLens offer via the Helm releases view, but Radar adds revision diffing — you can see what changed between release 5 and release 6 before deciding to roll back.
Image Filesystem
You can browse container image filesystems through Radar without needing kubectl exec into a running pod or access to the container registry. Useful for security audits and debugging — you can verify what’s actually in an image at rest.
MCP Server (AI Integration)
Radar ships with an MCP (Model Context Protocol) server, which means you can connect Claude, Cursor, or GitHub Copilot directly to your cluster context and ask questions about it in natural language. The MCP server is token-optimized — it doesn’t dump raw YAML at the model, it structures cluster state into meaningful context.
This is something neither OpenLens nor FreeLens have. It’s also something that’s genuinely useful if you’re already using AI assistants for development work.
Cluster Audit
30 built-in best-practice checks — resource requests/limits, RBAC permissions, image pinning, network policies, security contexts. The checks are labeled by compliance framework. This is not a replacement for dedicated security tooling (Trivy, Falco, Polaris), but it’s a useful first-pass audit without leaving the tool you’re already using.
Multi-Cluster Support (Cloud)
The Cloud tier adds fleet-level visibility: a single view across all clusters, cross-cluster search, and drift detection between environments (e.g., staging vs. production). This is the feature that changes the calculus for platform engineering teams managing 5+ clusters.
OpenLens and FreeLens require you to switch cluster context manually. There is no fleet view.
Architecture: Why a Go Binary Matters
OpenLens and FreeLens are Electron apps — Chromium + Node.js wrapped in a desktop shell. This means:
200-500MB install size
1-2 second startup time on a fast machine, more on slower ones
Memory footprint in the hundreds of megabytes
Local kubeconfig required on each engineer’s machine
Radar’s in-cluster deployment is a single Go binary (~30MB) that runs as a Pod with a ServiceAccount. It connects to the hosted control plane over outbound WebSocket + TLS. No inbound firewall rules, no kubeconfig distribution, no per-engineer setup.
The local desktop app is also a lightweight Go binary — 65-second startup was demonstrated on a 322-node cluster. That’s not a typo.
For in-cluster deployment, the architecture means security is handled at the ServiceAccount level, not by distributing kubeconfigs to engineer laptops. That matters for teams with security requirements around credential management.
Feature Comparison
Feature
Radar OSS
Radar Cloud
OpenLens
FreeLens
License
Apache 2.0
Proprietary (hosted)
MIT/GPL
MIT
Maintenance
Active (weekly releases)
Active
Stalled
Active (community)
Architecture
Go binary / in-cluster
In-cluster + hosted
Electron
Electron
Multi-cluster
Basic
Fleet view
❌
❌
Event retention
Extended
24h free / 3 days Team / 30 days Enterprise
Cluster default (~1h)
Cluster default (~1h)
Topology view
✅
✅
❌
❌
GitOps (ArgoCD/Flux)
✅
✅
CRDs only
CRDs only
Helm management
✅
✅
✅
✅
kubectl exec / logs / shell
✅
✅
✅ (restored)
✅
MCP / AI integration
✅
✅
❌
❌
Cluster audit
✅
✅
❌
❌
SSO / SCIM
❌
✅
❌
❌
Shared incident URLs
❌
✅
❌
❌
Image filesystem browser
✅
✅
❌
❌
Cost tracking
✅ (OpenCost)
✅
❌
❌
Price
Free
Free up to 3 clusters; from $149/cluster/month
Free
Free
When Radar Makes Sense
You’re managing multiple clusters. Even with the OSS version, the topology view and event timeline make Radar more useful than OpenLens/FreeLens at 3+ clusters. The Cloud fleet view is the compelling option at 5+.
Your team uses GitOps. If ArgoCD or Flux is part of your workflow, Radar’s native understanding of sync state and drift is meaningfully better than seeing CRDs in a generic list view.
You need post-mortem capability. If your incident review process involves looking at what the cluster was doing when the alert fired, you need event retention. Radar has it; OpenLens and FreeLens don’t.
You’re adopting AI tooling. The MCP server is the most forward-looking feature here. If you use Claude Code, Cursor, or Copilot for your infrastructure work, having cluster context available to those tools without copy-pasting YAML is a genuine productivity improvement.
You have a platform engineering team. Per-cluster pricing, SSO, SCIM, and shared incident URLs are features that only matter if you have more than one person managing infrastructure.
When OpenLens or FreeLens Still Makes Sense
You’re a solo developer with one or two clusters. OpenLens and FreeLens are familiar, local, and have zero setup overhead. If you don’t need team features, event retention, or topology views, they remain perfectly functional tools.
You’re deeply invested in the Lens UX. The resource tree, the terminal integration, the way Lens presents namespace-scoped resources — if your muscle memory is built around that interface, switching has a real cost. Radar is different, not just better.
You need maximum customization. OpenLens and FreeLens support plugins. Radar does not currently have a plugin system.
Your environment is air-gapped or has strict egress restrictions. Radar OSS can run fully in-cluster, but Radar Cloud requires outbound connectivity to the hosted control plane. OpenLens and FreeLens are fully local.
Radar is the most interesting new entrant in the Kubernetes tooling space in a while — not because it replaces everything else, but because it addresses the specific gap that OpenLens and FreeLens never covered: teams, multiple clusters, and persistent state.
For a solo developer, OpenLens or FreeLens are still completely reasonable choices. For a platform engineering team managing more than two clusters with ArgoCD or Flux, Radar’s feature set is materially better and the OSS version costs nothing.
The active release cadence and the YC backing suggest this isn’t a one-person side project — there’s a team actively working on it. Whether the Cloud pricing sticks long-term is a question only usage will answer, but the Apache 2.0 core with an explicit “always open source” commitment is the right foundation.
Worth evaluating if you haven’t already.
Tested with Radar OSS v0.x on Kubernetes 1.29–1.32. Feature availability as of May 2026; Radar Cloud pricing updated October 2026. Screenshots: Radar v1.16 on a 3-node Talos Linux cluster (Kubernetes 1.37), October 2026.
Your pods are pending. Your on-call engineer is getting paged. Somewhere in the chain between “I need more compute” and “compute is available,” something is too slow. That something is almost always node provisioning — and the tool you chose to manage it determines whether that delay is 4 minutes or 45 seconds.
Node autoscaling is one of those infrastructure decisions that looks simple until you’re running it in production. Two schedulable pods sitting in Pending state doesn’t just mean a delayed deployment — it means latency spikes, dropped traffic, breached SLOs, and engineers debugging things that should have been invisible. At scale, it also means either burning money on over-provisioned nodes or gambling on under-provisioning at the worst possible moment.
Cluster Autoscaler (CA) has been the default answer for years. Karpenter emerged from AWS in 2021, graduated to stable in 2023, and by 2025 had become the default recommendation for most AWS-native clusters. In 2026, both tools are mature, widely deployed, and genuinely good — but they solve the problem differently, and picking the wrong one for your environment has real consequences.
This article is a deep technical comparison. It assumes you already know what Kubernetes is and have opinions about infrastructure. The goal is to give you a clear picture of how each tool works, where each one wins, and a decision framework you can actually use.
Karpenter vs Cluster Autoscaler: the short answer
Cluster Autoscaler scales node groups you defined in advance; Karpenter provisions individual nodes on demand, choosing the instance type itself. That single architectural difference drives everything else. Cluster Autoscaler adds nodes to an existing ASG or MIG, so provisioning takes roughly 4–8 minutes and your instance choice is fixed by whatever you put in the node group. Karpenter talks to the cloud provider API directly, bin-packs pending pods against the whole instance catalogue, and typically has capacity in 60–90 seconds — while consolidating underused nodes to cut cost.
Use Cluster Autoscaler if you need mature multi-cloud support, you have strict node-group governance, or your capacity is reserved and homogeneous. Use Karpenter if you are on AWS (or now Azure), your workloads are heterogeneous, and you want faster scale-up plus automatic cost consolidation. Whether you phrase it “Cluster Autoscaler vs Karpenter” or the other way round, the decision comes down to three questions — cloud, workload diversity, and how much control you want over instance selection — and there is a full decision framework at the end of this article.
Why Node Autoscaling Is Hard
The fundamental tension in autoscaling is this: you want compute available before you need it, but you don’t want to pay for compute you’re not using. These goals are in direct conflict, and every autoscaling system is an attempt to find the least-bad trade-off.
Without autoscaling, you’re doing one of two things:
Over-provisioning — you run enough nodes to handle peak load at all times. Your average utilization sits at 20–30%, and you’re paying for the other 70–80% to sit idle.
Under-provisioning — you run lean, and when traffic spikes, pods go Pending. Your SLOs breach. You get paged at 3am to manually scale.
A common failure mode with poorly tuned autoscaling is the “thundering herd at scale-up” pattern: HPA creates new pods faster than node autoscaling can provision capacity. The provisioning window matters. With CA and typical ASG-backed node groups on AWS, you’re looking at 4–8 minutes. With Karpenter, 60–90 seconds. At 100 RPS and a 3-minute window, that’s 18,000 requests under degraded conditions.
Cluster Autoscaler: How It Actually Works
Cluster Autoscaler is a Kubernetes-native project under the kubernetes/autoscaler repository, in production since 2016, supporting AWS, GCP, Azure, Alibaba, DigitalOcean, and more.
The Node Group Model
CA operates on node groups — ASGs on AWS, MIGs on GCP, VMSSs on Azure. CA’s job is to decide when to increase or decrease the desired capacity of these groups. CA does not provision individual nodes. It scales node groups, and the node group provisions nodes. This indirection adds latency and reduces flexibility.
Scale-Up: Detecting Unschedulable Pods
CA runs a control loop (default scan interval: 10 seconds). For each Pending pod with PodScheduled=False, CA simulates adding a node of each known node group type and checks if the pod would become schedulable. When a node group is selected, CA applies an expander to choose which group to scale:
least-waste — minimizes CPU/memory waste after scheduling (best default for cost)
most-pods — maximizes pods scheduled per scale-up operation
A node is a scale-down candidate only if: – CPU and memory utilization (by requests) is below threshold (default: 50%) – All pods could be rescheduled elsewhere – No pod has cluster-autoscaler.kubernetes.io/safe-to-evict: "false" – The node has been underutilized for at least --scale-down-unneeded-time (default: 10m)
This conservatism prevents churn — a feature, not a bug.
Karpenter: How It Actually Works
Karpenter was built by AWS and donated to the Kubernetes project in 2023, where it lives as a SIG Autoscaling subproject under kubernetes-sigs (it has no CNCF maturity level of its own); it reached GA (v1.0) in mid-2024. Providers exist for AWS (stable), Azure (stable), and GCP (beta).
The Core Insight: Bypass the Node Group
Karpenter calls the EC2 RunInstances API directly — no ASG involvement. This means: – Any instance type in a single request, without pre-configuring a node group – No intermediary: Karpenter → EC2 API → node joins cluster – Right-size nodes to exactly what workloads need, across the full instance catalog – Karpenter handles full node lifecycle, including termination
When pods go Pending, Karpenter watches the event (not polls) and immediately: 1. Collects all Pending pods 2. Simulates bin packing — fewest possible nodes across the full instance catalog 3. Selects instances that satisfy all pod requirements 4. Calls EC2 API to provision the optimal instance(s)
Disruption and Consolidation
Karpenter’s differentiated value: active cluster consolidation. It evaluates whether nodes can be removed by redistributing pods onto others, or replaced with a smaller instance type. A c5.4xlarge running 4 vCPU worth of pods gets replaced with a c5.xlarge. Teams commonly report 30–50% compute cost reduction.
consolidationPolicy options: – WhenEmpty — only remove nodes with no workload pods (safest) – WhenEmptyOrUnderutilized — also replace underutilized nodes with smaller ones
The defaults are the aggressive ones. A NodePool that does not set a disruption block gets WhenEmptyOrUnderutilized with consolidateAfter: 0s. Cluster Autoscaler, by contrast, waits 10 minutes before removing an unneeded node (--scale-down-unneeded-time) and only considers nodes below 50% utilisation (--scale-down-utilization-threshold). Teams moving from CA get a much more eager scale-down without changing a line of their workloads, which is why PodDisruptionBudgets matter so much more after the migration (see the gotchas below).
Architecture Comparison
Dimension
Cluster Autoscaler
Karpenter
Node provisioning model
Scales node groups (ASG/MIG/VMSS)
Direct cloud API, no node groups
Instance flexibility
Pre-defined node group types
Full instance catalog at runtime
Scale-up trigger
Polling (10s scan interval)
Watch-based event (near-instant)
Scale-down
Removes underutilized nodes
Removes + consolidates + right-sizes
Spot handling
Via ASG + AWS Node Termination Handler
Native, first-class, no NTH needed
Configuration model
Deployment flags
Declarative CRDs
Cloud support
All major + on-prem
AWS (GA), Azure (stable), GCP (beta)
Consolidation
No
Yes
Community maturity
Very mature (since 2016)
Mature (GA 2024)
Scaling Speed: The Numbers
Cluster Autoscaler on AWS (typical): 1. Pod Pending → CA scan detects (0–10s) 2. ASG UpdateAutoScalingGroup API call (~15–30s) 3. EC2 instance starts (1–2 min) 4. Node bootstrap + kubelet registration (30–60s) 5. Pod scheduled (5–10s)
Total: 3–6 minutes (up to 12 min during high-demand periods)
Karpenter on AWS (typical): 1. Pod Pending → watch event fires (~1s) 2. EC2 RunInstances API call (~2–3s) 3. EC2 instance starts (same hardware — 1–2 min) 4. Node bootstraps + Ready (30–60s) 5. Pod scheduled (~5s)
Total: 90 seconds to 3 minutes
Cost Optimization: Where Karpenter Pulls Ahead
Right-sizing: CA requires pre-defined node groups. Karpenter selects the minimum viable instance for the pending workload from the full catalog.
Consolidation vs scale-down: CA removes underutilized nodes. Karpenter replaces a large underutilized node with a smaller one that still fits all pods. This produces compounding savings over time.
Spot handling: Karpenter receives EC2 interruption notices, pre-provisions a replacement, and drains the node — all within the 2-minute window. No AWS Node Termination Handler required. It also diversifies spot requests across instance types automatically to reduce simultaneous interruption risk.
What’s New in Karpenter v1.15 (October 2026)
Karpenter v1.15.0 shipped on 10 October 2026 (v1.15.1 of the core followed on 23 October; the AWS provider is at v1.15.3 as of 20 November). It moves the comparison less than v1.14 did. Most of it makes disruption safer and easier to explain, which is exactly where Karpenter used to lose the argument against Cluster Autoscaler.
Node repair becomes a voluntary disruption. Repair now goes through the same disruption budgets as consolidation and drift, with a new Unhealthy budget reason, instead of a hard-coded 20% circuit breaker that could freeze all repairs cluster-wide. Node repair itself is still alpha (NodeRepair feature gate, off by default).
Terminate-first drift and repair. Karpenter normally launches the replacement before it drains a node. On fleets with no room to grow (a fully consumed capacity reservation, or a static NodePool at its limit) that meant drift simply stalled. The new TerminateFirstDrift and TerminateFirstRepair gates (alpha) let it terminate first.
Default topology spread awareness. A new --scheduler-config flag feeds the podTopologySpread.defaultConstraints you set in kube-scheduler into Karpenter’s scheduling simulation, so it stops launching nodes that the scheduler then refuses to use.
Better signals. A pod event when a launch fails for insufficient capacity, a karpenter_pods_disrupted_total counter and consolidation_policy labels on the disruption metrics. Smaller additions: instance-type volume limits during provisioning, DRA prioritized alternatives and the groundwork for VPA-aware consolidation.
Which version to standardise on: v1.15 is the current minor, but the AWS provider keeps v1.14 as an LTS line (v1.14.4 shipped on 20 November 2026, with support committed through July 2027) next to the older v1.9.x LTS. If you want the longest patch window, v1.14 is still the safer standard. Move to v1.15 if you need terminate-first for reserved capacity or the new disruption metrics.
v1.14 (July 2026): DRA, CapacityBuffer and Balanced consolidation
If your mental model of Karpenter was formed around v1.0, three changes shipped in v1.14.0 (11 July 2026) are worth revisiting, because two of them close gaps that used to be genuine reasons to stay on Cluster Autoscaler.
1. Dynamic Resource Allocation (DRA) support. Karpenter now ships a DRA allocator: it understands ResourceClaim objects when deciding what to provision, including pod-level claims, and supports consumable capacity and partitionable devices. In practice this is the GPU story. Under the old model, “this pod needs a slice of an A100” was expressed through labels, taints and affinity rules, and the autoscaler could not reason about it properly — you pinned GPU workloads to a hand-built node group and accepted the waste. With DRA, the device requirement is a first-class scheduling input, so Karpenter can pick the right accelerator instance and pack partitionable devices instead of stranding a whole GPU per pod. If you run ML workloads, this is the release that matters.
2. The CapacityBuffer API (v1beta1). Karpenter’s great weakness was always the cold start: it is fast, but it still provisions after pods go Pending. CapacityBuffer lets you declare headroom that Karpenter keeps warm, which is the “overprovisioning with pause pods” hack that teams have been hand-rolling for years, now a supported API with its own status metrics. It directly narrows the gap against a deliberately over-provisioned Cluster Autoscaler node group. One caveat: in Karpenter it sits behind the CapacityBuffer feature gate, which is still alpha and off by default as of v1.15.
3. The Balanced consolidation policy. Consolidation used to be a fairly blunt trade — pack tighter, accept more disruption. The new Balanced policy sits between aggressive consolidation and leaving nodes alone, and consolidateAfter now also applies to destination nodes during consolidation, which makes churn considerably more predictable. If you evaluated Karpenter, liked the cost numbers and rejected it because the disruption was too noisy for your workloads, that objection is worth re-testing.
It would be easy to read the section above as “Karpenter moves, Cluster Autoscaler stands still”. That is not what the release history says. CA tracks Kubernetes minors — 1.35.0 shipped in February 2026, 1.36.0 in July 2026 and 1.37.0 on 6 November 2026 — and two of the 2026 additions are direct answers to Karpenter’s headline features.
1. DRA support, including partitionable devices. Cluster Autoscaler can now simulate scheduling for pods that use ResourceClaims rather than the classic nvidia.com/gpu extended resource, and 1.36 added support for partitionable devices (the MIG-style “slice of an accelerator” case). It is still behind a feature flag and it still works at node-group granularity — CA can only add a node of a type you have already defined — but the “CA cannot reason about DRA at all” objection is gone. If you run GPU workloads on a non-AWS cloud, this matters more than anything Karpenter shipped.
2. CapacityBuffer v1beta1 — the same idea, on the CA side. 1.35 released a CapacityBuffer API for declaring warm headroom, now namespaced and integrated with ResourceQuotas so buffers respect the quotas you already have. This is the same problem Karpenter’s CapacityBuffer solves, arriving in the same year; the pause-pod overprovisioning hack is now a supported API on both sides of this comparison.
3. CapacityQuota and “salvo” scale-up (1.36).CapacityQuota is a CRD that caps the resources CA is allowed to scale up — a guard rail that used to require external tooling. The experimental --salvo-scale-up flag lets CA perform several scale-ups in a single loop instead of one per iteration (budgeted with --salvo-scale-up-budget), which directly attacks the “4-8 minutes” number in the scaling-speed section when many node groups need to grow at once.
4. Operational tuning. A separate --max-node-startup-time, --predicate-parallelism to run scheduler predicates on more threads (replacing --cluster-snapshot-parallelism), a “suspended” node state in the status ConfigMap, CSI volume-limit awareness during scale-up, and atomic size increases for Azure VMSS so a partially-fulfilled scale-up no longer leaves you with the wrong node count. --scale-down-enabled is deprecated in favour of the newer scale-down flags — check your Helm values before upgrading past 1.35.
5. What 1.37 adds (November 2026).CapacityQuota moves to v1beta1, and this one is action required: update the CRD and migrate your manifests, because v1alpha1 is deprecated. CapacityBuffer now reports readyReplicas. An opt-in --enable-graceful-degradation lets the loop carry on with a subset of a huge pending-pod backlog instead of blocking on it. And node_removal_latency_seconds gains a delay_reason label (BlockedByPod, AtomicScaleDownFailed…) that finally tells you why scale-down is slow.
None of this changes the architecture: CA still scales node groups, not nodes. But if your reason for wanting Karpenter was DRA, warm capacity or scale-up throughput rather than instance flexibility, re-read the CA release notes before you migrate.
Multi-Cloud Support in 2026
Cloud
Cluster Autoscaler
Karpenter
AWS
✅ Production-stable
✅ Production-stable (reference impl.)
GCP
✅ Production-stable
⚠️ Beta (karpenter-provider-gcp)
Azure
✅ Production-stable
✅ Stable (karpenter-provider-azure)
Alibaba
✅ Supported
❌ No provider
DigitalOcean
✅ Supported
❌ No provider
On-premises / Cluster API
✅ Supported
❌ Not supported
Karpenter vs HPA, VPA and KEDA: Which Autoscaler Does What
A recurring confusion in the comparison searches: Karpenter is not an alternative to HPA or KEDA. They operate on different layers and are designed to run together. Pod autoscalers decide how many replicas you need; node autoscalers decide what hardware those replicas land on. Karpenter and Cluster Autoscaler only ever see the outcome of the pod autoscalers — pending pods.
So “KEDA vs Karpenter” and “HPA vs Karpenter” are not real choices. KEDA and HPA answer how many pods; Karpenter and Cluster Autoscaler answer how many nodes, and which ones. You will almost always run one from each row. The real comparison is HPA vs KEDA on the pod layer (KEDA when the signal is a queue, a topic or a schedule rather than CPU) and Karpenter vs Cluster Autoscaler on the node layer, which is what the rest of this article is about.
A queue backs up, KEDA sees the lag and raises the replica count, the new pods cannot be scheduled because the cluster is full, and Karpenter provisions a node that fits them. Every layer does its own job. The failure mode people hit is tuning only one of them: an HPA that scales aggressively on a cluster with a slow node autoscaler produces pods that sit pending for minutes, and the latency you were trying to fix stays exactly where it was.
Two pairings deserve care. HPA and VPA on the same metric fight each other — VPA raises requests, which lowers measured CPU utilisation, which makes HPA scale down; run VPA in Off or Initial mode if an HPA already targets CPU on that workload. And KEDA scaling to zero only works if the node autoscaler can drain the last node: with Karpenter, that is consolidation doing its job; with Cluster Autoscaler, you need the node group’s minimum set to 0. See HPA best practices for the pod-level half of this.
Replacing Cluster Autoscaler with Karpenter
If the goal is a straight replacement rather than coexistence, the order matters: install Karpenter with a NodePool that is restricted to the workloads you are moving, scale the Cluster Autoscaler node groups down as Karpenter takes over, and only then remove the Cluster Autoscaler deployment. Removing it first leaves the old node groups with nobody managing scale-down, and you pay for idle nodes until someone notices.
When Cluster Autoscaler Is Still the Right Choice
Non-AWS environments — GCP, Alibaba, DigitalOcean, on-prem with Cluster API
Existing node group architecture — significant investment in ASG design, compliance tooling
Regulatory constraints — some frameworks require ASG-backed provisioning audit trails
Cluster API / bare metal — CA is the only mature option
Team familiarity and working-well CA deployment — migration cost may not justify benefit
Phase 3 — Migrate on-demand. Reduce CA node group capacity gradually.
Phase 4 — Decommission CA once all groups are empty.
Key Gotchas
Karpenter consolidation + permissive PDBs — maxUnavailable: 100% will cause disruptive consolidation. Audit PDBs before enabling WhenEmptyOrUnderutilized.
NodePool limits are hard stops — pods go Pending indefinitely at limit. Monitor utilization.
AMI drift — @latest alias picks up new AMIs on new nodes. Consider pinning for strict change control.
Simultaneous scale-down conflicts — use strict label/taint segregation during migration.
Deployments with no PDB at all — Karpenter drains through the Eviction API, so a PodDisruptionBudget is the only thing that stops every replica being evicted in the same consolidation window. Enforce one with Kyverno or Gatekeeper (in Enforce, not Audit), and add a preStop sleep so endpoints are removed before the pod exits. A PDB protects availability; it does not create capacity.
Stopping consolidation mid-incident — use a budget scoped to the consolidation reasons, so drift (and, with v1.15, repair) keep working. Keep a second, generic budget: Karpenter only applies its default 10% when no budget is defined.
Karpenter vs Cluster Autoscaler Cost: When the Savings Are Real
The number most often quoted for “Karpenter vs Cluster Autoscaler cost” is a 20-40% reduction in compute spend after migration. It is a real number — but it comes from a specific starting point, and it is worth being precise about where the money comes from, because two of the three sources are available to Cluster Autoscaler too.
Where Karpenter’s savings actually come from:
Instance selection across the whole catalog. A pending pod that needs 3 vCPU and 12 GiB lands on the cheapest instance that fits it — possibly a type you would never have created a node group for. With CA you pay for the granularity of the node groups you happened to define. This is the source that CA structurally cannot match, and in heterogeneous clusters it is the largest one.
Active consolidation. Karpenter continuously replaces an underused large node with a smaller one that still fits every pod. CA’s scale-down is binary — a node is either below the utilisation threshold and removed, or left alone — so a cluster of 60%-utilised nodes never gets cheaper under CA and keeps shrinking under Karpenter.
Spot without ceremony. Diversified spot requests, interruption handling and replacement provisioning are built in. CA can run spot node groups, but the diversification and the graceful replacement are on you (or on the Node Termination Handler).
Where Cluster Autoscaler is just as cheap:
Homogeneous, reserved capacity. If your fleet is 90% one instance family covered by Savings Plans or Reserved Instances, the cheapest node is the one you already committed to. Karpenter’s catalog-wide bin packing has nothing to optimise, and its consolidation can actually hurt by moving load off committed capacity onto on-demand instances unless you constrain the NodePool tightly.
Steady-state workloads. Consolidation saves money on clusters whose shape changes. A cluster that runs the same 40 pods all day at stable requests has no fragmentation to recover.
Well-tuned least-waste with a small set of right-sized node groups. Most of the overprovisioning CA gets blamed for is a node-group design problem — three sizes per family, least-waste as the expander and --scale-down-utilization-threshold raised from the default 0.5 close most of the gap on simple clusters.
The honest rule of thumb: the more heterogeneous and bursty the workloads, the larger the gap in Karpenter’s favour. Batch, CI runners, spot-tolerant services and mixed GPU/CPU fleets are where the 30% figures come from. A stable microservice platform on reserved instances should expect single digits, and the migration effort described below may not pay for itself on cost alone — do it for the provisioning latency and the operational model, not the invoice.
Decision Framework
Factor
Cluster Autoscaler
Karpenter
Cloud support
All clouds + on-prem
AWS (GA), Azure (stable), GCP (beta)
Provisioning speed
4–8 minutes
60–120 seconds
Instance flexibility
Node group pre-config required
Full catalog, runtime selection
Cost optimization
Scale-down only
Scale-down + consolidation + right-sizing
Spot integration
Via ASG + NTH
Native, first-class
Operational complexity
Lower
Moderate
Cluster API / bare metal
Yes
No
Consolidation
No
Yes
Running on AWS?
├── No → Azure? → Karpenter (stable) or CA
│ GCP? → CA or GKE NAP (preferred)
│ Other → Cluster Autoscaler
│
└── Yes → Hard regulatory constraints on non-ASG provisioning?
├── Yes → Cluster Autoscaler
└── No → Cost optimization priority or diverse workloads?
├── Yes → Karpenter
└── No → Either (flip for team preference)
Frequently Asked Questions
Is Karpenter a drop-in replacement for Cluster Autoscaler?
No. Different configuration model, different concepts. Migration requires re-expressing node group config as NodePools/NodeClasses, auditing PDBs, and running both in parallel. Budget at least a sprint for a medium-sized cluster.
Can I run Karpenter on self-managed Kubernetes (not EKS)?
Yes, but non-trivial. Karpenter requires IAM credentials (IRSA or equivalent) to call EC2 APIs. On self-managed clusters, this requires more setup than on EKS where IRSA is built-in.
How does Karpenter interact with HPA and VPA?
No conflict. HPA creates pods u2192 pods go Pending if insufficient nodes u2192 Karpenter provisions nodes u2192 pods scheduled. VPA adjusts pod resource requests, which Karpenter uses as inputs for bin packing.
What happens when Karpenter itself goes down?
Existing nodes and pods continue normally. New pods requiring provisioning go Pending until Karpenter recovers. Scale-down and consolidation pause. Deploy multiple replicas with leader election for production.
Does Karpenter support GPU nodes?
Yes. GPU instance types (p3, p4, g4, g5) can be included in NodePool requirements. Create dedicated NodePools with appropriate taints for GPU-requesting pods.
How does Karpenter handle AMI updates?
The expireAfter field forces node rotation. When a node expires, Karpenter pre-provisions a replacement with the latest AMI per EC2NodeClass, then drains and terminates the old node — a rolling AMI update mechanism without additional tooling.
Is Cluster Autoscaler still actively maintained?
Yes. CA remains under active development in kubernetes/autoscaler, with releases tracking Kubernetes minor versions. It is not being deprecated. For non-AWS environments and working CA deployments, it remains a fully supported and rational choice.
Is Karpenter cheaper than Cluster Autoscaler?
Usually, but not always. Karpenter saves money through three mechanisms: choosing the cheapest instance from the whole catalog for each pending workload, continuously consolidating underused nodes into smaller ones, and handling spot diversification and interruptions natively. On heterogeneous, bursty clusters this adds up to 20-40% less compute spend. On a homogeneous fleet covered by Reserved Instances or Savings Plans, with steady workloads and well-designed node groups using the least-waste expander, Cluster Autoscaler is just as cheap and the migration rarely pays for itself on cost alone.
Why are my Karpenter costs still high?
Usually because consolidation cannot do its job. The common causes are pods requesting far more CPU or memory than they use (Karpenter packs on requests, not on usage), PDBs or karpenter.sh/do-not-disrupt annotations that block every node, NodePools restricted to a few instance families, consolidationPolicy: WhenEmpty, or spot disabled. Right-size requests and check the disruption metrics before tuning Karpenter itself.
KEDA vs Karpenter: which one do I need?
Usually both, because they work at different layers. KEDA scales pods: it changes the replica count from event sources such as queue length or a Prometheus query. Karpenter scales nodes: it launches capacity when those new pods cannot be scheduled. KEDA decides how many pods you run; Karpenter decides where they run and removes the nodes once they are gone.
Karpenter vs Cluster Autoscaler: Quick Decision Recap
Searching for Karpenter vs Cluster Autoscaler? The one-paragraph version: choose Karpenter on AWS when provisioning speed (60–90 seconds vs 4–8 minutes), instance-type flexibility and cost consolidation matter. Choose Cluster Autoscaler when you need multi-cloud portability, you already operate stable node groups, or your platform depends on the node-group model (compliance-pinned AMIs, strict capacity planning).
Both can coexist during a migration: run Cluster Autoscaler for existing node groups while Karpenter handles new dynamic capacity, then consolidate once you trust the disruption behavior.
Tested against Kubernetes 1.31–1.36. Karpenter v1.x API (GA; v1.14.1 LTS is current). Cluster Autoscaler 1.36.x. AWS provider examples; Azure and GCP provider details may differ. Last reviewed September 2026.
Your pods are being OOMKilled at 3 AM. Your latency p99 spikes every few minutes with no obvious cause. Your cluster scheduler is placing workloads on nodes that can’t sustain them. In most production Kubernetes incidents, misconfigured resource requests and limits are either the direct cause or an accelerating factor.
This is not a “what are requests and limits” tutorial. It is a deep technical guide for engineers who run Kubernetes in production and need to understand what actually happens inside the kernel when these values are set — and what the consequences are when they are wrong.
What Requests and Limits Actually Are
The Kubernetes documentation explains requests and limits at the API level. What it underexplains is the enforcement mechanism: cgroups.
When the kubelet admits a pod onto a node, it creates a cgroup hierarchy for that pod under /sys/fs/cgroup/. Each container in the pod gets its own cgroup. The values you set in your pod spec translate directly into cgroup parameters:
CPU request → cpu.shares (cgroups v1) or cpu.weight (cgroups v2) CPU limit → cpu.cfs_quota_us and cpu.cfs_period_us Memory request → memory.soft_limit_in_bytes (advisory, used for eviction scoring) Memory limit → memory.limit_in_bytes (hard enforcement, triggers OOMKill)
The scheduler uses requests to make placement decisions. It does not know about actual utilization — it knows about committed capacity. A node with 4 cores where running pods have a total CPU request of 3.5 cores has 0.5 cores of schedulable capacity remaining, even if actual CPU utilization is 15%.
This is why you can have a fully “utilized” cluster (by requests) where nodes are idle, and why you can have nodes at 95% CPU utilization that still accept new pods because their requests are low.
The kubelet uses limits to enforce runtime constraints via those cgroup parameters. The scheduler never sees limits.
CPU vs Memory: Why They Behave Fundamentally Differently
This is the most consequential thing to understand about Kubernetes resource management, and it is routinely misunderstood even by experienced engineers.
CPU Is Compressible
CPU is a time-shared resource. If your container tries to use more CPU than its limit allows, the Linux CFS scheduler simply throttles it — it stops getting CPU time until the next scheduling period. The process continues. It just waits.
From the application’s perspective: things slow down. Latency increases. Throughput drops. But the process does not die.
Memory Is Not Compressible
Memory is not time-shared. If your container tries to allocate memory beyond its limit, there is no “slow down” path. The Linux OOM killer selects a process in the cgroup and kills it. The container dies.
From the application’s perspective: the process is terminated. Kubernetes restarts the container. You see OOMKilled in kubectl describe pod.
Property
CPU
Memory
Enforcement
CFS throttling
OOM Kill
Process survives?
Yes (degraded performance)
No (killed and restarted)
Compressible?
Yes
No
Scheduler visibility
Requests only
Requests only
Over-limit consequence
Latency spikes
Container restart
Setting limits: recommended?
Situational (see below)
Always
This asymmetry drives every recommendation in the rest of this guide.
QoS Classes: Eviction Priority Under Pressure
Kubernetes assigns each pod a Quality of Service (QoS) class based on the requests and limits set across all its containers. This class determines eviction priority when a node is under memory pressure.
Guaranteed
Condition: Every container has CPU and memory requests and limits set, and requests equal limits for both CPU and memory.
Guaranteed pods are the last to be evicted. The kubelet will exhaust BestEffort and Burstable pods before touching these. They get the most predictable resource allocation on the node.
Warning: Guaranteed does not mean “always available.” It means “last to be killed.” On a heavily overloaded node, even Guaranteed pods can be evicted.
Burstable
Condition: At least one container has a CPU or memory request or limit set, but the pod does not meet Guaranteed criteria.
Burstable pods are evicted after BestEffort but before Guaranteed. They can burst above their request when capacity is available, but they are not protected when the node is under pressure.
BestEffort
Condition: No container in the pod has any CPU or memory requests or limits set.
# No resources block at all
BestEffort pods are evicted first, always. They get whatever capacity is left over after scheduled workloads consume their requested share. On a loaded node, they may be starved entirely.
In production: never run stateful workloads or business-critical services as BestEffort. The Kubernetes scheduler will place them anywhere, and the kubelet will kill them first.
Common Misconfiguration Patterns and Their Consequences
Pattern 1: No Requests or Limits Set
Effect: BestEffort QoS. First to be evicted under memory pressure. Scheduler places pods arbitrarily — it has no data for placement decisions, so it defaults to LeastRequestedPriority, which effectively means these pods may land on the same nodes as heavily-loaded workloads.
Real consequence: Your “lightweight” background jobs kill your API servers at 3 AM when a memory spike triggers eviction and BestEffort pods happen to be sitting next to them on the same node.
Pattern 2: Requests Equal Limits (Guaranteed QoS)
This is the common “safe” pattern recommended in older Kubernetes documentation. It is not wrong, but it has a trap:
CPU limits = CPU requests means CPU throttling is guaranteed to trigger. Your pod will be throttled the moment it tries to burst above the request — during startup, during GC, during a traffic spike — even if the node has abundant free CPU.
For latency-sensitive applications, this means predictable throttling spikes at exactly the moments you need the most CPU.
Memory: Setting memory request = memory limit is appropriate and recommended. The behavior is correct: the pod runs in a controlled memory budget.
Pattern 3: Limits Much Higher Than Requests (Burstable with High Ratio)
This is the opposite extreme. The scheduler thinks this pod needs 100m CPU and 128Mi memory. Dozens of these can be scheduled onto a single node. When they all burst simultaneously — which they will, during a deployment, a traffic event, or a GC cycle — the node is overloaded, memory pressure triggers OOMKill cascades, and the scheduler has no idea anything is wrong because the committed capacity (by requests) looks fine.
The limit:request ratio matters. A 10x or 20x memory limit:request ratio on many pods is a recipe for node instability. A reasonable starting point is 2x–4x for memory, less for CPU.
Pattern 4: CPU Limits Set to “Be Safe”
This is the subtlest misconfiguration and the one with the most hidden latency impact. We cover it in depth in the next section.
The CPU Throttling Problem: CFS Bandwidth and Hidden Latency
This is where many production Kubernetes deployments have a silent performance problem they cannot easily diagnose.
How CFS Bandwidth Throttling Works
The Linux Completely Fair Scheduler (CFS) enforces CPU limits using bandwidth control. The relevant parameters are:
cpu.cfs_period_us: the accounting period, default 100ms
cpu.cfs_quota_us: how many microseconds of CPU time the cgroup can use per period
If you set cpu: "500m" as a limit, Kubernetes sets cpu.cfs_quota_us = 50000 (50ms per 100ms period). This means the container can use at most 50% of one CPU core per 100ms window.
The problem: quota is enforced per period, not as a moving average. If your container uses its full 50ms allocation in the first 60ms of a period, it is throttled for the remaining 40ms — even if the node has 7 idle CPUs. The CPU sits idle. Your container waits.
Why This Causes Latency Spikes Even at Low Utilization
This is counterintuitive and the source of many production mysteries. You can have a container running at 10% average CPU utilization that is regularly throttled, because its instantaneous CPU usage within a single 100ms window exceeds its quota.
Java applications with JVM garbage collection are particularly vulnerable. GC causes a CPU burst of short duration. If that burst exceeds the per-period quota, the GC pause is extended artificially by throttling — even though the GC event itself would have been short.
The same applies to Node.js event loop processing, Python import at startup, and any application that has bursty CPU behavior (which is most of them).
The Cloudflare and Netflix Evidence
Cloudflare published findings showing that CPU throttling was responsible for significant tail latency increases in their containerized workloads, and that removing CPU limits reduced p99 latency substantially for services that appeared to have headroom. Netflix has documented similar patterns in their capacity planning work, noting that per-period quota enforcement does not model real application CPU behavior accurately.
The kernel community has been aware of this for years. The fix — moving to cgroups v2 with better scheduler integration — helps but does not eliminate the problem. Kubernetes 1.25+ with cgroups v2 nodes experience less throttling under the same limits, but the fundamental issue remains: CPU limits throttle bursty applications unpredictably.
The Recommendation: Consider Not Setting CPU Limits
This is controversial but grounded in the evidence:
For latency-sensitive services: do not set CPU limits. Set CPU requests accurately and rely on the scheduler for placement.
The argument: – CPU throttling is a soft failure mode that is hard to observe and diagnose – OOMKill is a hard failure mode that is visible and recoverable – CPU requests give the scheduler accurate placement data without creating throttling – Nodes handle CPU oversubscription gracefully through time-sharing; they do not handle memory oversubscription gracefully
When to still set CPU limits: – Multi-tenant clusters where noisy neighbor isolation is critical – Batch workloads where predictable CPU allocation matters more than latency – When your monitoring and alerting can catch CPU starvation at the node level
When you do not set CPU limits, you must set CPU requests accurately. A request of 100m for a service that normally uses 800m means the scheduler places it on a node that cannot actually sustain it. The result is real CPU starvation, not artificial throttling — but it is CPU starvation nonetheless.
Memory: Always Set Limits
The contrast with CPU is direct. Memory is non-compressible. A container that leaks memory or has a runaway allocation will consume all available node memory if unconstrained. This does not degrade gracefully — it triggers the OOM killer, which may kill unrelated processes on the node.
Always set memory limits. Always.
The consequence — OOMKill — is visible, logged, and Kubernetes handles it by restarting the container. An OOMKilled exit code is actionable: you either have a memory leak, your limit is too low, or your sizing methodology is wrong. All three are diagnosable.
The alternative — no memory limit — means a single leaking pod can destabilize an entire node and trigger eviction cascades affecting unrelated workloads.
Set memory requests equal to the p95 steady-state usage of your application. Set memory limits at 1.5x–2x the request to absorb traffic spikes and GC pressure. Profile your application under load to establish these baselines.
Vertical Pod Autoscaler (VPA)
VPA is the Kubernetes component designed to solve the sizing problem automatically. It observes actual resource utilization and recommends (or applies) adjusted requests.
How VPA Works
VPA has three components:
Recommender: Watches historical metrics and computes recommended requests based on observed utilization. Does not modify pods.
Updater: Evicts pods whose current requests differ significantly from recommendations (when VPA mode is Auto or Recreate).
Admission Controller: Mutates pod specs at admission time to apply recommendations from the Recommender.
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: api-server-vpa
namespace: production
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: api-server
updatePolicy:
updateMode: "Off" # Recommend only — do not evict pods
resourcePolicy:
containerPolicies:
- containerName: api-server
minAllowed:
cpu: 100m
memory: 128Mi
maxAllowed:
cpu: 4000m
memory: 4Gi
controlledResources: ["cpu", "memory"]
controlledValues: RequestsAndLimits
VPA Modes
Mode
Behavior
Off
Compute recommendations only. No pod mutations.
Initial
Apply recommendations to new pods only. Do not evict running pods.
Recreate
Evict pods when recommendations change significantly.
Auto
Currently equivalent to Recreate. May change in future versions.
When to Use VPA
Right-sizing during initial rollout: Run VPA in Off mode for 1–2 weeks on a new service. Review recommendations before applying. This is the most valuable use case.
Services with unpredictable or seasonal load patterns: VPA adapts requests based on observed behavior. Combined with HPA for horizontal scaling, this gives you right-sized replicas that scale out horizontally.
VPA and HPA cannot both manage the same metric. If HPA is scaling on CPU utilization, do not use VPA with controlledValues: RequestsAndLimits for CPU — they will fight each other. Use controlledValues: RequestsOnly and let HPA manage scale.
VPA limitations: – Requires pod restarts to apply recommendations (Updater evicts pods) – Does not work well with stateful workloads in strict availability windows – Recommender needs sufficient history (at least a few days) to produce reliable recommendations – Does not account for traffic spikes that haven’t been observed yet
LimitRange and ResourceQuota: Namespace-Level Guardrails
Requests and limits on individual pods solve the per-workload problem. LimitRange and ResourceQuota solve the namespace and cluster-level governance problem.
LimitRange
LimitRange sets default requests and limits for containers in a namespace, and enforces minimum/maximum boundaries. Any pod admitted to the namespace that does not have explicit requests/limits set will receive the defaults.
Key behaviors: – default applies as the limit for containers that set a request but no limit – defaultRequest applies as the request for containers that set no request – max and min cause admission to fail if violated – LimitRange applies at admission time — changing it does not affect running pods
Use LimitRange to: – Prevent BestEffort pods from being admitted (by setting defaultRequest values) – Enforce organizational standards for minimum resource specifications – Protect the cluster from pods requesting unbounded resources
ResourceQuota
ResourceQuota limits the total amount of resources that can be consumed by all pods in a namespace. This is the multi-tenant governance tool.
Critical interaction with LimitRange: When ResourceQuota is active in a namespace, every pod must have requests and limits set or it will be rejected. This is why LimitRange defaults are important — they ensure pods without explicit resources are not rejected by the quota system.
Use ResourceQuota to: – Enforce team/application resource budgets in shared clusters – Prevent runaway deployments from consuming all cluster capacity – Implement chargeback policies (track resource consumption per namespace)
Practical Sizing Methodology
Step 1: Instrument Before You Set Values
Deploy initially with only requests set (no CPU limits, memory limits set conservatively high) and monitor for 2–4 weeks under realistic load.
Useful PromQL queries for sizing:
# p95 CPU usage over the last 7 days
histogram_quantile(0.95,
rate(container_cpu_usage_seconds_total{
container="api-server",
namespace="production"
}[5m])
)
# p99 memory working set over the last 7 days
quantile_over_time(0.99,
container_memory_working_set_bytes{
container="api-server",
namespace="production"
}[7d]
)
# CPU throttling ratio (alert if >5%)
rate(container_cpu_cfs_throttled_seconds_total{container="api-server"}[5m])
/
rate(container_cpu_cfs_periods_total{container="api-server"}[5m])
Step 2: Set CPU Requests from p95 Observations
Set CPU request = p95 CPU usage under realistic production load. For latency-sensitive services: do not set CPU limits. For batch or background jobs: set CPU limits at 2x–4x the request.
Step 3: Set Memory Requests and Limits
Set memory request = p95 memory working set over at least 7 days. Set memory limit = max(observed peak, 1.5 × request). For Java/Python with large processing, use 2x.
# Production example: Java microservice
resources:
requests:
cpu: "500m" # p95 observed: ~420m
memory: "768Mi" # p95 observed: ~680Mi
limits:
# No CPU limit — latency-sensitive service
memory: "1.5Gi" # 2x request, covers GC pressure
Step 4: Use VPA Recommendations to Validate
Run VPA in Off mode alongside your manually-set values. After 1–2 weeks, compare VPA recommendations to your current settings.
Step 5: Adjust for Workload Lifecycle Events
Account for: JVM warmup at startup (CPU spike 3–10x steady-state), rolling deployment overlap (namespace quota headroom), and known traffic peaks (size to peak, not average).
Decision Framework: What to Set Based on Workload Type
Q: My Java application keeps getting OOMKilled but I’ve set limits at 2x average usage. What am I missing?
The JVM heap (-Xmx) is not the only memory consumer. Off-heap buffers, Metaspace, thread stacks, and JVM overhead add 25–40% on top. Set -Xmx at ~75% of your container memory limit. For a 1Gi limit: -Xmx768m is a safe starting point.
Q: Should I set the same resources in all environments?
No. Dev/test can use lower values. But the ratio between request and limit should be similar, and the resource profile should be close enough to catch misconfigurations before production.
Q: Can I use HPA and VPA together?
Yes, carefully. Use HPA for replica scaling (CPU or custom metrics) and VPA in Off mode or controlledValues: RequestsOnly for right-sizing guidance. Never have both managing the same metric simultaneously.
Q: My cluster uses cgroups v2. Does CPU throttling still apply?
Improved but not eliminated. cgroups v2 uses a weight-based scheduler that reduces throttling artifacts. However, cpu.cfs_quota_us enforcement still exists when CPU limits are set. For latency-sensitive workloads, the case for not setting CPU limits remains valid on cgroups v2.
Q: What is a realistic cluster overcommit ratio?
CPU: 5–10x overcommit (total requests vs physical cores) is common for mixed workloads with accurate requests. Memory: 1.5–2x cluster-level overcommit is manageable at 1.5x request:limit ratios. Beyond 2x, node memory pressure events become frequent.
Q: LimitRange is set but pods are still admitted without resources. Why?
LimitRange defaults only apply to containers with no resource specification at all. If a container specifies requests.cpu but not limits.cpu, the LimitRange default for CPU does not fill in the missing limit. Also verify the LimitRange is in the correct namespace: kubectl get limitrange -n <namespace>.
Q: What does a pod with no memory limit do to a node?
It can consume all available node memory unconstrained. This triggers the Linux OOM killer at the node level, which may kill processes outside the container — including the kubelet itself in extreme cases. Memory limits are non-negotiable in production.
Tested against Kubernetes 1.28–1.32. cgroups v2 behavior noted where it differs from v1. VPA examples use autoscaling.k8s.io/v1 API (VPA 0.14+).
Seven years is a long time in observability. Since Prometheus 2.0 landed in 2017, the ecosystem has been transformed by cloud-native adoption, the rise of distributed tracing, and the emergence of OpenTelemetry as the de facto standard for instrumentation. Prometheus 3.0, released in November 2024, is the project’s answer to that transformation — and its most significant change is the native ability to ingest OpenTelemetry metrics directly, without an intermediary collector standing in the way.
This article goes deep on what Prometheus 3.0 actually changes for platform engineers and cloud architects who are running — or planning to run — OTel-instrumented workloads alongside Prometheus-based monitoring stacks. We will cover the native OTLP ingestion endpoint, UTF-8 metric name support, Remote Write 2.0, migration considerations, and the architectural patterns that still make sense even when native OTLP is available.
What Changed in Prometheus 3.0: The OTel-Relevant Picture
Prometheus 3.0 ships a substantial set of changes. Not all of them are equally relevant to OpenTelemetry integration, so let’s focus on what actually moves the needle for OTel users before diving into each area in detail.
Native OTLP Ingestion
The flagship feature: Prometheus 3.0 ships with a built-in OTLP receiver that exposes an HTTP endpoint accepting metrics in the OpenTelemetry Protocol format. Applications instrumented with any OTel SDK can now push metrics directly to Prometheus without routing through an OpenTelemetry Collector. This is not a sidecar, not a plugin, not an external adapter — it is a first-class endpoint in the Prometheus binary itself.
UTF-8 Metric Names
Prometheus historically restricted metric names to [a-zA-Z_:][a-zA-Z0-9_:]*. OpenTelemetry uses dots and slashes in metric names by convention — http.server.request.duration is a canonical OTel metric name. Prometheus 3.0 lifts this restriction and supports arbitrary UTF-8 characters in metric names and label names, which is the single most important compatibility change for OTel interoperability.
Remote Write 2.0
Remote Write 2.0
Remote Write 2.0 replaces the original protocol with a more efficient encoding based on protobuf, adds native histogram support in the wire format, and reduces bandwidth consumption significantly for large-scale deployments. If you are federating metrics to Thanos, Mimir, or Cortex, this matters for operational cost.
New UI
The Prometheus web UI has been completely rewritten. The new UI uses React, supports metric metadata exploration, and provides a significantly improved query-building experience. This is a quality-of-life improvement rather than an architectural change, but it reduces the dependency on external tools like Grafana for ad-hoc investigation.
Breaking Changes Summary
Prometheus 3.0 removes several features that were deprecated in 2.x. The most operationally significant are: removal of the --web.enable-admin-api deprecated flag path, removal of certain legacy storage format options, changes to default scrape timeouts, and stricter validation of configuration that was previously silently accepted. We cover a migration checklist later in this article.
The OTLP Receiver: How It Works and What It Accepts
The OTLP receiver in Prometheus 3.0 is implemented as an optional feature that must be explicitly enabled. Once enabled, it exposes an HTTP endpoint at /api/v1/otlp/v1/metrics that accepts protobuf-encoded OTLP ExportMetricsServiceRequest payloads — the same wire format used by the OpenTelemetry Collector’s OTLP exporter.
What It Accepts (and What It Does Not)
This is critical to understand before you architect around native OTLP ingestion: Prometheus 3.0 OTLP support is metrics-only. It does not accept traces or logs. OTLP is a unified protocol covering all three signals, but Prometheus is a metrics store — the receiver handles only the metrics portion of the OTLP specification.
Supported metric types in the OTLP receiver:
Gauge — maps directly to a Prometheus Gauge
Sum (monotonic) — maps to a Prometheus Counter
Sum (non-monotonic) — maps to a Prometheus Gauge
Histogram (explicit bucket) — maps to a Prometheus Histogram
ExponentialHistogram — maps to Prometheus Native Histograms (a 3.0 feature)
Summary — maps to a Prometheus Summary
Resource attributes from the OTLP payload — things like service.name, k8s.pod.name, cloud.region — are converted to Prometheus labels. This conversion is configurable, and by default Prometheus applies a promotion strategy that converts the most common resource attributes to labels while discarding ones that would create extremely high cardinality.
Enabling the OTLP Receiver
Enabling native OTLP ingestion requires two things: a feature flag and a configuration block in prometheus.yml.
Start the Prometheus binary with the feature flag:
With this configuration, Prometheus will listen on port 9090 (default) and accept OTLP metrics at http://<prometheus-host>:9090/api/v1/otlp/v1/metrics.
Resource Attribute Promotion Strategy
The promote_resource_attributes list deserves careful thought. OTLP carries rich resource-level context — every metric payload includes a ResourceMetrics object with attributes describing the source: service name, version, environment, Kubernetes pod, node, cluster, cloud provider details, and more. Prometheus labels are flat key-value pairs on each time series. Promoting too many resource attributes explodes cardinality; promoting too few loses important context.
A pragmatic starting list for Kubernetes deployments:
otlp:
promote_resource_attributes:
- service.name # Critical: identifies the service
- service.namespace # Logical grouping
- deployment.environment # prod/staging/dev
- k8s.namespace.name # Kubernetes namespace
- k8s.pod.name # Pod-level cardinality — consider omitting in high-scale
- k8s.node.name # Useful for infrastructure correlation
Avoid blindly promoting k8s.pod.name at scale — in a cluster with thousands of short-lived pods, this creates significant cardinality pressure. Prefer service.name and service.namespace for most alerting use cases, reserving pod-level labels for debugging dashboards.
UTF-8 Metric Names: Why This Is the Real Game-Changer
To appreciate why UTF-8 metric name support matters so much, you need to understand the friction it eliminates. OpenTelemetry semantic conventions define metric names using dots as namespace separators. The canonical HTTP server duration metric is http.server.request.duration. The canonical database query duration is db.client.operation.duration. These names are standardized across languages and frameworks — your Go service and your Java service and your Python service all emit the same metric name when instrumented with OTel.
Prometheus 2.x could not store these names. The dots are illegal characters in Prometheus metric naming. Every OTel-to-Prometheus bridge — the OpenTelemetry Collector’s Prometheus exporter, prom-client compatibility layers, the older prometheusremotewrite exporter — had to translate these names, typically by replacing dots with underscores: http_server_request_duration.
This translation is lossy and creates multiple problems:
Name collisions: http.server.request_duration and http.server.request.duration both become http_server_request_duration
Dashboard breakage: Grafana dashboards built against OTel semantic conventions don’t work against translated Prometheus metrics without modification
Cross-signal correlation: Trace attributes use dot notation; when metric names differ, automated correlation tools lose the thread
Vendor lock-in pressure: Teams end up with separate naming conventions for “Prometheus metrics” vs “OTel metrics” and maintain both
Prometheus 3.0 with UTF-8 support stores http.server.request.duration natively. No translation. No collision. The metric name you instrument with is the metric name you query.
Enabling UTF-8 Metric Names
UTF-8 metric names require the utf8-names feature flag:
Once enabled, PromQL queries must use quoted metric names when the name contains characters outside the legacy character set:
# Legacy metric name — unquoted works fine
http_server_requests_total
# OTel metric name with dots — requires quoting in PromQL
{"__name__"="http.server.request.duration"}
# Or using the new PromQL syntax in Prometheus 3.0
http.server.request.duration{service_name="api-gateway"}
The PromQL parser in Prometheus 3.0 has been updated to handle quoted metric names as a first-class construct. Grafana’s PromQL engine has also been updated to handle this syntax — verify your Grafana version (10.3+ has full support) before deploying.
OTel SDK to Prometheus 3.0 Directly: No Collector Required
For teams that only need to get application metrics into Prometheus, native OTLP ingestion enables a dramatically simpler architecture. Here’s what it looks like with different OTel SDKs.
from opentelemetry import metrics
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
from opentelemetry.sdk.resources import Resource, SERVICE_NAME, SERVICE_NAMESPACE
resource = Resource.create({
SERVICE_NAME: "my-api",
SERVICE_NAMESPACE: "platform",
"deployment.environment": "production",
})
exporter = OTLPMetricExporter(
endpoint="http://prometheus:9090/api/v1/otlp/v1/metrics",
)
reader = PeriodicExportingMetricReader(
exporter,
export_interval_millis=30_000,
)
provider = MeterProvider(resource=resource, metric_readers=[reader])
metrics.set_meter_provider(provider)
# Use the meter
meter = metrics.get_meter("my-api")
request_counter = meter.create_counter(
name="http.server.request.count",
description="Total HTTP server requests",
unit="1",
)
request_duration = meter.create_histogram(
name="http.server.request.duration",
description="HTTP server request duration",
unit="s",
)
Java (OpenTelemetry SDK with Spring Boot)
# application.properties (Spring Boot with OTel auto-instrumentation)
otel.service.name=my-api
otel.resource.attributes=service.namespace=platform,deployment.environment=production
# Configure OTLP exporter to push directly to Prometheus
otel.metrics.exporter=otlp
otel.exporter.otlp.metrics.endpoint=http://prometheus:9090/api/v1/otlp/v1/metrics
otel.exporter.otlp.metrics.protocol=http/protobuf
# Export interval
otel.metric.export.interval=30000
With Spring Boot and the OTel Java agent, no code changes are required beyond configuration — the agent instruments your HTTP server, database clients, and messaging systems automatically and pushes metrics using the names defined in OTel semantic conventions.
OTel Collector to Prometheus 3.0: When You Need the Intermediary
Native OTLP ingestion is compelling, but the OpenTelemetry Collector remains relevant for a significant set of use cases. Understanding when each pattern is appropriate is the core architectural decision you will face when adopting Prometheus 3.0 in an OTel environment.
Pattern 1: OTel Collector as Fan-Out Gateway
When you need to send metrics to multiple backends simultaneously — Prometheus for alerting, a long-term store like Thanos for historical analysis, and a commercial observability platform for full-stack correlation — the OTel Collector handles fan-out efficiently. Applications push once to the Collector; the Collector distributes to all backends.
The OTel Collector’s transform processor and metricstransform processor allow you to reshape metrics before they reach Prometheus: rename labels, add static attributes, filter out high-cardinality series, aggregate metrics to reduce storage cost, or apply unit conversions. These operations are not available in Prometheus’s native OTLP receiver.
processors:
transform/metrics:
metric_statements:
- context: metric
statements:
# Drop internal debug metrics
- delete_matching_keys(attributes, "internal.*")
# Normalize environment label values
- set(attributes["deployment.environment"], "prod")
where attributes["deployment.environment"] == "production"
filter/drop_debug:
metrics:
exclude:
match_type: regexp
metric_names:
- ".*.debug..*"
- "runtime.go.internal..*"
metricstransform:
transforms:
# Rename a metric to match your existing Prometheus naming convention
- include: http.server.request.duration
action: update
new_name: http_server_request_duration_seconds
Pattern 3: Collector for Traces and Logs (Always Required)
If your architecture includes traces and logs alongside metrics — and in 2025 it almost certainly does — you need an OTel Collector regardless of what you do with metrics. Prometheus does not accept traces or logs. Jaeger, Tempo, and Loki all have their own ingestion protocols. The Collector is the universal routing layer for the three pillars of observability.
In this architecture, it is usually simpler to route all three signals through the Collector and let it push metrics to Prometheus via OTLP or remote_write, rather than splitting metrics to go directly and everything else through the Collector.
When to Use Native OTLP vs. OTel Collector: Decision Framework
Scenario
Native OTLP
OTel Collector
Single metrics backend (Prometheus only)
Preferred
Overkill
Multiple metrics backends
Not sufficient
Required
Traces + Logs in scope
Not applicable
Required
Metric transformation/filtering needed
Not supported
Required
Simple Kubernetes-native deployment
Preferred
Additional complexity
Air-gapped / constrained environments
Preferred (fewer components)
Consider carefully
Mixed OTel + legacy Prometheus targets
Works alongside scraping
Can normalize naming
High-volume, need batching/buffering
Limited control
Preferred
The pragmatic recommendation for most platform engineering teams: if you are already running the OTel Collector (and you should be if traces are in scope), continue routing metrics through it. Use the Collector’s otlphttp exporter to push to Prometheus 3.0. Reserve the direct SDK-to-Prometheus pattern for simple services where the Collector would be the only reason to add complexity.
Remote Write 2.0: What Changes for Existing Setups
Remote Write 2.0 is a significant protocol upgrade with real operational implications for teams using Prometheus as a metrics source for long-term storage systems like Thanos, Mimir, VictoriaMetrics, or Cortex.
Key Protocol Changes
Protobuf encoding with snappy compression — replacing the previous text-based format. Typically 50-70% reduction in wire size for large metric batches
Native histogram support in the wire format — exponential histograms can now be forwarded without converting to classic histograms, preserving full resolution
Metadata forwarding — metric type and unit information is now transmitted alongside samples, enabling better downstream processing
Created timestamps — the timestamp at which a counter was created is forwarded, enabling more accurate rate calculations across restarts
Configuring Remote Write 2.0
# prometheus.yml
remote_write:
- url: "http://thanos-receive:10908/api/v1/receive"
# Remote Write 2.0 is negotiated automatically with compatible receivers
# Force RW2.0 explicitly if needed:
send_native_histograms: true
metadata_config:
send: true
send_interval: 1m
queue_config:
capacity: 10000
max_shards: 200
max_samples_per_send: 2000
batch_send_deadline: 5s
Remote Write 2.0 uses protocol content negotiation — Prometheus 3.0 will attempt RW2.0 first and fall back to RW1.0 if the receiver does not support it. This means upgrades are generally backward-compatible. Verify that your receiving system (Thanos Receive 0.35+, Mimir 2.12+, VictoriaMetrics 1.98+) supports RW2.0 before expecting the benefits.
Migration from Prometheus 2.x: Breaking Changes Checklist
Upgrading from Prometheus 2.x to 3.0 requires attention to several breaking changes. This checklist covers the operationally significant ones for teams running production Prometheus deployments.
Configuration Changes
Removed: query.lookback-delta default change — the default changed from 5 minutes to match the scrape interval. Queries that relied on the 5m default may return different results. Audit alerting rules that use instant queries on counters.
Removed: storage.tsdb.allow-overlapping-blocks flag — overlapping blocks handling is now automatic. Remove this flag from your startup scripts.
Scrape protocols default change — Prometheus 3.0 defaults to OpenMetrics format for scraping when targets support it. This enables native histograms but may surface parsing differences. Test with --enable-feature=no-default-scrape-port removed if you relied on the old behavior.
Agent mode changes — if using Prometheus Agent mode, review the updated configuration options for WAL management.
PromQL Changes
Stricter parsing — some previously accepted but technically invalid PromQL expressions now fail. Run your alerting rules through promtool check rules against a Prometheus 3.0 binary before cutover.
Native histogram functions — new functions like histogram_fraction() and histogram_quantile() have updated behavior with native histograms. Existing dashboard queries using histogram_quantile() on classic histograms continue to work unchanged.
Storage Compatibility
Prometheus 3.0 can read existing 2.x TSDB data. The upgrade path does not require a data migration. However, Prometheus 2.x cannot read data blocks written by 3.0 (downgrade is not supported without data loss after any writes have occurred). Take a snapshot before upgrading if you need rollback capability:
# Take a TSDB snapshot before upgrading
curl -X POST http://prometheus:9090/api/v1/admin/tsdb/snapshot
# Verify the snapshot exists
ls /prometheus/snapshots/
Pre-Upgrade Validation Steps
# 1. Validate configuration against Prometheus 3.0
docker run --rm -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml
prom/prometheus:v3.0.0
promtool check config /etc/prometheus/prometheus.yml
# 2. Validate alerting rules
docker run --rm -v $(pwd)/rules:/etc/prometheus/rules
prom/prometheus:v3.0.0
promtool check rules /etc/prometheus/rules/*.yml
# 3. Run in parallel (shadow mode) before full cutover
# Deploy Prometheus 3.0 alongside 2.x, scraping the same targets
# Compare query results between versions using promtool query range
Practical Kubernetes Deployment Example
Here is a production-ready Kubernetes deployment of Prometheus 3.0 with OTLP ingestion enabled, suitable as a starting point for platform engineering teams.
With this deployment, any application in the cluster can push OTLP metrics by setting the following environment variables (works with any OTel SDK supporting OTLP HTTP):
This approach works particularly well in environments using the OTel Operator for Kubernetes, where the Instrumentation CRD can inject these environment variables automatically into pods based on namespace or pod label selectors — zero-touch instrumentation with native Prometheus storage.
Frequently Asked Questions
Can I use Prometheus 3.0 OTLP ingestion for traces and logs?
No. The Prometheus 3.0 OTLP receiver handles only metrics. Prometheus is a metrics store — it has no data model for traces or logs. For traces, you need a backend like Jaeger or Grafana Tempo. For logs, you need Loki, Elasticsearch, or a similar system. The OTel Collector is the appropriate routing layer when you need to send all three signals to their respective backends from a single application-side push endpoint.
Does the kube-prometheus-stack Helm chart support Prometheus 3.0?
Yes, with caveats. The kube-prometheus-stack chart updated its Prometheus image to 3.0 starting with chart version 66.0.0. However, some bundled recording rules and alerting rules may need adjustment for the PromQL changes and default behavioral differences. The Prometheus Operator itself (version 0.78+) has been updated to support the new configuration options including the otlp configuration block. If you are managing Prometheus via the Operator, you will configure OTLP settings through the Prometheus CRD’s spec.additionalArgs and a custom PrometheusConfiguration resource.
What happens to existing Prometheus 2.x metric names when I enable UTF-8 support?
Existing metrics with underscore-based names continue to work exactly as before. Enabling UTF-8 support is purely additive — it allows the storage and querying of metric names containing dots and other UTF-8 characters, but it does not rename or modify existing metrics. Your existing dashboards, alerting rules, and recording rules continue to function without modification. Only metrics ingested via OTLP (or exposed by exporters using OTel naming conventions) will use dot-separated names.
How does native OTLP ingestion affect Prometheus’s pull model?
It coexists with it. Prometheus 3.0 continues to scrape targets via the pull model on the same 9090 port. The OTLP endpoint is an additional ingestion path, not a replacement for scraping. You can have a Prometheus instance simultaneously scraping Kubernetes pods via service discovery and receiving OTLP push metrics from applications — both are stored in the same TSDB and queryable via the same PromQL interface. This hybrid approach is common during migrations, where legacy components are scraped and new OTel-instrumented services push via OTLP.
Is the Prometheus 3.0 OTLP receiver suitable for high-volume production workloads?
For moderate volumes, yes. The OTLP receiver is synchronous — the HTTP request completes only after the samples are written to the WAL. Under very high ingestion rates (hundreds of thousands of samples per second), this can create back-pressure that affects application latency. The OTel Collector handles this better through internal buffering, retry queues, and batch processing. For high-volume scenarios, the recommended pattern is: applications push to OTel Collector (which acknowledges immediately and buffers), Collector pushes to Prometheus via OTLP or remote_write in optimized batches. For the majority of Kubernetes workloads — dozens to hundreds of services with typical metric cardinality — the native OTLP receiver performs well without an intermediary.
Frequently Asked Questions
Can Prometheus 3 receive OpenTelemetry metrics directly?
Yes. Prometheus 3 ships a native OTLP endpoint (/api/v1/otlp/v1/metrics) — an OpenTelemetry Collector or SDK can push metrics straight to it with the OTLP/HTTP exporter, no Prometheus remote-write translation in between.
Does Prometheus 3 support dots in metric names?
Yes — UTF-8 support means OpenTelemetry-style names like http.server.duration no longer have to be flattened to underscores. Querying them needs the quoted syntax: {"http.server.duration"}. Legacy normalization remains available for compatibility with existing dashboards.
Should I push OTLP to Prometheus or scrape with the Collector?
Pushing OTLP fits when OpenTelemetry SDKs are already your instrumentation layer and you want Prometheus as the storage/query engine. Keep native scraping when you depend on up/absent semantics and service discovery — the pull model is still what most alerting assumes. Mixed setups are normal: scrape infrastructure, push application OTLP.
Do existing dashboards break after moving to OTLP ingestion?
Metric names change unless you enable normalization (dots instead of underscores, no automatic _total suffixes), so PromQL that matches on names needs updating. The data itself is fine — it is a naming migration, not a data migration.
Helm is the de facto package manager for Kubernetes, and values.yaml is its primary interface for configuration. Yet for years, that interface has been completely unvalidated by default — a free-form YAML file where any key can be anything, where typos silently pass through, and where misconfigured deployments only reveal themselves when pods fail to start in production. The values.schema.json file changes that equation entirely. This article explains why schema validation matters, how to implement it properly, and how to integrate it into a modern CI/CD pipeline.
The Problem: Silent Failures in Production
Consider a platform team managing dozens of Helm releases across multiple clusters. A developer submits a values override file with replicaCount: "3" instead of replicaCount: 3 — a string where an integer is expected. Or they set image.pullPolicy: Allways with a typo. Or they omit a required secret reference that the application needs to boot. In all three cases, Helm without schema validation will happily render the templates, produce Kubernetes manifests, and apply them to the cluster. The failure surfaces later — sometimes much later — as a CrashLoopBackOff, an ImagePullBackOff, or a subtle runtime error that takes hours to debug.
This is not a hypothetical scenario. It is the daily reality for teams operating at scale without values validation. The root cause is architectural: Helm templates use Go’s text/template engine, which is weakly typed and permissive by design. A template that does {{ .Values.replicaCount }} will render whether the value is an integer, a string, or even a boolean. The resulting Kubernetes manifest may be invalid, but that error only surfaces when the Kubernetes API server rejects it — or worse, accepts it but interprets it differently than intended.
The consequences compound at scale. When a chart is used by multiple teams, the lack of a formal contract for acceptable values means every consumer has to read through template files and comments to understand what inputs are valid. There is no machine-readable specification. There is no IDE support. There is no guardrail. The only documentation is whatever the chart author happened to write in comments inside values.yaml — and comments do not stop a CI pipeline from shipping a broken deployment.
What Is values.schema.json
Since Helm 3.0.0, released in November 2019, Helm supports an optional values.schema.json file at the root of a chart directory — the same level as Chart.yaml and values.yaml. This file is a JSON Schema draft-07 document that formally describes the structure, types, constraints, and required fields for the chart’s values.
When this file is present, Helm automatically validates the merged values (defaults from values.yaml merged with any user-supplied overrides) against the schema at multiple points: during helm install, helm upgrade, helm template, and helm lint. If validation fails, Helm refuses to proceed and prints a human-readable error message identifying exactly which value failed and why. This transforms a class of runtime failures into build-time failures — the correct direction for any production system.
The choice of JSON Schema draft-07 specifically is worth noting. Draft-07 is widely supported by tooling, including the Red Hat YAML extension for VS Code, JetBrains IDEs, and most JSON Schema validators. It introduced the if/then/else conditional keywords that are particularly useful for Helm charts. More recent drafts (2019-09, 2020-12) offer additional features but have less universal tooling support, making draft-07 the pragmatic choice for chart authors today.
The schema file is included when a chart is packaged with helm package and distributed through chart repositories. Consumers of the chart get schema validation automatically without any additional configuration — the guardrails ship with the chart itself.
How Helm Uses the Schema
Helm’s validation behavior is straightforward but has some nuances worth understanding. When Helm processes a release, it first merges all value sources in order of increasing precedence: chart defaults (values.yaml), parent chart values, -f value files, and finally --set flags. The merged result is then validated against the schema as a single operation.
This means the schema validates the effective values, not each source in isolation. A required field that has a default in values.yaml will pass validation even when not specified by the user, because the merged result includes the default. This is the correct behavior — it validates what will actually be used during rendering.
The validation happens before template rendering. If schema validation fails, Helm exits with a non-zero status code and prints all validation errors. The error output is structured and actionable:
$ helm install my-release ./my-app --set replicaCount=abc
Error: values don't meet the specifications of the schema(s) in the following chart(s):
my-app:
- replicaCount: Invalid type. Expected: integer, given: string
For helm lint, which is typically used in CI pipelines without installing to a cluster, schema validation also runs. This makes helm lint a powerful pre-deployment gate when schema files are present.
IDE Benefits: Autocompletion and Inline Validation
Beyond Helm’s own validation, values.schema.json unlocks IDE support that significantly improves the developer experience when working with values files. The Red Hat YAML extension for VS Code can reference a JSON Schema file to provide autocompletion, type checking, and inline error highlighting for YAML files.
To enable this, add a yaml.schemas configuration to your VS Code workspace settings or the user settings file:
With this configuration, editing values.yaml in VS Code will show autocompletion for defined keys, inline errors for type mismatches, and hover documentation pulled from the description fields in your schema. For platform teams maintaining internal Helm charts, this transforms the chart into a self-documenting, IDE-aware configuration interface — without any additional tooling investment.
JetBrains IDEs (IntelliJ IDEA, GoLand, etc.) support JSON Schema associations through the Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings settings panel, providing equivalent functionality for teams using those tools.
Building the Schema: A Practical Guide
Let’s build a complete, realistic example. Start with a typical values.yaml for a web application chart:
This is arguably the most important pattern in a Helm schema. Without it, unknown keys pass validation silently — which defeats much of the purpose. With "additionalProperties": false, any key not listed in properties causes a validation error. This catches typos like repicaCount instead of replicaCount, which would otherwise silently use the default value and leave the developer wondering why their override had no effect.
Apply it at every nested object level, not just the root. A typo inside image: or resources: is just as dangerous as one at the top level.
$defs for Reusable Definitions
The $defs keyword (called definitions in earlier draft versions, though draft-07 supports both) provides a namespace for reusable schema fragments. In the example above, resourceQuantity is defined once and referenced via $ref in both requests and limits. This avoids duplication and ensures consistent validation logic across related fields.
For larger charts, $defs becomes essential. Common patterns include reusable schemas for image configurations, resource requirements, probe configurations, and environment variable maps.
Conditional Validation with if/then/else
The if/then/else construct in JSON Schema draft-07 is particularly powerful for Helm charts, where many values are conditional on a feature toggle. The ingress example above demonstrates this: when ingress.enabled is true, the hostname field becomes required and must match a valid hostname pattern. When ingress is disabled, the hostname can be empty or omitted entirely.
This pattern can be extended for more complex scenarios. For example, enforcing that when autoscaling.enabled is true, the standalone replicaCount should not be set (since the HPA controls replica count):
The image tag field is a common source of production issues. Teams accidentally deploy with latest, which is non-deterministic and makes rollbacks unreliable. A pattern constraint can enforce semantic versioning or at least ban the latest tag in production charts:
"tag": {
"type": "string",
"not": {
"enum": ["latest", ""]
},
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+",
"description": "Semantic version tag required. 'latest' is not permitted."
}
This enforces that image tags start with a semantic version number, immediately rejecting latest, empty strings, or arbitrary branch names that would produce non-reproducible deployments.
Enum for Controlled Vocabularies
Fields with a fixed set of valid values — Kubernetes service types, image pull policies, log levels — should use enum. This is more precise than a pattern and produces clearer error messages. It also enables IDE autocompletion to show exactly the valid options as a pick-list, rather than requiring the developer to remember or look up acceptable values.
CI/CD Integration
GitHub Actions
The most direct integration point is helm lint, which runs schema validation as part of its checks. A minimal GitHub Actions workflow that validates a chart on every pull request looks like this:
The ci/ directory convention (values files specifically for CI testing) is a pattern from the chart-testing tool and works well for validating multiple realistic value combinations, not just the defaults.
For teams using the ct (chart-testing) CLI tool from the Helm project, schema validation is automatically included in the ct lint command, which also handles chart versioning checks and YAML linting:
#!/usr/bin/env bash
# scripts/validate-helm-schemas.sh
set -euo pipefail
for chart_dir in charts/*/; do
if [[ -f "${chart_dir}/values.schema.json" ]]; then
echo "Linting ${chart_dir}..."
helm lint "${chart_dir}" --strict
fi
done
ArgoCD and Flux Integration
Both ArgoCD and Flux (Helm Controller) invoke helm template internally when reconciling Helm releases. Since helm template runs schema validation when a schema file is present, any invalid values in an HelmRelease or ArgoCD Application manifest will cause the reconciliation to fail with a clear error message — visible in the controller logs and surface as a degraded resource status. No additional configuration is required; schema validation is automatic.
Generating Schemas from Existing Charts
For charts that already have a well-structured values.yaml, writing a schema from scratch is time-consuming but not starting from zero. Several tools can generate a draft schema that you then refine:
helm-values-schema-json — a Helm plugin (helm plugin install https://github.com/losisin/helm-values-schema-json) that introspects values.yaml and generates a draft schema with inferred types. Run with helm schema-gen values.yaml.
json-schema-generator online tools — paste your values as JSON (convert YAML to JSON first) and get a draft schema back.
Manually from scratch — for new charts, writing the schema alongside the values file from the beginning is the most accurate approach and requires no extra tooling.
Generated schemas are always starting points. They infer types from existing values but cannot know about intended constraints, enums, patterns, required fields in conditional cases, or additionalProperties: false at nested levels. Manual review and refinement is always necessary.
Common Mistakes and How to Avoid Them
Mistake
Symptom
Fix
Missing additionalProperties: false
Typos in key names pass validation silently
Add it at every object level, including nested objects
Schema only at root level
Nested typos go undetected
Apply additionalProperties: false recursively
Not including defaults in schema
IDE shows fields as required when they are optional
Add default to all optional fields
Overly strict patterns blocking valid values
Legitimate deployments fail schema validation
Test patterns against your real value space before shipping
Using definitions instead of $defs
Works in most tools but is draft-2019-09+ terminology
Use $defs for draft-07 compliance; both work in practice
Schema not committed to the chart repo
Consumers get no validation when pulling from repository
Always commit values.schema.json alongside the chart
Validating subchart values through parent schema
Schema errors for subchart values the parent doesn’t own
Do not attempt to validate subchart values in parent schema; each chart owns its own schema
The Null Value Problem
A subtle but common issue: in YAML, an unset key with no value (key:) resolves to null, not an empty string or zero. If your schema defines a field as "type": "string", a null value will fail validation. To handle optional fields that users might leave blank, use a type union:
"databaseUrl": {
"type": ["string", "null"],
"description": "Database connection URL. Leave null to use the default."
}
Alternatively, ensure your values.yaml defaults use empty strings ("") rather than bare keys, and document that convention for chart consumers.
Schema Drift
As charts evolve, new values get added to values.yaml without corresponding updates to values.schema.json. Over time the schema becomes stale and provides partial coverage. The fix is procedural: treat schema updates as part of the definition of done for any PR that modifies values. Code review should include checking that new or modified values have corresponding schema entries.
Frequently Asked Questions
Does values.schema.json validate subchart values?
No. Each chart in a dependency relationship validates only its own values against its own schema. If chart A depends on chart B, and chart B has a schema, chart B’s schema validates the values under the b: key in chart A’s values.yaml — but only when processed in the context of chart B itself. Chart A’s schema should not attempt to describe chart B’s values structure. This is by design: it maintains loose coupling between charts and allows subcharts to evolve their schemas independently.
Can I use JSON Schema draft-2020-12 instead of draft-07?
Technically, Helm does not strictly enforce which draft version you use — it uses the Go library github.com/xeipuuv/gojsonschema, which supports draft-04 through draft-07. Using newer draft keywords that are not supported by this library may cause them to be silently ignored rather than throwing an error. For IDE support, draft-07 has the broadest compatibility. If you need features from newer drafts (like unevaluatedProperties from 2020-12), test carefully to confirm they are enforced by Helm’s validator and not silently skipped.
How do I handle values that differ between environments without schema conflicts?
The schema should describe all valid values across all environments. Use enum to enumerate all valid values for a field, and use if/then/else for constraints that only apply in certain configurations. The schema is a contract for what the chart accepts, not a policy for what a specific environment should use. Environment-specific policies (such as “production must use a minimum of 3 replicas”) are better enforced at a higher level — through admission controllers like OPA Gatekeeper or Kyverno — rather than in the chart schema itself.
Does schema validation run when using helm template for dry runs?
Yes. helm template runs schema validation before rendering templates. This makes it useful as a validation step in CI pipelines even without a live cluster: helm template release-name ./chart -f values-override.yaml will fail with schema errors if the values are invalid, and will output the rendered manifests if they are valid. Piping the output to kubectl apply --dry-run=client -f - adds an additional layer of Kubernetes API validation for a thorough offline check.
Should I add values.schema.json to charts I don’t maintain (upstream charts)?
For upstream charts you consume but do not maintain (such as Bitnami charts, ingress-nginx, cert-manager), the recommended approach is to maintain a separate JSON Schema file in your own GitOps repository that validates your specific values overlay files. Tools like jsonschema (Python) or ajv (Node.js) can validate a YAML/JSON values file against a schema in CI without Helm being involved. This gives you schema validation for your environment-specific overrides without needing to modify upstream chart sources.
Frequently Asked Questions
What is values.schema.json in Helm?
A JSON Schema file placed next to values.yaml in a chart. Helm validates the merged values against it on helm install, upgrade, lint and template, and refuses to render if validation fails — turning typos and wrong types into hard errors before anything reaches the cluster.
Does Helm validate values.schema.json automatically?
Yes. If the file exists in the chart root, validation runs on every install, upgrade, lint and template with no extra flags. It validates the final merged values — defaults plus every -f file plus --set overrides.
How do I reject unknown keys in Helm values?
Set "additionalProperties": false at the levels you want closed. With that, a misspelled key like replicaCont fails validation instead of being silently ignored — the single most valuable line in most schemas.
Do subcharts have their own values schema?
Yes, and each subchart’s schema validates its own slice of the values. A parent chart cannot loosen a subchart’s schema; if a dependency ships a strict schema, your overrides must comply with it.
If you manage Kubernetes clusters in production, the last 18 months have been uncomfortable. Two of the most widely deployed NGINX-based Ingress Controllers have faced critical security vulnerabilities, deprecation announcements, and shifting maintenance responsibilities — all while the Kubernetes project accelerates its push toward a new traffic management standard. This is not a drill. Teams running ingress-nginx or the F5/NGINX Ingress Controller need a clear picture of what changed, what it means for their clusters, and what their realistic options are going forward.
First, Clear the Confusion: There Are Two NGINX Ingress Controllers
One of the most persistent sources of confusion in the Kubernetes networking space is that there are two completely different projects both called “NGINX Ingress Controller,” maintained by different organizations, with different architectures and different licensing.
ingress-nginx (kubernetes/ingress-nginx)
This is the community-maintained controller under the Kubernetes project umbrella, hosted at github.com/kubernetes/ingress-nginx. It uses the open-source NGINX as its data plane, configured via Lua scripting and dynamically generated nginx.conf files. This is the controller most teams end up with when they follow the official Kubernetes documentation or install from the Helm chart referenced in the ingress guide. It is free, open-source, and until recently was considered the default choice.
This is the commercial and open-source controller maintained by F5/NGINX, hosted at github.com/nginxinc/kubernetes-ingress. It also supports NGINX Plus (the commercial version with enhanced features like active health checks, JWT authentication, and advanced load balancing). The architecture is different — it uses native NGINX APIs rather than the Lua-heavy approach — and it targets enterprise customers looking for support contracts and advanced capabilities.
These two controllers are not interchangeable. Configuration annotations differ, Helm chart values differ, and behavior under edge cases differs substantially. Understanding which one your cluster runs is the necessary starting point for any decision about migration.
# Check which NGINX IC you are actually running
kubectl get pods -n ingress-nginx -o jsonpath='{.items[*].spec.containers[*].image}'
# Community controller image looks like:
# registry.k8s.io/ingress-nginx/controller:v1.x.x
# F5/NGINX controller image looks like:
# nginx/nginx-ingress:x.x.x or private-registry.nginx.com/nginx-ic/nginx-plus-ingress:x.x.x
What Actually Happened: A Timeline of Disruption
The ingress-nginx CVEs (2024)
In March 2024, security researchers disclosed a set of critical vulnerabilities in ingress-nginx under the collective name IngressNightmare (CVE-2025-1097, CVE-2025-1098, CVE-2025-1974, CVE-2025-24514). The most severe of these, rated CVSS 9.8, allowed unauthenticated remote code execution against the ingress-nginx admission webhook. An attacker with network access to the admission controller could craft a malicious Ingress object to inject arbitrary NGINX configuration, ultimately achieving code execution in the controller pod — which in many clusters runs with elevated permissions and access to service account tokens across namespaces.
The vulnerabilities affected the vast majority of ingress-nginx deployments in the wild. Wiz Research, which discovered and disclosed the issues, estimated that approximately 43% of cloud environments were exposed. Patches were released in versions 1.11.5 and 1.12.1, but the incident forced uncomfortable questions about the controller’s security posture and the architecture decisions (particularly the admission webhook design) that made it possible.
Maintenance Concerns in ingress-nginx
Beyond the CVEs, the ingress-nginx project has faced ongoing concerns about maintainer bandwidth. The project is maintained by a small group of volunteers and relies heavily on community contributions. Issue response times slowed, pull requests aged, and the pace of feature development declined relative to alternatives. For a component as critical as the cluster ingress layer, this created legitimate concern about long-term sustainability without corporate backing or broader contributor growth.
F5/NGINX Deprecation Announcement
On the commercial side, F5/NGINX announced in early 2025 that the nginxinc/kubernetes-ingress controller — particularly its open-source tier — would undergo significant changes. F5 signaled a strategic shift toward NGINX Gateway Fabric, their implementation of the Kubernetes Gateway API specification. The message was clear: investment in the Ingress-based controller would be reduced, and customers were encouraged to plan migrations toward Gateway API-native solutions.
For teams running NGINX Plus-based ingress with support contracts, this was a significant business concern. The product they had licensed and standardized on was being steered toward end-of-life on the Ingress API, even if exact timelines remained somewhat ambiguous in the initial announcements.
Real Impact on Production Clusters
The practical consequences depend heavily on which controller you run and how your clusters are configured. Here is an honest assessment:
Immediate Security Risk
If you run ingress-nginx and have not patched to 1.11.5+ or 1.12.1+, your admission webhook is a critical attack surface. Patching is non-negotiable and should have happened already. The admission webhook can be disabled if you are not using it for validation (many teams are not), which significantly reduces the attack surface while you plan a longer-term migration.
# Check your current ingress-nginx version
kubectl get deployment ingress-nginx-controller -n ingress-nginx \
-o jsonpath='{.spec.template.spec.containers[0].image}'
# Verify admission webhook is configured
kubectl get validatingwebhookconfigurations | grep ingress
# If you need to disable the webhook temporarily (reduces but does not eliminate risk):
kubectl delete validatingwebhookconfiguration ingress-nginx-admission
Operational Uncertainty
Even after patching, the underlying questions remain. Teams are now asking: should we invest in hardening and tuning ingress-nginx knowing it may not be the strategic direction? Should we migrate now when it is our choice, rather than later when it may be forced? For NGINX IC customers, they are evaluating whether their licensing costs justify continued investment in a product being steered toward deprecation.
Configuration Migration Complexity
The real cost of migration is in the annotation-heavy configurations that accumulate over time. Teams that have built complex routing logic using nginx.ingress.kubernetes.io/* annotations — custom headers, rate limiting, auth snippets, rewrite rules, canary traffic splitting — face significant rework when switching controllers. This is the primary reason many teams are reluctant to move despite clear signals that a transition is coming.
The Alternatives: An Honest Evaluation
There is no shortage of Ingress controller options. The question is which alternatives are mature enough for production workloads at scale, and what trade-offs each brings.
Traefik
Traefik Proxy (and its Kubernetes-native version via Traefik Hub) has emerged as the most popular alternative for teams leaving ingress-nginx. It supports the standard Kubernetes Ingress API for drop-in compatibility, its own IngressRoute CRDs for advanced features, and Kubernetes Gateway API. It is written in Go, has strong TLS automation via Let’s Encrypt, and has excellent observability with built-in metrics and a real-time dashboard.
Trade-offs: Traefik’s configuration model is different enough from NGINX that complex routing logic requires rethinking rather than translating. Performance under very high connection counts is generally good but NGINX has a longer track record in extreme-scale deployments. The commercial offering (Traefik Hub) adds API gateway capabilities but introduces vendor dependency.
Envoy Gateway
Envoy Gateway is now a CNCF project and implements the Kubernetes Gateway API natively using Envoy as its data plane. This is arguably the most strategically aligned option for teams that want to bet on the future of Kubernetes networking. Envoy is battle-tested (it powers Istio, Contour, and large-scale service meshes at companies like Lyft and Google), and the Gateway API implementation is comprehensive and actively developed.
Trade-offs: Envoy Gateway is relatively young as a standalone project. Teams unfamiliar with Envoy will face a steeper learning curve for debugging and custom configuration. The operational model differs significantly from NGINX-based controllers. However, for greenfield deployments or teams willing to invest in the transition, this is a strong forward-looking choice.
Cilium Gateway API
If your cluster already runs Cilium as the CNI, enabling Gateway API support is a natural evolution. Cilium’s Gateway API implementation leverages eBPF for high-performance packet processing, avoiding the overhead of userspace proxy hops entirely. It is deeply integrated with Cilium’s network policy model and observability stack (Hubble).
Trade-offs: This option is only relevant if you are already committed to Cilium as your CNI, or are willing to make that switch simultaneously. Migrating both the CNI and the ingress layer at the same time is a significant operational risk. For Cilium shops, however, this consolidates complexity and provides excellent performance and observability.
HAProxy Ingress
HAProxy Ingress Controller is maintained by the HAProxy Technologies team and has a strong reputation for raw performance and precise traffic control. It supports both Ingress and Gateway API and has a long track record in high-throughput production environments. For teams with existing HAProxy expertise, it provides a familiar mental model for load balancing configuration.
Trade-offs: Smaller community than Traefik or NGINX. Less ecosystem tooling and fewer tutorials. Best suited for teams that specifically want HAProxy’s capabilities (fine-grained connection management, advanced health checking, TCP/HTTP mode flexibility) rather than as a default choice.
Kong Ingress Controller
Kong bridges the gap between an Ingress controller and a full API gateway. It supports Ingress and Gateway API resources alongside its own Kong-native plugin system for authentication, rate limiting, transformation, and observability. For teams that need API gateway capabilities rather than pure L7 routing, Kong provides a unified platform.
Trade-offs: Kong adds operational complexity. Running Kong requires either a PostgreSQL database (DB-mode) or careful management of declarative configuration (DB-less mode). The plugin ecosystem is powerful but introduces additional configuration surface. For teams that just need ingress routing, Kong may be more than necessary. For teams building API platforms, it is worth the overhead.
Istio Gateway
Istio’s ingress gateway (now aligned with Gateway API via its Kubernetes Gateway API integration) provides entry-point traffic management as part of a full service mesh. If your organization is planning or running Istio for east-west traffic, using Istio’s gateway for north-south traffic creates a unified data plane (Envoy) and consistent observability across all service communication.
Trade-offs: Istio is a serious operational commitment. The control plane overhead, the learning curve, and the impact on pod scheduling and sidecar management are significant. Choosing Istio purely for ingress replacement is like buying a race car because you needed a vehicle with good brakes. Consider this path only if service mesh capabilities are on your roadmap.
NGINX Gateway Fabric (F5’s Gateway API implementation)
F5/NGINX is building NGINX Gateway Fabric as their strategic forward path — an NGINX-based implementation of the Kubernetes Gateway API. For teams heavily invested in NGINX and wanting to stay in that ecosystem while moving to Gateway API, this provides a migration path within familiar territory. It is still maturing but represents where F5 is putting its development resources.
Comparison Matrix
Controller
Ingress API
Gateway API
Maturity
Best For
Complexity
ingress-nginx
Yes
Partial
High
Existing deployments, familiar config
Low
Traefik
Yes
Yes
High
General purpose, rapid migration
Low-Medium
Envoy Gateway
No
Yes (native)
Medium
Greenfield, future-aligned
Medium
Cilium Gateway
Yes
Yes
Medium
Cilium CNI clusters
Low (if Cilium)
HAProxy Ingress
Yes
Yes
High
High-throughput, HAProxy expertise
Medium
Kong
Yes
Yes
High
API gateway requirements
High
Istio Gateway
Via Gateway API
Yes
High
Service mesh adopters
Very High
NGINX Gateway Fabric
No
Yes (native)
Low-Medium
NGINX shops moving to Gateway API
Medium
Gateway API: The Strategic Direction You Cannot Ignore
The Kubernetes Gateway API is not simply “Ingress v2.” It is a fundamentally richer traffic management model designed to address the limitations that drove teams to annotation-based workarounds for the past several years. Understanding it is essential regardless of which controller you choose, because the ecosystem is clearly converging on it.
The core resource hierarchy consists of GatewayClass (defines a type of gateway, created by infrastructure providers), Gateway (a specific instance of a listener configuration, typically managed by platform teams), and HTTPRoute, TCPRoute, GRPCRoute, and other route resources (managed by application teams). This separation of concerns maps cleanly onto organizational roles — infrastructure teams control the gateway, application teams control their routing rules.
Gateway API reached v1.0 (GA for HTTPRoute and Gateway) in October 2023, and v1.1 followed in 2024 with GRPCRoute graduation and expanded features. The project has broad support across controllers (Traefik, Envoy Gateway, Cilium, NGINX Gateway Fabric, Kong, Istio, and others all implement it). The Ingress API is not being removed from Kubernetes, but new feature development is effectively frozen — Gateway API is where capabilities like traffic weighting, header manipulation, request mirroring, and backend protocol configuration are being built.
Decision Framework: Stay, Migrate, or Evaluate?
There is no universal right answer. The following framework helps teams make a context-appropriate decision rather than following hype or panic.
Stay on ingress-nginx if:
You have patched to 1.11.5+ or 1.12.1+ and have disabled or hardened the admission webhook
Your cluster is stable, heavily annotation-dependent, and migration cost outweighs risk
You have internal NGINX expertise and can take ownership of monitoring the project’s maintenance health
Your organization has a short-term horizon (decommissioning or major platform change within 12-18 months)
Migrate now if:
You are running the F5/NGINX IC with a support contract that is being deprecated
Your cluster has moderate annotation complexity and you have engineering cycles available
You are planning a major Kubernetes version upgrade or cluster rebuild — do it at the same time
Your security team has flagged the CVE history as unacceptable for your risk profile
You are building a new cluster or platform team and want to standardize on Gateway API from the start
Evaluate before committing if:
Your workloads have complex traffic requirements (WebSockets, gRPC, canary deployments, header-based routing) that differ significantly across controllers
You are considering Gateway API but the specific controllers in your environment have not graduated their Gateway API implementations yet
You have multi-cluster or multi-tenant requirements that change the analysis
You need to assess total cost including commercial support, tooling changes, and team retraining
Migration Checklist
For teams that have decided to migrate, the following sequence reduces risk and ensures nothing critical is missed:
Phase 1: Inventory and Assessment
Enumerate all Ingress resources across all namespaces and document their annotations
Identify annotations with no direct equivalent in your target controller
Document any custom NGINX configuration snippets (nginx.ingress.kubernetes.io/configuration-snippet, server-snippet) — these are high-risk items that require manual translation
Inventory any rate limiting, authentication, or WAF configurations layered on the controller
# Enumerate all ingress resources and their annotations across the cluster
kubectl get ingress -A -o json | jq -r '
.items[] |
{
namespace: .metadata.namespace,
name: .metadata.name,
annotations: (.metadata.annotations // {} | keys)
}
'
Phase 2: Target Controller Validation
Deploy target controller to a non-production cluster with identical Ingress/HTTPRoute resources
Validate TLS termination, redirect behavior, and timeout configurations
Run load tests to confirm performance characteristics match expectations
Validate observability — metrics, logs, and traces integrate with your existing stack
Test failure scenarios: backend unavailability, certificate expiry, controller pod restart
Phase 3: Staged Production Migration
Deploy new controller to production alongside existing controller (different IngressClass)
Migrate low-risk, low-traffic Ingress resources first by updating their ingressClassName
Use DNS-based canary switching (weighted routing at the DNS level) rather than switching entire IngressClass at once
Monitor error rates and latency for 24-48 hours after each batch migration
Migrate critical services during low-traffic windows with rollback plan documented
Decommission old controller only after all resources are migrated and validated
# Migrate individual Ingress to new controller by changing ingressClassName
kubectl patch ingress my-app -n my-namespace \
--type='json' \
-p='[{"op": "replace", "path": "/spec/ingressClassName", "value": "traefik"}]'
# Or if migrating to Gateway API, create equivalent HTTPRoute first,
# test it, then remove the old Ingress resource
kubectl apply -f my-app-httproute.yaml
# Validate, then:
kubectl delete ingress my-app -n my-namespace
Phase 4: Gateway API Adoption (Optional but Recommended)
Install Gateway API CRDs if not already present (kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml)
Define GatewayClass resources matching your chosen controller
Migrate Ingress resources to HTTPRoute progressively, starting with simpler configurations
Update CI/CD pipelines and Helm charts to generate HTTPRoute instead of Ingress resources for new services
Establish a policy: new services use Gateway API; legacy services migrate on their next significant update
Recommendation
For most platform engineering teams reading this in 2025, the pragmatic recommendation is as follows:
Short term (next 30 days): Patch ingress-nginx to the latest release if you are still on it. Assess and harden or disable the admission webhook. This is not optional.
Medium term (3-6 months): Evaluate Traefik or Envoy Gateway against your specific workload requirements. Traefik is the lower-friction migration for teams coming from ingress-nginx on the Ingress API. Envoy Gateway is the stronger strategic choice if you are willing to commit to Gateway API fully. Either way, run a parallel deployment in a non-production environment and measure the delta in operational overhead.
Long term (6-18 months): Plan migration to Gateway API resources regardless of which data plane you choose. The Ingress API will not disappear overnight, but feature parity with Gateway API capabilities will never arrive. Teams that standardize on Gateway API now build the institutional knowledge that will be valuable as the ecosystem continues to evolve.
If you are running F5/NGINX IC under a support contract: engage your F5 account team now to get a clear timeline on the deprecation path and evaluate NGINX Gateway Fabric as a within-ecosystem migration before looking at alternatives. The question is not whether to migrate but when and to what.
Avoid the temptation to treat this as a purely technical decision. The switch of an ingress controller touches CI/CD pipelines, monitoring dashboards, runbooks, on-call playbooks, and engineering team knowledge. Factor in the total transition cost, not just the YAML changes.
Frequently Asked Questions
Is the Kubernetes Ingress API being deprecated or removed?
No. The networking.k8s.io/v1 Ingress API is not deprecated and there are no current plans to remove it from Kubernetes. It will continue to work. What is happening is that the Kubernetes SIG Network has frozen new feature development on the Ingress API and is directing all new traffic management capabilities to Gateway API. In practical terms, if you need a capability that Ingress does not currently provide, you will not get it through Ingress. You will need Gateway API. Existing Ingress resources will continue to function for the foreseeable future.
Can I run two Ingress controllers simultaneously during migration?
Yes, and this is the recommended approach for production migrations. Kubernetes supports multiple IngressClass resources in a cluster, each backed by a different controller. Ingress resources select their controller via the spec.ingressClassName field (or the legacy kubernetes.io/ingress.class annotation). You can run ingress-nginx and Traefik side-by-side, migrating individual Ingress resources by updating their ingressClassName. Once migration is complete and validated, decommission the old controller. Just ensure both controllers are not both marked as the default IngressClass simultaneously, as this causes conflicts.
What happens to cert-manager if I switch controllers?
cert-manager is independent of your Ingress controller and will continue to work regardless of which controller you use. The HTTP-01 challenge solver in cert-manager creates temporary Ingress resources to complete ACME challenges — these will use whichever IngressClass you configure in your Issuer or ClusterIssuer. If you migrate to Gateway API, cert-manager has added Gateway API support (HTTPRoute-based HTTP-01 challenges) starting from version 1.14. DNS-01 challenges are entirely unaffected by controller choice. Update your Issuer configuration to reference the new IngressClass during migration.
How severe is the performance difference between ingress-nginx and alternatives?
For the vast majority of production workloads, the performance difference between mature controllers (ingress-nginx, Traefik, HAProxy, Envoy) is not the deciding factor. All of them can handle tens of thousands of requests per second on reasonable hardware, and the bottleneck is typically the backend services, not the ingress layer. The notable exception is Cilium with eBPF-based forwarding, which eliminates userspace proxy overhead entirely and can show measurable latency reduction at high percentiles for latency-sensitive workloads. If you are running at a scale where ingress controller throughput is actually the constraint, you already have the engineering resources to benchmark your specific workload profile against candidate controllers before committing.
Should we just move everything to a cloud provider’s managed load balancer and skip the in-cluster controller?
This is a legitimate option for teams on managed Kubernetes (EKS, GKE, AKS). Cloud-native load balancers (AWS ALB via AWS Load Balancer Controller, GKE Gateway, Azure Application Gateway Ingress Controller) eliminate the operational burden of managing an in-cluster controller and integrate deeply with cloud IAM, WAF, and observability services. The trade-offs are cost (cloud LBs charge per rule and per hour), vendor lock-in, and reduced portability. For purely cloud-native workloads with no multi-cloud or on-premises requirements, cloud-managed load balancers are worth serious consideration and sidestep the ingress-nginx problem entirely. For hybrid or multi-cluster environments, in-cluster controllers maintain an advantage in consistency and portability.
Prometheus has become the de facto standard for metrics collection in cloud-native environments. Its pull-based model, powerful query language, and deep Kubernetes integration make it an obvious choice for platform teams. But as organizations scale — more services, more replicas, more labels — Prometheus starts showing cracks. Queries slow down, memory usage balloons, and what was once a reliable monitoring backbone becomes an operational liability. This article examines exactly why that happens and what you can do about it, from quick tactical fixes to full architectural overhauls.
The Cardinality Problem: Why It Kills Prometheus
Cardinality is the single most important concept to understand when troubleshooting Prometheus scalability. In the context of time series databases, cardinality refers to the total number of unique label combinations that exist across all your metrics. Every unique combination creates a distinct time series, and Prometheus must store, index, and query each of them independently.
Consider a simple HTTP request counter: http_requests_total. If you label it with method (GET, POST, PUT, DELETE), status_code (200, 201, 400, 404, 500, 503), and endpoint (50 distinct API paths), you already have 4 × 6 × 50 = 1,200 time series from a single metric. Now add a customer_id label with 10,000 distinct values. You have just created 12 million time series from one counter.
This is the cardinality explosion pattern, and it is the most common cause of Prometheus degradation in production. The problem is compounded by labels that have unbounded or high-entropy values:
User IDs or session tokens embedded in labels
Request IDs or trace IDs (effectively infinite cardinality)
Pod names without proper aggregation, especially in autoscaling environments
Free-form error messages or SQL query strings
IP addresses, particularly in environments with high churn
The relationship between cardinality and resource consumption is not linear — it is roughly proportional but carries significant overhead per series in memory indexing structures. Prometheus stores its head block (the most recent data) entirely in memory. Each time series in the head block requires approximately 3–4 KB of RAM for the series itself plus index entries. A Prometheus instance with 1 million active time series will typically consume 4–6 GB of RAM just for the head block, before accounting for query processing overhead.
Memory Explosion Patterns and Real Symptoms
Memory issues in Prometheus rarely announce themselves cleanly. Instead, they manifest through a cascade of symptoms that are easy to misdiagnose. Understanding the failure modes helps you identify the root cause faster and apply the right remedy.
The Head Block Growth Pattern
Prometheus keeps a two-hour window of data in memory as the head block before compacting it to disk. If your series count grows continuously — which happens when pod churn creates new series faster than old ones expire — the head block never shrinks. You can monitor this directly with prometheus_tsdb_head_series and prometheus_tsdb_head_chunks. A healthy instance shows this number plateauing. A cardinality problem shows it growing monotonically until OOM.
Query Timeout Cascades
As series count grows, even well-written PromQL queries that worked fine at 100k series become unbearably slow at 1M. Grafana dashboards start timing out, alert evaluation lags behind schedule, and Alertmanager begins receiving delayed or duplicated firing alerts. The prometheus_rule_evaluation_duration_seconds metric is a reliable early warning — when p99 evaluation time for your recording rules exceeds your evaluation interval, you have a problem.
Scrape Failures Under Memory Pressure
When Prometheus is under heavy memory pressure, its Go garbage collector starts spending more time collecting, which introduces latency into the scrape loop. Scrapes begin timing out, causing gaps in your data. This creates a deceptive situation where you have gaps in metrics precisely when your system is under stress — exactly when you need monitoring most. Watch up metric drops and prometheus_target_scrapes_exceeded_sample_limit_total for these patterns.
Compaction Pressure
High cardinality also stresses the TSDB compaction process. Prometheus compacts head block data into persistent blocks every two hours. With millions of series, compaction can take tens of seconds to minutes, during which write performance degrades. prometheus_tsdb_compaction_duration_seconds rising above 30 seconds is a warning sign. Compaction failures leave orphaned blocks on disk, gradually consuming storage and potentially corrupting the TSDB if left unaddressed.
Short-Term Fixes: Tactical Remediation
When you are dealing with a Prometheus instance under active stress, you need immediate relief before you can implement architectural changes. These techniques can be applied quickly and provide meaningful headroom while longer-term solutions are planned.
Recording Rules: Pre-Computing Aggregations
Recording rules are the most underutilized tool in the Prometheus toolbox. They allow you to pre-compute expensive PromQL expressions and store the results as new time series. The key benefit for scalability is that you can aggregate away high-cardinality dimensions, dramatically reducing the number of series that dashboards and alerts need to query at runtime.
Consider an example where you have per-pod HTTP request rates with labels for pod, namespace, service, method, and status_code. Your dashboards mostly need service-level aggregations, not per-pod breakdowns. A recording rule can produce that aggregation once per evaluation interval:
groups:
- name: http_aggregations
interval: 30s
rules:
- record: job:http_requests_total:rate5m
expr: |
sum by (job, namespace, method, status_code) (
rate(http_requests_total[5m])
)
- record: job:http_request_duration_seconds:p99_5m
expr: |
histogram_quantile(0.99,
sum by (job, namespace, le) (
rate(http_request_duration_seconds_bucket[5m])
)
)
- record: namespace:http_requests_total:rate5m
expr: |
sum by (namespace, status_code) (
rate(http_requests_total[5m])
)
Notice that the pod label is dropped in all three rules. If you had 500 pods, you have just reduced the cardinality of these series by a factor of 500. Dashboards querying job:http_requests_total:rate5m instead of computing rate(http_requests_total[5m]) on the fly will return results orders of magnitude faster.
The naming convention level:metric:operations is the Prometheus community standard. Following it consistently makes recording rules self-documenting and helps teams understand the aggregation level at a glance.
Metric Dropping via Relabeling
Relabeling gives you surgical control over what metrics Prometheus actually ingests. There are two stages where relabeling applies: relabel_configs (applied before scraping, based on target metadata) and metric_relabel_configs (applied after scraping, based on scraped metric names and labels). For cardinality control, metric_relabel_configs is your primary tool.
Dropping entire metric families that you do not use is the most impactful change you can make. Many exporters emit dozens of metrics that are irrelevant for most use cases:
scrape_configs:
- job_name: kubernetes-pods
metric_relabel_configs:
# Drop metrics we never query
- source_labels: [__name__]
regex: 'go_gc_.*|go_memstats_.*|process_.*'
action: drop
# Drop high-cardinality label values while keeping the metric
- source_labels: [__name__, pod]
regex: 'http_requests_total;.*'
target_label: pod
replacement: ''
# Drop entire time series based on label combinations
- source_labels: [__name__, le]
regex: 'http_request_duration_seconds_bucket;(\+Inf|100|250|500)'
action: keep
# Replace high-cardinality endpoint paths with normalized versions
- source_labels: [endpoint]
regex: '/api/v1/users/[0-9]+'
target_label: endpoint
replacement: '/api/v1/users/:id'
Be careful with metric_relabel_configs — they are applied per scraped sample, so computationally expensive regex patterns across high-frequency scrapes can add CPU overhead. Test regex patterns and prefer anchored, non-backtracking expressions.
Cardinality Limits as a Safety Net
Prometheus 2.x introduced per-scrape sample limits as a defensive mechanism. These do not solve cardinality problems but prevent a single misbehaving exporter from taking down your entire Prometheus instance:
global:
# Global limit across all scrapes
sample_limit: 0 # 0 = no limit
scrape_configs:
- job_name: application-pods
# Reject scrapes that return more than 50k samples
sample_limit: 50000
# Limit unique label sets per scrape
label_limit: 64
# Limit label name and value lengths
label_name_length_limit: 256
label_value_length_limit: 1024
kubernetes_sd_configs:
- role: pod
When a scrape exceeds sample_limit, Prometheus rejects the entire scrape and marks the target as having failed. This is a hard circuit breaker, not a graceful degradation — the target’s up metric goes to 0. Set limits conservatively above your expected maximum to avoid false positives, and alert on prometheus_target_scrapes_exceeded_sample_limit_total > 0.
Architectural Solutions: Federation and Remote Write
Once you have exhausted tactical optimizations or when your scale genuinely exceeds what a single Prometheus instance can handle, architectural changes become necessary. Prometheus offers two built-in mechanisms for scaling horizontally: federation and remote_write.
Federation: Hierarchical Scraping
Prometheus federation allows one Prometheus instance to scrape aggregated metrics from other Prometheus instances via the /federate endpoint. In a typical setup, leaf-level Prometheus instances collect raw metrics from targets, while a global Prometheus instance federates pre-aggregated recording rule results from the leaves.
Federation works well for multi-region global dashboards and cross-cluster alerting on aggregated signals. Its limitations are significant, though: the /federate endpoint is a point-in-time snapshot, so you cannot run range queries against federated data effectively. It also creates a single point of failure at the global layer and does not provide true long-term storage. For those requirements, remote_write is the better path.
Remote Write: Streaming to Durable Storage
Remote write allows Prometheus to stream all ingested samples to an external storage backend in real time. The external backend handles long-term retention, multi-tenancy, and global query federation. Prometheus itself becomes a stateless collection agent that maintains only a short local retention window for resilience against network outages.
remote_write:
- url: https://thanos-receive.monitoring.svc:19291/api/v1/receive
# Authentication for the remote endpoint
basic_auth:
username: prometheus
password_file: /etc/prometheus/secrets/remote-write-password
# Tune the write queue for throughput vs. latency
queue_config:
# Number of shards (parallel write connections)
max_shards: 200
min_shards: 1
# Samples to batch before flushing
max_samples_per_send: 500
# Time to wait before flushing an incomplete batch
batch_send_deadline: 5s
# In-memory buffer capacity per shard
capacity: 2500
# How long to retry failed writes
min_backoff: 30ms
max_backoff: 5s
# Metadata configuration
metadata_config:
send: true
send_interval: 1m
# Filter what gets remote-written (reduce egress)
write_relabel_configs:
- source_labels: [__name__]
regex: 'go_gc_.*|go_memstats_.*'
action: drop
The queue_config tuning is critical and frequently misunderstood. Each shard maintains its own connection to the remote endpoint and its own in-memory queue. Increasing max_shards increases parallelism and throughput but also increases memory consumption and load on the remote endpoint. The right values depend heavily on your sample ingestion rate and network latency to the remote endpoint. Monitor prometheus_remote_storage_queue_highest_sent_timestamp_seconds versus prometheus_remote_storage_highest_timestamp_in_seconds — the lag between them tells you how far behind your remote write queue is.
Long-Term Solutions: Thanos vs Grafana Mimir vs VictoriaMetrics
For production systems that need long-term storage, global query capability, high availability, and genuine horizontal scalability, purpose-built solutions are the right answer. Three projects dominate this space: Thanos, Grafana Mimir, and VictoriaMetrics. They share similar goals but differ significantly in architecture, operational complexity, and trade-offs.
Criterion
Thanos
Grafana Mimir
VictoriaMetrics
Architecture
Sidecar + object store; modular components
Fully distributed; Cortex-derived microservices
Single binary or cluster mode
Storage backend
Any S3-compatible object store
Any S3-compatible object store
Own TSDB format on local or object store
PromQL compatibility
Full PromQL; own query engine
Full PromQL; Mimir-specific extensions
MetricsQL (PromQL superset)
Operational complexity
Medium — multiple components, each simple
High — many microservices with complex config
Low — minimal components, simple config
Ingest scalability
Scales via Thanos Receive fan-out
Horizontally scalable distributors + ingesters
Excellent; handles millions of samples/sec per node
Query performance
Good; Store Gateway caches object store data
Good; query sharding and caching built in
Excellent; highly optimized query engine
Multi-tenancy
Limited; tenant isolation via external labels
Native; per-tenant limits and isolation
Enterprise only; basic in cluster mode
Deduplication
Built-in; replica dedup at query time
Built-in; ingest-time and query-time dedup
Built-in; dedup with downsampling
Downsampling
Yes; Thanos Compactor handles it
Yes; configurable per tenant
Yes; automatic with vmbackupmanager
License
Apache 2.0 (fully open source)
AGPL-3.0 (open source) + enterprise tier
Apache 2.0 (community); proprietary enterprise
Best fit
Teams already running Prometheus wanting minimal disruption
Large orgs needing multi-tenant SaaS-grade monitoring
Teams prioritizing simplicity and raw performance
Thanos: The Incremental Path
Thanos integrates with existing Prometheus deployments through a sidecar process that runs alongside each Prometheus pod. The sidecar uploads completed TSDB blocks to object storage (S3, GCS, Azure Blob) and exposes a gRPC Store API that Thanos Query uses to federate queries across all Prometheus instances plus historical data in the object store. This makes Thanos the lowest-friction path for teams with existing Prometheus infrastructure.
Thanos Receive is an alternative ingest path that accepts remote_write directly, which is useful when you want to decouple Prometheus instances from the query layer or implement active-active HA without relying on Prometheus replication. Thanos Compactor handles block compaction and downsampling on the object store, creating 5-minute and 1-hour resolution downsamples automatically for efficient long-range queries.
Grafana Mimir: Enterprise-Grade Multi-Tenancy
Mimir is a fork of Cortex, rewritten by Grafana Labs to address operational complexity issues in Cortex’s architecture. It follows the same microservices pattern — Distributor, Ingester, Querier, Query Frontend, Store Gateway, Compactor, Ruler — but with significantly improved defaults and a monolithic deployment mode that simplifies small-scale deployments. Mimir’s headline feature is native multi-tenancy with per-tenant cardinality limits, query limits, and ingestion rate limits enforced at the distributor layer.
Mimir is the right choice when you need to run monitoring as an internal platform service for multiple teams or business units, each with independent resource quotas and data isolation. The operational overhead is substantial, but for large organizations it is justified by the isolation and governance capabilities.
VictoriaMetrics: Simplicity and Raw Performance
VictoriaMetrics takes a fundamentally different approach: rather than building on top of Prometheus’s TSDB format, it implements its own highly optimized storage engine. The result is dramatically better compression (often 5–10x better than Prometheus TSDB) and query performance that consistently outperforms Thanos and Mimir in benchmarks, particularly for high-cardinality workloads and large time ranges. The single-node binary handles workloads that would require a full Thanos cluster, and the cluster version adds horizontal scalability with fewer moving parts than Thanos or Mimir.
VictoriaMetrics also supports MetricsQL, a superset of PromQL that adds useful functions like outlierIQR(), limitOffset(), and improved histogram handling. Grafana datasource compatibility is maintained through a PromQL-compatible API, so existing dashboards work without modification.
Practical Guide: Choosing Your Scaling Approach
The right solution depends on your current scale, team capacity, and trajectory. This is not a one-size-fits-all decision. Here is a pragmatic framework for matching the solution to the problem.
Stage 1: Under 1 Million Active Series
A single Prometheus instance with proper tuning should handle this comfortably. Focus on recording rules to eliminate expensive dashboard queries, implement metric_relabel_configs to drop unused metrics, and set sample_limit guards. Increase Prometheus memory limits to give it adequate headroom (at minimum 8 GB, ideally 16 GB for instances approaching 1M series). Set --storage.tsdb.retention.time to the minimum that satisfies your compliance and debugging needs — 15 days is often enough if you have remote_write configured to a longer-term store.
Stage 2: 1–5 Million Active Series
At this scale, a single instance is viable but requires vertical scaling and aggressive optimization. Consider sharding your Prometheus deployment by functional area: one instance for infrastructure metrics, one for application metrics, one for business metrics. This is horizontal scaling via functional decomposition, not true distributed architecture. Add remote_write to object storage for long-term retention. If you are running Kubernetes, the Prometheus Operator with multiple Prometheus custom resources per namespace group is a clean implementation of this pattern.
This is also the stage where VictoriaMetrics single-node becomes compelling — it can handle this range comfortably with far less RAM than Prometheus and simpler operations than a full distributed system.
Stage 3: 5 Million+ Active Series or Global Requirements
At this scale, a distributed architecture is necessary. Your choice among Thanos, Mimir, and VictoriaMetrics Cluster depends primarily on:
Existing Prometheus investment + incremental migration: Thanos Sidecar is the path of least resistance. Your existing Prometheus instances keep working; you add sidecars and deploy Thanos query components.
Multi-tenant platform with governance requirements: Grafana Mimir, accepting the operational complexity in exchange for native tenant isolation and limits.
Maximum performance with minimal operational burden: VictoriaMetrics Cluster, replacing Prometheus entirely or alongside it via remote_write, with dramatically simpler operations than Thanos or Mimir.
Multi-region, cross-cloud global monitoring: Thanos or Mimir, both have mature multi-region architectures; VictoriaMetrics Enterprise has similar capabilities but is not open source.
Complementary Configuration: Thanos Sidecar Example
For teams adopting Thanos, the sidecar configuration alongside a Prometheus deployment looks like this in a Kubernetes environment:
# Thanos sidecar configuration (as part of Prometheus pod spec)
containers:
- name: prometheus
image: prom/prometheus:v2.48.0
args:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
# Keep 2h locally; Thanos handles long-term
- --storage.tsdb.retention.time=2h
# Thanos requires min-block-duration = max-block-duration for sidecar
- --storage.tsdb.min-block-duration=2h
- --storage.tsdb.max-block-duration=2h
- --web.enable-lifecycle
- name: thanos-sidecar
image: quay.io/thanos/thanos:v0.32.0
args:
- sidecar
- --tsdb.path=/prometheus
- --prometheus.url=http://localhost:9090
- --grpc-address=0.0.0.0:10901
- --http-address=0.0.0.0:10902
# Object store configuration
- --objstore.config-file=/etc/thanos/objstore.yml
volumeMounts:
- name: prometheus-data
mountPath: /prometheus
- name: thanos-objstore-config
mountPath: /etc/thanos
---
# Object store configuration (s3-compatible)
# /etc/thanos/objstore.yml
type: S3
config:
bucket: my-thanos-metrics
endpoint: s3.eu-west-1.amazonaws.com
region: eu-west-1
# Use IAM role or provide credentials via environment
access_key: ""
secret_key: ""
VictoriaMetrics as Remote Write Target
If you choose VictoriaMetrics as your remote storage backend, the integration with existing Prometheus instances is straightforward. VictoriaMetrics exposes a remote_write compatible endpoint at /api/v1/write:
VictoriaMetrics also exposes a Prometheus-compatible query API at /api/v1/query and /api/v1/query_range, so Grafana datasources pointing at it need only a URL change — no plugin installation required for basic use. For MetricsQL-specific functions, use the VictoriaMetrics datasource plugin available in Grafana’s plugin catalog.
Observing Your Prometheus Health
Before implementing any of these solutions, establish a baseline understanding of your Prometheus instance’s current health. The following PromQL expressions give you immediate visibility into the key indicators:
# Total active time series in the head block
prometheus_tsdb_head_series
# Series created vs. removed (churn indicator)
rate(prometheus_tsdb_head_series_created_total[5m])
rate(prometheus_tsdb_head_series_removed_total[5m])
# Memory usage of the head block chunks
prometheus_tsdb_head_chunks_storage_size_bytes
# Remote write lag (seconds behind)
(
prometheus_remote_storage_highest_timestamp_in_seconds
- prometheus_remote_storage_queue_highest_sent_timestamp_seconds
)
# Top cardinality contributors (requires Prometheus 2.14+)
# Run this in Prometheus /api/v1/query:
topk(20,
count by (__name__) ({__name__!=""})
)
# Alert evaluation lag
rate(prometheus_rule_evaluation_duration_seconds_sum[5m])
/ rate(prometheus_rule_evaluation_duration_seconds_count[5m])
Prometheus also exposes a /api/v1/status/tsdb endpoint that returns cardinality statistics including the top 10 metrics by series count and the top 10 label names by cardinality. This is invaluable for identifying which specific metrics or labels are causing problems and should be your first stop when investigating a new cardinality issue.
Frequently Asked Questions
How do I identify which metrics are causing my cardinality explosion?
Start with the /api/v1/status/tsdb endpoint on your Prometheus instance. It returns a JSON response with seriesCountByMetricName, seriesCountByLabelValuePair, and seriesCountByLabelName arrays, each showing the top contributors to your total series count. This points you directly at the offending metrics and labels without any external tooling. Complement this with topk(20, count by (__name__)({__name__!=""})) in PromQL, which gives you the same information in a queryable format you can alert on. Once you know the metric name, query count by (label1, label2) (your_metric_name) replacing label pairs to identify which specific label dimensions are driving the high count.
Can I run Prometheus in HA without external dependencies?
Yes, but with important caveats. The standard HA pattern for standalone Prometheus is to run two identical Prometheus instances scraping the same targets. Both instances collect data independently, and Alertmanager deduplicates alerts from both using its mesh clustering (run multiple Alertmanager instances in a cluster and point both Prometheus instances at all of them). This provides alerting HA — alerts fire even if one Prometheus instance is down. It does not provide query HA in the traditional sense, because each instance has its own independent data and queries against a failed instance simply fail. Dashboards pointing at a specific instance will show gaps during that instance’s downtime. For true query HA with failover and deduplication, you need Thanos Query (which can deduplicate replica series at query time using the replica external label) or a similar solution. Running Prometheus without any external dependencies means accepting these query HA limitations.
What is a safe maximum cardinality for a single Prometheus instance?
There is no universal number — it depends heavily on your scrape interval, available RAM, and query patterns. A practical guideline: allocate 3–4 GB of RAM per million active series for the head block alone, then add 50% headroom for query processing. A Prometheus instance with 16 GB of RAM can comfortably handle 2–3 million active series under typical workloads. Beyond 5 million series, even well-resourced single instances start showing query performance degradation that impacts alert evaluation reliability. The more meaningful limit to enforce operationally is series churn rate: an instance creating more than 100,000 new series per minute will struggle regardless of total series count, because the head block indexing operations become a bottleneck. Monitor rate(prometheus_tsdb_head_series_created_total[5m]) and treat sustained values above 50,000/minute as a warning condition.
Should I use Thanos Sidecar or Thanos Receive for ingestion?
The choice comes down to whether you want to keep Prometheus as the authoritative ingest layer or move toward a push-based architecture. Thanos Sidecar is the simpler, lower-risk option: Prometheus continues operating normally, the sidecar uploads completed blocks to object storage in the background, and you gain long-term storage and global query capability with minimal disruption. The drawback is that Prometheus must have local storage for at least 2 hours (one block duration), and the sidecar requires that min-block-duration equals max-block-duration, which prevents Prometheus from doing its own compaction. Thanos Receive accepts remote_write from any Prometheus instance, which enables active-active HA setups where multiple Prometheus replicas write to a Receive hashring simultaneously, and Receive handles deduplication. This is more complex to operate but provides better ingest-side redundancy. For most teams starting with Thanos, Sidecar is the right first step. Receive makes sense when you are building a centralized monitoring platform that accepts writes from many Prometheus instances across different clusters or environments.
Is it worth migrating from Thanos to VictoriaMetrics or Mimir once you are already running Thanos?
Migration from Thanos to an alternative should be driven by specific pain points, not by benchmark numbers alone. If your team is spending significant time operating Thanos (debugging query Store Gateway cache issues, managing compactor conflicts, handling block upload failures), and your primary need is simplicity and query performance rather than multi-tenancy, VictoriaMetrics is worth evaluating seriously. The migration path is smooth: run VictoriaMetrics alongside Thanos temporarily, migrate remote_write targets to VictoriaMetrics, and decommission Thanos once you are satisfied. Historical data in your object store can be imported using VictoriaMetrics’s vmctl tool. If your pain point is multi-tenancy and governance — multiple teams with independent data isolation, per-tenant rate limits, chargeback requirements — Mimir is the right destination and the operational complexity is justified. The one scenario where staying with Thanos is usually the right call is when your organization has invested heavily in Thanos tooling, has stable operations, and does not have specific unmet needs. Migration carries real costs in engineering time and operational risk; make sure the benefits are concrete and quantified before committing.
What is cardinality in Prometheus and why does it matter?
Cardinality is the number of unique time series — every distinct combination of metric name and label values is one series. Memory and query cost grow with it, and it is the usual reason a Prometheus that ran fine for months suddenly needs 3× the RAM: one new label like user_id or pod_ip can multiply series count overnight.
How do I find which metrics have the highest cardinality?
Ask the TSDB itself: topk(20, count by (__name__)({__name__=~".+"})) ranks metrics by series count, and the /api/v1/status/tsdb endpoint reports the top label pairs. Run these before and after deploying new exporters — cardinality regressions almost always arrive with new software, not gradually.
How many time series can a single Prometheus handle?
A well-resourced single instance handles millions of active series, with memory as the practical ceiling (roughly 1–3 KB per active series, plus query overhead). Past that, the options are reducing cardinality, sharding by scrape target, or moving long-term storage to Thanos, Mimir or VictoriaMetrics — in that order of effort.
How do I limit series growth from a misbehaving target?
Set sample_limit per scrape config so a target that explodes in cardinality gets its scrape dropped instead of taking down Prometheus, and watch prometheus_target_scrapes_exceeded_sample_limit_total to catch it happening. Relabeling (metric_relabel_configs) can drop high-cardinality labels at ingestion.
Kubernetes security is not a single feature you enable — it is a layered discipline that spans the control plane, workloads, networking, supply chain, and runtime. Get one layer wrong and the others rarely save you. This guide covers the controls that matter most in production, why each one exists, and how to implement them without breaking your cluster — plus a prioritized roadmap so you know what to do in your first week, not just an undifferentiated list of “best practices.”
Let me start with the part most hardening guides skip: what an actual attack looks like.
Anatomy of a Real Kubernetes Attack Chain
Abstract advice (“apply least privilege”) doesn’t land until you’ve seen how a single misconfiguration cascades. Here is a realistic chain — every step maps to a documented technique in the MITRE ATT&CK for Containers matrix. If you haven’t seen it before, ATT&CK is an industry-standard, openly maintained knowledge base of real-world adversary behavior: a catalogue of how attackers actually operate, organized by goal (initial access, credential access, lateral movement, and so on). It’s the common language security teams use to describe and defend against attacks.
Initial access. An application pod runs a vulnerable image — say, an unpatched dependency with a remote code execution (RCE) flaw, a bug that lets an attacker run arbitrary code on the host process. The attacker gets code execution inside the container. So far, container isolation should contain the blast radius.
Credential access. The pod has automountServiceAccountToken: true (the default). The attacker reads /var/run/secrets/kubernetes.io/serviceaccount/token — a valid API credential, handed to them for free.
Discovery. Using that token, the attacker queries the API server. The ServiceAccount was bound to a convenient cluster-admin role “to unblock a deploy.” Now they can list every Secret in every namespace.
Lateral movement. They read database credentials, cloud provider keys, and other ServiceAccount tokens from Secrets. The flat pod network (no NetworkPolicies) lets them reach internal services directly.
Privilege escalation / escape. They schedule a privileged pod with hostPID and the host filesystem mounted, then break out to the node. From the node, they reach the kubelet and other tenants’ workloads.
Impact. Crypto-mining, data exfiltration, or ransomware across the cluster.
Notice that steps 2 through 5 each had a one-line fix: disable token automount, scope the RBAC, encrypt Secrets / use an external store, apply default-deny NetworkPolicies, enforce Pod Security. Defense in depth means an attacker has to defeat every layer — and most attackers give up when the easy chain breaks. The rest of this guide is those layers, ordered by how much they shrink that chain.
The Kubernetes Attack Surface
Before hardening anything, understand what you are protecting. A Kubernetes cluster has several distinct attack surfaces:
API server — The central control plane. Any entity that can reach it with valid credentials can read cluster state, modify workloads, or escalate privileges.
etcd — Stores all cluster state in plain text, including Secrets. Direct etcd access is equivalent to root on every node.
Nodes — A compromised node can access all Secrets mounted on pods running on it, access the kubelet API, and potentially escape to the hypervisor.
Pods — Privileged pods, host-network pods, and pods with excessive capabilities can break container isolation.
Supply chain — Malicious images, compromised registries, and unsigned artifacts can introduce attacker-controlled code into your cluster.
RBAC — Overly permissive roles allow lateral movement and privilege escalation once an attacker gains any foothold.
Prioritize based on your threat model — a public-facing multi-tenant cluster needs all of these; an internal development cluster can relax some.
The First-Week Hardening Roadmap (Prioritized)
If you inherited a cluster with nothing in place, do not try to do everything at once. Order matters — some controls give huge risk reduction for minimal effort and zero breakage risk, others need careful rollout. This is the sequence I use:
Day
Control
Risk reduction
Breakage risk
1
Audit RBAC, remove stray cluster-admin, disable unused SA token automount
High
Low
1
Enable API server audit logging
Medium (visibility)
None
2
Pod Security Admission in warn + audit mode (all namespaces)
High
None (warn only)
3
Deploy image scanning in CI (Trivy/Grype), fail on Critical
High
Low
4
NetworkPolicies in audit-style rollout: default-deny in one namespace first
High
Medium — test DNS!
5
Enable etcd encryption at rest / move Secrets to external store
High
Low
6
Flip Pod Security Admission to enforce: baseline, then restricted per namespace
The single most important idea: roll out enforcing controls in observation mode first (warn/audit for Pod Security, default-deny NetworkPolicies in one namespace). You want to discover what breaks in a dashboard, not in an incident.
Tools to automate and report each step
You don’t have to do any of this by hand. Each step has tooling that both applies the control and reports on its state, so you can wire it into CI or a recurring job:
Day 4 — NetworkPolicies:Cilium Hubble or Calico flow logs to see the flows before you deny them; netpol-analyzer to check connectivity from manifests.
Day 5 — Secrets/etcd encryption: native EncryptionConfiguration; the External Secrets Operator to report drift against an external store.
Day 6–7 — Runtime + posture:Falco for runtime alerts, Trivy Operator and Kubescape for continuous, scheduled scans with exportable reports.
1. RBAC: Least Privilege from Day One
Role-Based Access Control is Kubernetes’ primary authorization mechanism. Most clusters fail at RBAC not because it is misconfigured, but because it is over-permissive by default and nobody reviews it systematically.
Common RBAC Mistakes
Binding to cluster-admin for convenience. Almost no workload needs cluster-admin. Use namespaced roles wherever possible.
Using * verbs or resources in roles. Wildcard permissions are almost always broader than intended.
Not auditing ServiceAccount token usage. Every pod gets a ServiceAccount. Custom workloads often get over-permissive SAs.
Forgetting automountServiceAccountToken: false. If a workload does not need to talk to the Kubernetes API, disable token mounting entirely — this single setting breaks step 2 of the attack chain above.
Practical RBAC Patterns
For a workload that only needs to read ConfigMaps in its own namespace:
Audit existing RBAC with kubectl-who-can or rbac-tool to find overly permissive bindings before attackers do. A useful one-liner: list every subject that can read Secrets cluster-wide with kubectl who-can get secrets.
2. Pod Security Standards (and Migrating off PodSecurityPolicy)
PodSecurityPolicy was deprecated in Kubernetes 1.21 and removed in 1.25. Its replacement is Pod Security Admission (PSA), a built-in admission controller that enforces one of three Pod Security Standards profiles at the namespace level:
Privileged — No restrictions. For system components only.
Baseline — Prevents the most critical privilege escalations: privileged containers, hostPID, hostIPC, hostNetwork, dangerous capabilities.
Restricted — Enforces current hardening best practices. Requires running as non-root, dropping all capabilities, and using a restricted seccomp profile.
Enable enforcement at the namespace level with labels:
A pod that runs as root or requests host-network in a namespace enforcing restricted will be rejected at admission. The warn and audit modes let you test before enforcing. For a full walkthrough of how PSA evaluates pods and how to roll it out, see my guide on understanding Pod Security Admission.
Migrating from PodSecurityPolicy to PSA
If you’re still on a cluster that used PSP, the migration path is:
Map your PSPs to the closest PSA level. Most “restricted” PSPs map to restricted; permissive ones to baseline. The official pspmigrator tool can suggest mappings.
Label every namespace in warn/audit mode matching that level — no enforcement yet.
Watch the audit logs and warnings for a release cycle. Fix the workloads that would be rejected (add securityContext, drop capabilities).
Flip to enforce namespace by namespace, starting with the least critical.
PSA is intentionally coarse-grained — three levels, namespace-scoped. For anything finer (per-team registries, required labels, custom mutation), you need a policy engine, which is the next section.
3. Policy Engines: Kyverno vs OPA Gatekeeper
Once you outgrow PSA’s three levels, you need an admission policy engine. The two standards are Kyverno and OPA Gatekeeper, and choosing between them is one of the most common platform decisions.
Kyverno
OPA Gatekeeper
Policy language
YAML (Kubernetes-native)
Rego (purpose-built DSL)
Learning curve
Low — looks like other manifests
Steep — Rego is its own paradigm
Mutation support
Yes, first-class
Limited
Image verification (Cosign)
Built-in
Via external data
Best when
Team wants fast adoption, K8s-only
Team already runs OPA across the stack
For most teams without existing Rego expertise, Kyverno is significantly faster to adopt and maintain. A Kyverno policy to require all images come from your private registry:
By default, every pod in a Kubernetes cluster can communicate with every other pod across all namespaces. This flat network model gives attackers unrestricted lateral movement once they compromise any workload (step 4 of the attack chain).
Network Policies define L3/L4 allow-rules for pod-to-pod communication. They are enforced by your CNI (Container Network Interface) plugin (Calico, Cilium, Weave — not Flannel, which does not support NetworkPolicy).
Default Deny Pattern
Start by denying all ingress and egress in a namespace, then open only what is explicitly needed:
The DNS Trap (the #1 reason default-deny “breaks everything”)
The most common NetworkPolicy support ticket: “I applied default-deny and the whole namespace stopped working.” The cause is almost always DNS. A default-deny egress policy blocks the pod from reaching kube-dns, so every name resolution fails and applications appear to hang or crash-loop.
Always pair default-deny egress with an explicit DNS allow rule:
Roll default-deny out in one namespace first, confirm DNS and required egress work, then expand. Tools like Cilium’s Hubble or Calico’s flow logs make it much easier to see exactly which flows you need to allow.
5. Secrets Management
Kubernetes Secrets are base64-encoded, not encrypted. They are stored in etcd in plain text by default. Anyone with get permission on Secrets can read them. This is not a vulnerability — it is a design decision that puts the responsibility on you to:
Enable encryption at rest for etcd. Configure EncryptionConfiguration with an AES-CBC or AES-GCM provider so Secrets are encrypted before being written to etcd.
Use external secret stores. HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault with the External Secrets Operator means actual secret values never live in Kubernetes at all.
Restrict Secret RBAC aggressively. Never give list on Secrets cluster-wide — it returns all values. Use get on named resources where possible.
Avoid environment variables for secrets. Prefer volume mounts. Env vars are visible in pod inspect output and can leak through application logging.
Your runtime security posture is only as good as the images you run. A compromised image from a public registry bypasses every runtime control you have.
# In your CI pipeline
trivy image --exit-code 1 --severity CRITICAL your-image:tag
Use a private registry with admission control
Only allow images from your private registry using an admission webhook (Kyverno, OPA Gatekeeper) — the policy in section 3 does exactly this. It prevents developers from running arbitrary public images in production.
Use distroless or minimal base images
Distroless images contain only the application and its runtime dependencies — no shell, no package manager, no debugging tools. This drastically reduces both the attack surface and the CVE count. Google’s distroless images are available for Java, Node.js, Python, and Go. (Related: debugging distroless containers when you do need to inspect one.)
Sign and verify images (and the SLSA angle)
Cosign (from the Sigstore project) lets you sign container images and verify signatures at admission time using Kyverno or Connaisseur. This prevents image-substitution attacks where an attacker replaces a legitimate image in your registry.
If you’re being asked about supply-chain compliance, the framework to know is SLSA (Supply-chain Levels for Software Artifacts). The practical progression: SLSA L1 = you have a build provenance document; L2 = it’s signed and the build is hosted; L3 = the build is hardened and non-falsifiable. Generating provenance with your CI (GitHub Actions has native SLSA generators) and verifying it at admission with Cosign + Kyverno gets you most of the way to L2/L3 without a platform rebuild.
7. Runtime Security
Runtime security detects and responds to malicious activity after a container is running. The primary tool is Falco — a CNCF project that uses eBPF (extended Berkeley Packet Filter — a Linux kernel technology for running sandboxed observability programs) to monitor system calls and raise alerts when containers behave unexpectedly.
Default Falco rules catch common attack patterns:
Shell spawned in a container
Network connection to an unexpected IP
Write to a sensitive file path (/etc/passwd, /etc/shadow)
Privilege escalation via setuid binaries
Container drift (new executable files written at runtime)
Combine Falco with seccomp profiles to restrict the system calls a container can make at the kernel level. The RuntimeDefault seccomp profile (a default option since Kubernetes 1.27) blocks 300+ system calls that containers virtually never need.
These four securityContext settings together (allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, runAsNonRoot: true, capabilities.drop: ALL) make container escape significantly harder and satisfy the Kubernetes Restricted pod security standard. They directly close step 5 of the attack chain.
8. API Server Hardening
The API server is the most critical component to harden. Key settings:
Disable anonymous authentication.--anonymous-auth=false ensures every request is authenticated.
Enable audit logging. Log all API server requests to a file or webhook. Without audit logs, you cannot investigate incidents or detect RBAC abuse.
Restrict admission plugins. Ensure NodeRestriction is enabled — it prevents node kubelets from modifying objects outside their own node.
Do not expose the API server to the internet. Use a VPN, bastion host, or private endpoint. If you must expose it, restrict access by IP.
# Minimal audit policy - log all requests at metadata level,
# and full request body for sensitive resources
apiVersion: audit.k8s.io/v1
kind: Policy
rules:
- level: RequestResponse
resources:
- group: ""
resources: ["secrets", "configmaps"]
- level: Metadata
omitStages: ["RequestReceived"]
9. etcd Security
etcd stores all cluster state. Treat it as sensitive as your production database:
Enable TLS for all etcd communication — both peer (etcd-to-etcd) and client (apiserver-to-etcd) with mutual TLS.
Restrict network access to etcd. It should only be reachable by the API server. Use firewall rules or security groups.
Enable encryption at rest (see Secrets section).
Back up etcd regularly. A snapshot is a complete copy of all cluster state, including all Secrets. Encrypt backups and store them separately from the cluster.
10. Multi-Tenancy Isolation
If multiple teams or customers share a cluster, namespace boundaries alone are not a security boundary — they’re an organizational one. Hardening multi-tenant clusters adds requirements on top of everything above:
Namespace-per-tenant with ResourceQuotas and LimitRanges to prevent noisy-neighbor and resource-exhaustion DoS.
NetworkPolicies that deny cross-namespace traffic by default, so tenant A cannot reach tenant B’s pods.
A policy engine enforcing per-tenant rules (allowed registries, required labels, no hostPath).
Separate node pools for untrusted workloads, or a sandboxed runtime (gVisor, Kata Containers) when you run genuinely untrusted code.
For hard multi-tenancy (untrusted tenants), the honest answer is that vanilla namespaces aren’t enough — consider virtual clusters (vCluster) or separate clusters entirely. Soft multi-tenancy (trusted internal teams) is well served by the controls in this guide.
11. Benchmarks and Continuous Posture
CIS Kubernetes Benchmark
The CIS Kubernetes Benchmark is a comprehensive checklist covering the control plane, nodes, and workloads. Running kube-bench gives you a scored assessment:
kube-bench outputs PASS/FAIL/WARN for each control with remediation guidance. Run it after initial cluster setup and after major configuration changes.
Continuous scanning with Trivy Operator / Kubescape
Kubescape and the Trivy Operator provide continuous security scanning of live cluster state — not just a one-time audit. They check workloads against NSA/CISA hardening guidelines, the MITRE ATT&CK framework, and the CIS benchmark in real time.
Trivy Operator creates VulnerabilityReport, ConfigAuditReport, and RbacAssessmentReport custom resources alongside each workload. Scrape them with Prometheus and build a security dashboard in Grafana.
Security Hardening Checklist
✅ RBAC reviewed — no wildcard roles, no unnecessary cluster-admin bindings
✅ ServiceAccount token automount disabled for workloads that do not need API access
✅ Pod Security Standards enforced at namespace level (at least Baseline, Restricted where possible)
✅ Policy engine (Kyverno/Gatekeeper) enforcing registry, label, and mutation rules
✅ Secrets encrypted at rest in etcd or moved to an external store
✅ Images scanned in CI — no critical CVEs in production
✅ Private registry enforced via admission control
✅ Image signing + verification (Cosign) and build provenance (SLSA)
✅ Container securityContext hardened (non-root, read-only fs, no capabilities)
✅ seccomp RuntimeDefault profile enabled
✅ API server audit logging enabled, anonymous auth disabled
✅ etcd TLS and network access restricted
✅ Multi-tenancy isolation (quotas, cross-namespace deny) if shared
✅ kube-bench run and critical/high findings remediated
✅ Runtime security (Falco) deployed and alerts routed to on-call
✅ Continuous scanning (Trivy Operator or Kubescape) deployed
FAQ
Where do I start if my cluster has no security controls today?
Follow the first-week roadmap above. The short version: audit RBAC (revoke stray cluster-admin), enable Pod Security Admission in warn mode on all namespaces, and deploy image scanning + Trivy Operator. These give immediate visibility and stop the most common privilege escalations without breaking anything.
Does enabling Network Policies break DNS resolution?
Yes — this is the single most common failure. A default-deny egress policy blocks pods from reaching kube-dns, so name resolution fails. Add an egress rule allowing UDP and TCP port 53 to the kube-system namespace whenever you apply default-deny (see the DNS allow policy above).
Should I use OPA Gatekeeper or Kyverno?
Both enforce admission policies. Kyverno is Kubernetes-native (policies are YAML) while Gatekeeper uses Rego. For teams without Rego expertise, Kyverno is faster to adopt and supports mutation and Cosign verification out of the box. Choose Gatekeeper if you already run OPA elsewhere and want one policy language across your stack.
What replaced PodSecurityPolicy?
Pod Security Admission (PSA), built into Kubernetes since 1.25. It enforces three profiles (privileged/baseline/restricted) via namespace labels. For finer-grained control than PSA’s three levels, add Kyverno or Gatekeeper.
Is Kubernetes certified for PCI-DSS or SOC 2?
Kubernetes itself is not certified — your configuration and the controls you implement determine compliance. The CIS Kubernetes Benchmark maps to many PCI-DSS and SOC 2 requirements. Managed offerings (EKS, GKE, AKS) carry their own compliance certifications for the underlying infrastructure.
How often should I update Kubernetes for security patches?
Apply a patch release within 30 days for High/Critical CVEs. Minor version upgrades (e.g., 1.30 → 1.31) should happen within the support window — Kubernetes maintains the last three minor versions. Falling more than one minor behind means running without patches for a growing subset of the codebase.
Are namespaces a security boundary?
No. Namespaces are an organizational boundary. Real isolation between tenants requires NetworkPolicies, ResourceQuotas, a policy engine, and — for untrusted workloads — sandboxed runtimes (gVisor/Kata) or separate clusters.
ArgoCD has become the de facto standard for GitOps-based continuous delivery in Kubernetes. If you are running production workloads on Kubernetes and still deploying with raw kubectl apply or untracked Helm releases, ArgoCD solves a class of problems you may not even know you have yet. This guide covers everything from core concepts to production-grade configuration.
The Problem ArgoCD Solves
Traditional CI/CD pushes deployments into a cluster. A CI system runs tests, builds an image, and then executes kubectl apply or helm upgrade against the cluster. This model has several structural problems:
Drift goes undetected. Someone applies a hotfix directly to the cluster. Now your Git repository no longer reflects reality, and nobody knows it.
No single source of truth. The cluster state is authoritative, not Git. Your desired state and actual state can diverge silently.
Rollback is painful. Rolling back a bad deployment means re-running old CI pipelines or manually reversing changes, neither of which is fast.
Multi-cluster management compounds the problem. Each cluster becomes a snowflake with its own history of undocumented changes.
GitOps inverts this model. Git is the source of truth. The cluster pulls its desired state from Git and continuously reconciles toward it. ArgoCD is the most mature GitOps operator for Kubernetes, implementing this pull-based model with a production-ready feature set.
How ArgoCD Works: Core Architecture
ArgoCD runs as a set of controllers inside your Kubernetes cluster. The core components are:
Application Controller — Watches both the Git repository and the live cluster state. Computes the diff and drives reconciliation.
API Server — Exposes the gRPC/REST API consumed by the CLI, UI, and external systems.
Repository Server — Generates Kubernetes manifests from source (Helm, Kustomize, plain YAML, Jsonnet).
Redis — Caches cluster state and repository data to reduce API server load.
Dex (optional) — Provides OIDC authentication for SSO integration.
The fundamental unit in ArgoCD is an Application — a CRD that maps a source (a path in a Git repo at a specific revision) to a destination (a namespace in a cluster). ArgoCD continuously compares the desired state from Git with the live state in the cluster and reports on the sync status.
Sync Status vs Health Status
Two orthogonal concepts you need to understand from day one:
Sync Status — Does the live state match what Git says it should be? Values: Synced, OutOfSync, Unknown.
Health Status — Is the application actually working? Values: Healthy, Progressing, Degraded, Suspended, Missing, Unknown.
An application can be Synced but Degraded — the manifests were applied correctly, but a pod is crash-looping. Conversely, it can be OutOfSync but Healthy — someone applied a change directly to the cluster outside of Git.
Installing ArgoCD
The official installation method uses a single manifest. For production, always pin to a specific version:
This deploys ArgoCD in the argocd namespace with full cluster-admin access. For a production HA setup, use the manifests/ha/install.yaml variant, which deploys multiple replicas of the API server and application controller.
Accessing the UI and CLI
The initial admin password is auto-generated and stored in a secret:
Applications can be created via the UI, the CLI, or declaratively with a YAML manifest. The declarative approach is the recommended one — it means your ArgoCD configuration itself is in Git:
targetRevision — Can be a branch name, tag, or commit SHA. For production, pin to a tag rather than HEAD.
path — The directory within the repo containing your Kubernetes manifests.
automated.prune — Automatically delete resources that are no longer in Git. Required for true GitOps but use carefully — it will delete things.
automated.selfHeal — Automatically revert manual changes made directly to the cluster. This is what enforces Git as the single source of truth.
Helm Integration
ArgoCD has native Helm support. It can deploy Helm charts directly from chart repositories or from your Git repository. You can override values per environment:
One important nuance: ArgoCD renders Helm charts server-side using its own templating engine, not helm install. This means Helm hooks (pre-install, post-upgrade, etc.) are supported, but the release is not tracked in Helm’s release history. Running helm list will not show ArgoCD-managed releases unless you configure ArgoCD to use the Helm secrets backend.
Projects: Multi-Tenancy and Access Control
ArgoCD Projects provide multi-tenancy within a single ArgoCD instance. They let you restrict which source repositories, destination clusters, and namespaces a team can deploy to. Every Application belongs to a Project.
Projects are where you define the boundaries of what each team can do. The default project has no restrictions — never use it for production workloads. Create dedicated projects per team or per environment.
RBAC Configuration
ArgoCD has its own RBAC system layered on top of Kubernetes RBAC. It is configured via the argocd-rbac-cm ConfigMap. Roles are defined per project or globally:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-rbac-cm
namespace: argocd
data:
policy.default: role:readonly
policy.csv: |
# Platform team has full access to platform-team project
p, role:platform-admin, applications, *, platform-team/*, allow
p, role:platform-admin, projects, get, platform-team, allow
p, role:platform-admin, repositories, *, *, allow
# Dev team can sync but not delete
p, role:developer, applications, get, */*, allow
p, role:developer, applications, sync, */*, allow
p, role:developer, applications, action/*, */*, allow
# Bind SSO groups to roles
g, your-org:platform-team, role:platform-admin
g, your-org:developers, role:developer
The policy.default: role:readonly ensures that any authenticated user who has no explicit role assignment gets read-only access — a safe default for production.
Multi-Cluster Management
ArgoCD can manage multiple Kubernetes clusters from a single control plane. Register external clusters with the CLI:
# First, ensure the target cluster context is in your kubeconfig
argocd cluster add production-eu-west --name production-eu-west
# Verify registration
argocd cluster list
ArgoCD will create a ServiceAccount in the target cluster and store its credentials as a Kubernetes secret in the ArgoCD namespace. Applications can then target this cluster by name in their destination.server field.
For large-scale multi-cluster setups, consider the App of Apps pattern or ApplicationSets. ApplicationSets are a controller that generates Applications dynamically based on generators — cluster lists, Git directory structures, or matrix combinations:
This single ApplicationSet deploys the appropriate addons to every cluster labeled environment: production, using each cluster’s region label to select the correct path in the repository.
Sync Strategies and Waves
When deploying complex applications with dependencies between resources, you need to control the order of deployment. ArgoCD provides two mechanisms:
Sync Phases
Resources are deployed in three phases: PreSync, Sync, and PostSync. Use Sync Hooks for resources that must complete before the main sync proceeds (database migrations, certificate issuance, etc.):
Within the Sync phase, waves control ordering. Resources with a lower wave number are applied and must become healthy before resources with higher wave numbers are applied:
# Applied first
metadata:
annotations:
argocd.argoproj.io/sync-wave: "1"
# Applied after wave 1 is healthy
metadata:
annotations:
argocd.argoproj.io/sync-wave: "2"
Notifications and Alerting
ArgoCD Notifications is a standalone controller that sends alerts when Application state changes. It supports Slack, PagerDuty, GitHub commit status, email, and a dozen other providers. Configure it via the argocd-notifications-cm ConfigMap:
ArgoCD intentionally has no secret management built in — storing secrets in Git as plain text is never acceptable. The common patterns are:
Sealed Secrets (Bitnami) — Encrypts secrets with a cluster-specific key. The encrypted secret can be committed to Git; only the cluster can decrypt it.
External Secrets Operator — Syncs secrets from Vault, AWS Secrets Manager, GCP Secret Manager, etc. into Kubernetes secrets. The ArgoCD Application manages the ExternalSecret CRD, not the actual secret value.
argocd-vault-plugin — A plugin that replaces placeholder values in manifests with secrets retrieved from Vault at sync time.
The External Secrets Operator approach is the most flexible for teams already using a centralized secrets backend. The Application in ArgoCD deploys ExternalSecret objects, which the ESO controller resolves at runtime without ever touching Git.
Production Best Practices
Run ArgoCD in HA mode. Use manifests/ha/install.yaml with 3 replicas of the API server and multiple application controller shards for large clusters (100+ applications).
Pin image versions. Never use latest for the ArgoCD image itself. Pin to a specific version and upgrade deliberately.
Use the App of Apps pattern for bootstrapping. A single root Application deploys all other Applications. This makes cluster bootstrapping idempotent and reproducible.
Separate ArgoCD config from application config. Store ArgoCD Application manifests in a dedicated gitops repository, separate from application source code.
Enable resource tracking via annotations. Use application.resourceTrackingMethod: annotation in argocd-cm instead of the default label-based tracking, which can conflict with Helm’s own labels.
Set resource limits on ArgoCD controllers. Application controller CPU and memory scale with the number of resources tracked. Monitor and tune accordingly.
Restrict auto-sync in production. Consider requiring manual sync approval for production environments even when using GitOps — or at minimum require a PR approval gate before changes reach the target branch.
ArgoCD vs Flux
Flux v2 is the other major GitOps operator. Both are CNCF projects. The main differences in practice:
Feature
ArgoCD
Flux v2
UI
Built-in web UI
No official UI (use Weave GitOps)
Multi-cluster
Single control plane manages many clusters
Agent per cluster, pull model
ApplicationSets
Native
Kustomization + HelmRelease
Secret management
Plugin-based
SOPS native integration
Learning curve
Steeper (more concepts)
Lower (Kubernetes-native CRDs)
CNCF status
Graduated
Graduated
ArgoCD wins when you need the UI, multi-cluster management from a central plane, or have a large operations team that benefits from the visual application topology view. Flux wins when you want a simpler, purely Kubernetes-native approach with better SOPS integration for secret management.
FAQ
Can ArgoCD deploy to the cluster it runs in?
Yes. The https://kubernetes.default.svc destination refers to the local cluster. ArgoCD can manage both its own cluster and external clusters simultaneously.
Does ArgoCD support private Git repositories?
Yes. Configure repository credentials via argocd repo add with SSH keys, HTTPS username/password, or GitHub App credentials. Credentials are stored as Kubernetes secrets in the ArgoCD namespace.
How does ArgoCD handle CRD installation?
CRDs can be managed by ArgoCD, but there is a chicken-and-egg problem: if a CRD is not yet installed, ArgoCD cannot validate resources that use it. The recommended pattern is to put CRDs in wave 1 and dependent resources in wave 2, or to use a separate Application for CRDs.
What is the difference between an Application and an AppProject?
An Application is the unit of deployment — it maps a Git source to a cluster destination. An AppProject is a grouping and access control boundary — it restricts what sources and destinations an Application within the project can use. Every Application belongs to exactly one AppProject.
How do I roll back a deployment with ArgoCD?
The GitOps way: revert the commit in Git and let ArgoCD reconcile. ArgoCD also provides a UI-based rollback to any previous sync revision, but this is considered a temporary measure — the Git history should always be updated to match.
Getting Started
The fastest path from zero to a working ArgoCD setup on a local cluster:
# 1. Create a local cluster (kind or minikube)
kind create cluster --name argocd-demo
# 2. Install ArgoCD
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# 3. Wait for pods
kubectl wait --for=condition=Ready pods --all -n argocd --timeout=120s
# 4. Get the initial admin password
argocd admin initial-password -n argocd
# 5. Port-forward and log in
kubectl port-forward svc/argocd-server -n argocd 8080:443 &
argocd login localhost:8080 --username admin --insecure
# 6. Deploy your first application
argocd app create guestbook
--repo https://github.com/argoproj/argocd-example-apps.git
--path guestbook
--dest-server https://kubernetes.default.svc
--dest-namespace guestbook
--sync-policy automated
From here, the natural next steps are integrating ArgoCD with your existing CI pipeline (CI builds and pushes the image, updates the image tag in Git, ArgoCD detects the change and syncs), configuring SSO via Dex, and setting up the App of Apps pattern for managing multiple applications declaratively.
For teams looking to go deeper on GitOps and ArgoCD in production, the Kubernetes architecture patterns guide covers how ArgoCD fits into a broader platform engineering stack alongside service mesh, policy enforcement, and observability tooling.
The container works fine in CI. It deploys successfully to staging. Then something goes wrong in production and you type the command you always type: kubectl exec -it my-pod -- /bin/bash. The response is immediate: OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory.
You try /bin/sh. Same error. You try ls. Same error. The container image is distroless — it ships only your application binary and its runtime dependencies, with no shell, no package manager, no debugging tools of any kind. This is intentional and correct from a security standpoint. It is also a significant operational challenge the first time you face it in production.
This article covers every practical technique for debugging distroless containers in Kubernetes: kubectl debug with ephemeral containers (the standard approach), pod copy strategy (for Kubernetes versions without ephemeral container support, or when you need to modify the running pod spec), debug image variants (the pragmatic developer shortcut), cdebug (a purpose-built tool that simplifies the process), and node-level debugging (the last resort with the most power). For each technique I will explain what it can and cannot do, what Kubernetes version or RBAC permissions it requires, and in which scenario — developer in local, platform engineer in staging, ops in production — it is the appropriate choice.
Why Distroless Breaks the Normal Debugging Workflow
Traditional container debugging assumes you can exec into the container and use shell tools: ps, netstat, strace, curl, a text editor. Distroless images remove all of this by design. The Google distroless project, Chainguard’s Wolfi-based images, and the broader minimal image ecosystem deliberately exclude everything that is not required to run the application. The result is a dramatically smaller attack surface: no shell means no RCE via shell injection, no package manager means no easy escalation path, fewer binaries means fewer CVEs in the image scan.
The tradeoff is operational: when something goes wrong, you cannot use the tools that the process itself is not allowed to run. A Java application in gcr.io/distroless/java17-debian12 has the JRE and nothing else. A Go binary compiled with CGO disabled and shipped in gcr.io/distroless/static-debian12 has literally only the binary and the necessary CA certificates and timezone data. There is no wget to download a debug binary, no apt to install one, no bash to run a script.
Kubernetes solves this at the platform level with ephemeral containers, added as stable in Kubernetes 1.25. The principle is that a debug container — which can have a full shell and any tools you want — can be injected into a running pod and share its process namespace, network namespace, and filesystem mounts without modifying the original container or restarting the pod.
Option 1: kubectl debug with Ephemeral Containers
Ephemeral containers are the canonical solution. Since Kubernetes 1.25 (stable), kubectl debug can inject a temporary container into a running pod. The container shares the target pod’s network namespace by default, and with --target it can also share the process namespace of a specific container, allowing you to inspect its running processes and open file descriptors.
The --target flag is the critical piece. Without it, the ephemeral container gets its own process namespace. With it, it shares the process namespace of the specified container — meaning you can run ps aux and see the application’s processes, use ls -la /proc/<pid>/fd to inspect open file descriptors, and read the application’s environment via cat /proc/<pid>/environ.
For a more capable debug environment, replace busybox with a richer image:
nicolaka/netshoot includes tcpdump, curl, dig, nmap, ss, iperf3, and dozens of other network diagnostic tools, making it the standard choice for network debugging scenarios.
What You Can and Cannot Do
Ephemeral containers share the pod’s network namespace and, when --target is used, the process namespace. This gives you:
Full visibility into the application’s network traffic from inside the pod (tcpdump, ss, netstat)
Process inspection via /proc/<pid> — open files, memory maps, environment variables, CPU/memory usage
Access to the pod’s DNS resolution context — exactly the same /etc/resolv.conf the application sees
Ability to make outbound network calls from the same network namespace (testing service endpoints, DNS resolution)
What you do not get with ephemeral containers:
Access to the application container’s filesystem. The ephemeral container has its own root filesystem. You cannot cat /app/config.yaml from the application container’s filesystem unless you access it via /proc/<pid>/root/.
Ability to remove the container once added. Ephemeral containers are permanent until the pod is deleted. This is by design — the Kubernetes API does not allow removing them after creation.
Volume mount modifications via CLI. You cannot add volume mounts to an ephemeral container via kubectl debug (though the API spec supports it, the CLI does not expose this).
Resource limits. Ephemeral containers do not support resource requests and limits in the kubectl debug CLI, though this is evolving.
Accessing the Application Filesystem
The most common surprise for developers new to ephemeral containers is that they cannot directly browse the application container’s filesystem. The workaround is the /proc filesystem:
# Find the application's PID
ps aux
# Browse its filesystem via /proc
ls /proc/1/root/app/
cat /proc/1/root/etc/config.yaml
# Or set the root to the application's root
chroot /proc/1/root /bin/sh # only if /bin/sh exists in the app image
The /proc/<pid>/root path is a symlink to the container’s root filesystem as seen from the process namespace. Because the ephemeral container shares the process namespace with --target, the application’s PID is typically 1, and /proc/1/root gives you full read access to its filesystem.
RBAC Requirements
Ephemeral containers require the pods/ephemeralcontainers subresource permission. This is separate from pods/exec, which controls kubectl exec. A common mistake is to grant pods/exec for debugging purposes without realizing that ephemeral containers require an additional grant:
In production environments, this permission should be tightly scoped: time-limited via RoleBinding rather than permanent ClusterRoleBinding, restricted to specific namespaces, and ideally gated behind an approval workflow. The debug container runs as root by default, which can create privilege escalation paths if the application container runs as a non-root user with shared process namespace — the debug container can attach to the application’s processes with higher privileges.
When you need to modify the pod’s container spec — replace the image, change environment variables, add a sidecar with a shared filesystem — the --copy-to flag creates a full copy of the pod with your modifications applied:
This creates a new pod named my-pod-debug that is a copy of my-pod but with the container image replaced by my-app:debug. If my-app:debug is your application image built with debug tooling included (or a debug variant from your registry), this lets you interact with the exact same binary in the exact same configuration as the original pod.
A more common use of --copy-to is to attach a debug container alongside the existing application container while keeping the original image unchanged:
This creates the copy-pod with both the original containers and a new debugger container sharing the process namespace. Unlike ephemeral containers, this approach supports volume mounts and resource limits, and the debug pod can be deleted cleanly when you are done.
Limitations of the Copy Strategy
The pod copy approach has a critical limitation: it is not debugging the original pod. It creates a new pod that may behave differently because:
It does not share the original pod’s in-memory state — if the issue is a goroutine leak or heap corruption that has been accumulating for hours, the fresh copy will not exhibit it immediately
It creates a new Pod UID, which means any admission webhooks, network policies, or pod-level security contexts that depend on pod identity may apply differently
If the original pod is crashing (CrashLoopBackOff), the copy will also crash — this technique does not help for crash debugging unless you also change the entrypoint
For crash debugging specifically, combine --copy-to with a modified entrypoint to keep the container alive:
The most pragmatic approach — and the one most appropriate for developer workflows — is to maintain a debug variant of your application image that includes shell tooling. Both the Google distroless project and Chainguard provide this pattern officially.
Google distroless images have a :debug tag that adds BusyBox to the image:
# Production image
FROM gcr.io/distroless/java17-debian12
# Debug variant — identical but with BusyBox shell
FROM gcr.io/distroless/java17-debian12:debug
Chainguard images follow a similar convention with :latest-dev variants that include apk, a shell, and common utilities:
# Production (zero shell, minimal footprint)
FROM cgr.dev/chainguard/go:latest
# Development/debug variant
FROM cgr.dev/chainguard/go:latest-dev
If you build your own base images, the recommended approach is to use multi-stage builds and maintain separate build targets:
FROM golang:1.22 AS builder
WORKDIR /app
COPY . .
RUN go build -o myapp .
# Production: static distroless image
FROM gcr.io/distroless/static-debian12 AS production
COPY --from=builder /app/myapp /myapp
ENTRYPOINT ["/myapp"]
# Debug variant: same binary, with shell tools
FROM gcr.io/distroless/static-debian12:debug AS debug
COPY --from=builder /app/myapp /myapp
ENTRYPOINT ["/myapp"]
In your CI/CD pipeline, build both targets and push my-app:${VERSION} (production) and my-app:${VERSION}-debug (debug variant) to your registry. The debug image is never deployed to production by default, but it exists and is ready to be used with kubectl debug --copy-to when needed.
Security Considerations for Debug Variants
Debug image variants defeat much of the security benefit of distroless if they are used in production, even temporarily. Track usage carefully: log when debug images are deployed, require explicit approval, and ensure they are removed after the debugging session. In regulated environments, consider whether deploying a debug variant to production namespaces is permitted by your security policy — in many cases it is not, and you must use ephemeral containers (which add a debug process to the pod without modifying the application image) instead.
Option 4: cdebug
cdebug is an open-source CLI tool that simplifies distroless debugging by wrapping kubectl debug with more ergonomic defaults and additional capabilities. Its primary value is in making ephemeral container debugging feel like a native shell experience:
# Install
brew install cdebug
# or: go install github.com/iximiuz/cdebug@latest
# Debug a running pod
cdebug exec -it my-pod
# Specify a namespace and container
cdebug exec -it -n production my-pod -c my-container
# Use a specific debug image
cdebug exec -it my-pod --image=nicolaka/netshoot
What cdebug adds over raw kubectl debug:
Automatic filesystem chroot.cdebug exec automatically sets the filesystem root of the debug container to the target container’s filesystem, so you browse / and see the application’s files — not the debug image’s files. This addresses the most common friction point with kubectl debug.
Docker integration.cdebug exec works identically for Docker containers (cdebug exec -it <container-id>), making it the same muscle memory for local and cluster debugging.
No RBAC complications for Docker-based local development — useful for developer workflows before the code reaches Kubernetes.
The tradeoff: cdebug is a third-party dependency and requires installation. In environments with strict tooling policies (regulated industries, air-gapped clusters), it may not be an option. In those cases, the raw kubectl debug workflow with /proc/1/root filesystem navigation is the baseline.
Option 5: Node-Level Debugging
When everything else fails — the pod is in CrashLoopBackOff too fast to attach to, the issue is a kernel-level problem, or you need tools like strace that require elevated privileges — node-level debugging gives you direct access to the container’s processes from the host node.
kubectl debug node/ creates a privileged pod on the target node that mounts the node’s root filesystem under /host:
From this privileged pod, you can use nsenter to enter the namespaces of any container running on the node:
# Find the container's PID on the node
# (from within the node debug pod)
crictl ps | grep my-container
crictl inspect <container-id> | grep pid
# Enter the container's namespaces
nsenter -t <pid> -m -u -i -n -p -- /bin/sh
# Or just the network namespace (for network debugging)
nsenter -t <pid> -n -- ip a
The nsenter approach lets you run tools from the node’s or debug container’s toolset while operating in the namespaces of the target container. This is how you run strace against a distroless process: strace is not in the application container, but you can run it from the node level while targeting the application’s PID.
# Trace all syscalls from the application process
nsenter -t <pid> -- strace -p <pid> -f -e trace=network
RBAC and Security for Node Debugging
Node-level debugging requires nodes/proxy and the ability to create privileged pods, which in most production clusters is restricted to cluster administrators. The debug pod runs with hostPID: true and hostNetwork: true, giving it visibility into all processes and network traffic on the node — not just the target container. This is significant: every process running on the node, including those in other tenants’ namespaces, is visible.
This technique should be treated as a break-glass procedure: log the access, require dual approval in production environments, and clean up immediately after the debugging session with kubectl delete pod --selector=app=node-debugger.
Choosing the Right Approach: Access Profile and Environment Matrix
The technique you should use depends on two axes: who you are (developer, platform engineer, ops/SRE) and where the issue is (local development, staging, production). The requirements and constraints differ significantly across these combinations.
Developer — Local or Development Cluster
Goal: Reproduce and understand a bug, inspect configuration, verify network connectivity to services. Constraints: None material — full cluster admin on local or personal dev namespace. Recommended approach: Debug image variants or cdebug.
In local development (Minikube, Kind, Docker Desktop), the fastest path is to build the debug variant of your image and deploy it directly. If you are working with another team’s service, cdebug exec gives you a shell in the container with automatic filesystem root without any special RBAC. The goal is speed and iteration — reserve the more structured approaches for higher environments.
Developer — Staging Cluster
Goal: Debug integration issues, inspect live configuration, verify environment-specific behavior. Constraints: Shared cluster — cannot deploy arbitrary workloads to other teams’ namespaces, but has pods/ephemeralcontainers in own namespace. Recommended approach: kubectl debug with ephemeral containers (--target), scoped to own namespace.
Staging is where ephemeral containers earn their keep. You can attach to a running pod without restarting it, without modifying the deployment spec, and without affecting other users of the same cluster. Grant developers pods/ephemeralcontainers in their team’s namespaces and they can self-service debug without needing ops involvement.
Platform Engineer / SRE — Production
Goal: Diagnose a live production incident. The pod is behaving unexpectedly — high latency, memory growth, unexpected connections, incorrect responses. Constraints: Changes to running pods are high-risk. Any debug image deployment must be gated. The issue is live and affecting users. Recommended approach: kubectl debug with ephemeral containers (ephemeral containers do not restart the pod, do not modify the deployment, and are auditable via API audit logs).
The key production requirements are auditability and minimal blast radius. Ephemeral containers satisfy both: they are recorded in the Kubernetes API audit log (who attached, when, to which pod), they do not modify the running application container, and they are limited to the pod’s own network and process namespaces. Document the debug session in your incident ticket: pod name, time, what was observed, who ran the debug container.
The --copy-to strategy is generally inappropriate for production incident response: it creates a new pod that may or may not exhibit the issue, it adds load to the cluster during an incident, and if it is attached to the same services (databases, downstream APIs), it produces additional traffic that complicates forensics.
Platform Engineer — Production, Node-Level Issue
Goal: Diagnose a kernel-level issue, a container runtime problem, a networking issue that spans multiple pods, or a situation where the pod is crashing too fast to attach to. Constraints: Maximum privilege required. High operational risk. Recommended approach: Node-level debug pod with nsenter. Treat as break-glass.
For this scenario, create a dedicated RBAC role that grants nodes/proxy access and the ability to create pods with hostPID: true in a dedicated debug namespace. Bind it only to specific users, require a separate authentication step (e.g., kubectl auth can-i check against a time-limited binding), and log all access. This level of access should generate a PagerDuty-style alert so that the security team knows a privileged debug session is active in production.
Common Errors and Solutions
Error: “ephemeral containers are disabled for this cluster”
Ephemeral containers require Kubernetes 1.16+ (alpha, behind feature gate) and are stable from 1.25. If you are on 1.16–1.22, you need to enable the EphemeralContainers feature gate on the API server and kubelet. From 1.23 it was beta and enabled by default. From 1.25 it is stable and always on. On managed Kubernetes services (EKS, GKE, AKS), check the cluster version — versions older than 1.25 may still have it disabled depending on your configuration.
Error: “cannot update ephemeralcontainers” (RBAC)
You have pods/exec but not pods/ephemeralcontainers. Add the grant shown in the RBAC section above. Note that pods/exec and pods/ephemeralcontainers are separate subresources — having one does not imply the other.
Error: “container not found” with –target
The container name in --target must match exactly the container name as defined in the Pod spec — not the image name. Check with kubectl get pod my-pod -o jsonpath='{.spec.containers[*].name}' to get the exact container names.
Error: Can see processes but cannot read /proc/1/root
The application container runs as a non-root user (e.g., UID 1000) and the ephemeral container runs as root. The application’s filesystem may have files owned by UID 1000 that are not readable by other UIDs depending on permissions. The /proc/<pid>/root path itself requires CAP_SYS_PTRACE capability. If your cluster’s PodSecurityStandards (PSS) are set to restricted, the debug container may not have this capability. Use the Baseline PSS profile for debug namespaces or explicitly add SYS_PTRACE to the ephemeral container’s securityContext.
Error: tcpdump shows no traffic
When using nicolaka/netshoot for network debugging, ensure the ephemeral container is created without--target if your goal is to capture all traffic on the pod’s network interface (not just the specific container’s process). With --target, you share the process namespace but the network namespace is shared at the pod level regardless. Run tcpdump -i any to capture on all interfaces including loopback, which is where inter-container traffic within a pod travels.
Decision Framework
Use this as a starting point to select the right technique for your situation:
Scenario
Technique
Requirement
Active production incident, pod running
kubectl debug + ephemeral container
pods/ephemeralcontainers RBAC, k8s 1.25+
Pod crashing too fast to attach
kubectl debug –copy-to + modified entrypoint
Ability to create pods in namespace
Developer debugging in dev/staging
cdebug exec or kubectl debug
pods/ephemeralcontainers or pod create
Need full filesystem access
kubectl debug –copy-to + debug image variant
Debug image in registry, pod create
Need strace or kernel tracing
Node-level debug with nsenter
nodes/proxy, cluster admin equivalent
Network packet capture
kubectl debug + nicolaka/netshoot
pods/ephemeralcontainers
Local Docker debugging
cdebug exec <container-id>
Docker socket access
CI-reproducible debug environment
Debug image variant in separate build target
Separate image tag in registry
Production RBAC Design
A clean RBAC design for production distroless debugging separates three roles with different privilege levels:
Bind Tier 1 permanently to your developers. Bind Tier 2 to SREs permanently but with audit alerts on use. Bind Tier 3 only on-demand (via a Kubernetes operator that creates time-limited RoleBindings) and never as a permanent ClusterRoleBinding.
Summary
Distroless containers are the correct choice for production workloads. They reduce attack surface, eliminate unnecessary CVEs, and force a cleaner separation between application and tooling. The operational cost is that your traditional debugging workflow — exec into the container, run some commands — no longer works by default.
Kubernetes provides a clean answer with ephemeral containers and kubectl debug: inject a debug container with whatever tools you need into the running pod, sharing its network and process namespaces, without restarting or modifying the application. For scenarios where ephemeral containers are insufficient — filesystem access, crash debugging, kernel-level investigation — the copy strategy and node-level debug fill the remaining gaps.
The key to making this work at scale is not the technique itself but the access model: developers get self-service ephemeral container access in their own namespaces, SREs get cluster-wide ephemeral container access for production incidents, and node-level access is a break-glass procedure with audit trail and time limits. With that model in place, distroless becomes an operational non-issue rather than an obstacle.
Frequently Asked Questions
How do I debug a distroless container with no shell?
Use an ephemeral debug container: kubectl debug -it pod-name --image=busybox --target=app attaches a second container with a full toolset into the pod’s namespaces. The distroless image stays untouched — the tools live in the debug container, which disappears when you exit.
What is the difference between distroless :debug and :nonroot tags?
The :debug variants add busybox (so you get a shell) and are meant for temporary troubleshooting builds; :nonroot variants run as a non-root user and are the production recommendation. Never ship :debug to production — it reintroduces exactly the attack surface distroless removes.
Can I use kubectl exec with a distroless image?
Not usefully — there is no shell to exec into. kubectl exec needs a binary inside the image to run, and distroless ships only your application. That is what kubectl debug and ephemeral containers exist for.
Do ephemeral containers work in every Kubernetes version?
They are stable since Kubernetes 1.25 and enabled everywhere current. On older clusters (or hardened distros that disable the feature), the fallback is copying the pod with a debug sidecar: kubectl debug pod-name --copy-to=debug-copy --share-processes.