Michele Caci

Debugging Go: from zero to Kubernetes

How do you attach a debugger to a live Go application inside a Kubernetes pod? Learn the modern approach using ephemeral containers.

Debugging Go: from zero to Kubernetes
#1about 5 minutes

Understanding the core concepts and tools of debugging

Debugging involves identifying and removing errors using tools like tests, logs, and live debuggers, but requires caution in production environments.

#2about 2 minutes

An introduction to Delve for debugging Go applications

Delve is a command-line debugger for Go that can be started with commands like `dlv debug` or attached to a running process with `dlv attach`.

#3about 5 minutes

How to set up a two-container Docker environment

Remote debugging in Docker requires two containers: one for the application binary and a separate one containing the Delve debugger and the application's source code.

#4about 4 minutes

Enabling cross-container access with Docker flags

The `--pid` flag shares process namespaces between containers, while `--cap-add SYS_PTRACE` grants the necessary Linux capabilities for the debugger to attach.

#5about 3 minutes

Translating the Docker debugging setup to Kubernetes

A simple way to debug in Kubernetes is to create a pod with two containers, one for the app and one for the debugger, sharing the process namespace.

#6about 2 minutes

Using ephemeral containers for on-demand debugging

Ephemeral containers, launched with `kubectl debug`, provide a more efficient way to attach a debugger to a running pod without permanently adding a sidecar.

#7about 4 minutes

Summary of debugging techniques and audience Q&A

This recap covers the main points of debugging from local to Kubernetes and answers questions about interactivity, port forwarding, and compile flags.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
Dev Digest 113 - Debugging above the cloud
Hello there and welcome to Dev Digest 113! This time, we got an old friend in the sky back, jQuery asks us to upgrade and AI is eating the web. Also, are you sure the LLM you use is secure against code injection?News and ArticlesGood news everyone! N...
Dev Digest 113 - Debugging above the cloud
Learning Kubernetes made easy with KubeCampus
Learning to use Kubernetes? KubeCampus by Kasten offers free educational content for all skill levels to get you started!Kubernetes is an open-source system for deploying, scaling and managing containerized applications. It allows you to deploy your ...
Learning Kubernetes made easy with KubeCampus
DC
Daniel Cranney
Dev Digest 172: CODE100 is back, Linux Containers & PHP in Node!
Inside last week’s Dev Digest 172 . 🍎 All WDC Web Tech announcements 📦 Linux containers on MacOS 🧑‍💻 Take a CODE100 challenge to join the WeAreDevelopers World Congress 📝 Training AI without GDPR issues 📱 Mobile port tracking and restricted Android ...
Dev Digest 172: CODE100 is back, Linux Containers & PHP in Node!

From learning to earning

Jobs that call for the skills explored in this talk.

Rust and GoLang

Rust and GoLang

NHe4a GmbH
Karlsruhe, Germany

Remote
55-65K
Intermediate
Senior
Go
Rust
Kubernetes Engineer

Kubernetes Engineer

Dembach Goo Informatik GmbH & Co. KG
Hannover, Germany

Redis
Kafka
DevOps
Ansible
RabbitMQ
+3