βœ… Scenario #4 β€” Debugging with Ephemeral Debug Containers in Kubernetes
dev.toΒ·14hΒ·
Discuss: DEV
Flag this post

Ephemeral containers let you attach a temporary debug container to a running Pod without restarting it.


🟩 Step 1 β€” Create a Simple NGINX Pod (to Debug)

Create file nginx-ephemeral.yaml:

apiVersion: v1
kind: Pod
metadata:
name: nginx-ephemeral
labels:
app: nginx-ephemeral
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80

Apply it:

kubectl apply -f nginx-ephemeral.yaml


🟩 Step 2 β€” Verify Pod Status

kubectl get pods -o wide

Expected:

nginx-ephemeral   1/1   Running   0   10s

Wait until ready (recommended):

kubectl wait --for=condition=Ready pod/nginx-ephemeral --timeout=60s


🟩 Step 3 β€” Launch an Ephemeral Debug Container

Use a debug image with complete tools (e.g., busybo…

Similar Posts

Loading similar posts...