Design Debug Container System

Medium45 min
1 / 30
understanding7 min read

Problem Statement: Governed Debug Container Platform

Problem Statement: Governed Debug Container Platform — debug container platform system design

Problem Statement: Governed Debug Container Platform

Engineers debugging Kubernetes need governed attach without shipping shells in prod images.

Problem framing
  • Engineers need shells, packet capture, and debugger attach on distroless workloads without baking tools into prod images
  • Platform must orchestrate EphemeralContainers (Kubernetes 1.23+) or copy-target debug pods with strict TTL and audit
  • Telepresence-class traffic interception and Skaffold file sync are adjacent dev-loop concerns the control plane should integrate with, not reinvent
  • Target: p95 session start < 15s; admission webhook < 80ms p99; 100% sessions logged to SIEM
Design choices
  1. Session API issues signed tokens; agents on cluster nodes or API server subresource create ephemeral containers
  2. Profile catalog pins allowed images, capability drops, and namespace modes (pid, net, ipc, uts)
  3. Policy engine enforces environment, owner, ticket ID, and concurrent session caps before kube admits
  4. Audit pipeline streams kubectl-equivalent records to immutable store for SOC review
Deep dive

ephemeral debug containers, kubectl debug, Telepresence-style traffic swap, Skaffold dev loops, break-glass RBAC, and distroless attach paths. Google, Shopify, and large Kubernetes adopters standardized on ephemeral debug containers after distroless became default—kubectl debug -it pod --image=netshoot --target=app shares the app container namespaces without mutating the prod image. Your platform wraps that with governance: only approved profiles, automatic teardown, and integration with IDE attach (dlv, jdwp) via port-forward brokers.

javaOne Dark Pro
1public final class SessionGate {
2 public boolean allow(String env, boolean breakGlass, int active) {
3 if ("prod".equals(env) && !breakGlass) return false;
4 return active < 3;
5 }
6}
pythonOne Dark Pro
1from dataclasses import dataclass
2
3@dataclass
4class DebugSession:
5 target_pod: str
6 profile: str
7 share_pid: bool
8 share_net: bool
9
10def ttl_expired(age_s: int, max_ttl: int) -> bool:
11 return age_s > max_ttl
typescriptOne Dark Pro
1export interface DebugProfile {
2 image: string;
3 capabilities: string[];
4 maxTtlMinutes: number;
5}
6
7export function canAttach(env: string, approved: boolean): boolean {
8 if (env === "production" && !approved) return false;
9 return true;
10}
Interviewer positioning

Lead with never mutate prod images for debugging and break-glass is audited, time-boxed, and capability-bounded. Mention how Kubernetes EphemeralContainer API differs from legacy kubectl exec into a shell that was never supposed to exist.

How to open this one

The framing that lands for a governed debug-container platform is giving engineers ephemeral, audited access to attach a debug toolset to a running workload — without baking tools into production images. Lead with ephemeral containers (kubectl debug) scoped by RBAC, time-bound, and fully audited, and the failure story that proves it: an engineer needs to debug a distroless prod pod that has no shell, and an ephemeral debug container attaches the tools safely instead of someone shipping a debug build to prod. That shows you understand the goal is least-privilege, audited break-glass debugging, not putting debug tools in production.

Key Highlights

  • EphemeralContainer keeps prod images distroless
  • Profiles bound capabilities and TTL
  • Audit every attach with ticket correlation
Mention this
Separate ephemeral debug attach from Telepresence traffic interception—interviewers test whether you confuse dev-loop tools.
Avoid
Granting cluster-admin for debugging—use scoped RBAC and admission instead.

Section Rescue Kit

Buzzwords to use:

EphemeralContainerShareProcessNamespace

Safe statements:

  • "I will separate ephemeral debug attach from Telepresence traffic swap—they solve different failure modes."
  • "Happy to deep dive admission policy, namespace sharing, or Skaffold integration next."
Design Debug Container System - System Design | WinJob | WinJob