Ephemeral Containers in Action - Running a Go Debugger in Kubernetes - Marvin Beckers
summary
Launches Delve inside an ephemeral container so a running pod never restarts, using kubectl debug with the --target flag to share PID/NS and attach to PID 1. Requires granting CAP_SYS_PTRACE (via the debug profile) and building Go with -gcflags="-N -l" to avoid optimizations that break breakpoints. Run Delve in headless DAP mode, kubectl port-forward the debug port to localhost, and connect from VS Code or Neovim. Works end to end but fails if cluster PSPs or policies forbid ptrace.
AI-written summary · about
chapters (14)
- 0:00Introduction to ephemeral containers
- 1:06Debugging Go apps in Kubernetes
- 2:52Go debugging with Delve
- 5:47Linux capabilities for debugging
- 7:35Debug builds vs production builds
- 9:43Remote debugging with DAP
- 13:41Why use ephemeral containers
- 16:28How ephemeral containers work
- 18:57Using kubectl debug
- 21:26Required capabilities for tracing
- 23:14Launching Delve as ephemeral container
- 27:53Integrating with IDEs
- 30:48Live demo and results
- 32:56Q&A session
related talks
40mDebugging in Golang Apps Inside K8s Environment
34mDebugging at Scale in Production - Deep into Your Containers with Kubectl Debug
35mThe Art of Debugging Inside K8s Environment
39mSeeing is Believing: Debugging with Ephemeral Containers
24mDebugging at Scale in Production - Deep into your Containers
01h 00mDebug like a pro on Kubernetes
26mHow to Debug the Pod Which is Hard to Debug
39mDebugging python applications inside k8s environment
