Skip to content

Image containing various debugging tools for Kubernetes and other purposes.

Notifications You must be signed in to change notification settings

simon-wessel/debug-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Debug Image

GitHub Workflow Status Docker Pulls Docker Image Size (latest by date)

Image containing various debugging tools. This image is more focused on the availability of tools than on its size.

Usage with Kubernetes

Start debugging Pod using kubectl exec

kubectl run -i --tty --rm debug --image=simonmwessel/debug:latest --image-pull-policy=Always --restart=Never -- /bin/zsh

Start debugging Pod using manifest

If you want to keep the Pod runnning or need to attach further configurations, you may use a manifest to create the Pod.

Regular Pod manifest

apiVersion: v1
kind: Pod
metadata:
  name: debug-pod
spec:
  containers:
  - image: docker.io/simonmwessel/debug:latest
    imagePullPolicy: Always
    name: debug-pod
    command: [ "/bin/bash", "-c", "--" ]
    args: [ "trap : TERM INT; sleep 1d & wait" ] # Keep Pod alive for 1 day or until delete/kill
  terminationGracePeriodSeconds: 0
  restartPolicy: Never
  # Optional: Schedule Pod to specific node
  # nodeName: mynode

Pod manifest for namespaces with Pod Security Standards

This manifest can be used in namespaces that have pod security standard restrictions. The user in the pod will be a non-root user.

apiVersion: v1
kind: Pod
metadata:
  name: debug-pod
spec:
  securityContext:
    fsGroup: 1000
    fsGroupChangePolicy: "OnRootMismatch"
    runAsNonRoot: true
    runAsUser: 1000
  containers:
  - image: docker.io/simonmwessel/debug:latest
    imagePullPolicy: Always
    name: debug-pod
    command: [ "/bin/bash", "-c", "--" ]
    args: [ "trap : TERM INT; sleep 1d & wait" ] # Keep Pod alive for 1 day or until delete/kill
    securityContext:
      allowPrivilegeEscalation: false
      seccompProfile:
        type: RuntimeDefault
      capabilities:
        drop:
        - ALL
  terminationGracePeriodSeconds: 0
  restartPolicy: Never
  # Optional: Schedule Pod to specific node
  # nodeName: mynode

Apply pod and open shell

# Apply Pod
kubectl apply -n mynamespace -f manifest.yaml
# Open shell on Pod
kubectl exec -n mynamespace --stdin --tty debug-pod -- /bin/zsh

About

Image containing various debugging tools for Kubernetes and other purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •