Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b19401b
Upgrade Debian base image to bookworm
Apr 30, 2024
8a1c229
Never block cluster-autoscaler
Apr 30, 2024
1038298
Eliminate termination grace period
Apr 30, 2024
da22c74
Merge pull request #24 from digitalocean/upgrade-debian-in-base-image
Apr 30, 2024
0a9432f
Merge pull request #23 from digitalocean/never-block-ca
Apr 30, 2024
c2a8572
Merge pull request #25 from digitalocean/no-termination-grace-period
Apr 30, 2024
61af11a
re-add iptables binaries
gottwald Apr 30, 2024
687be3c
Merge pull request #26 from digitalocean/ig/re-add-iptables
gottwald Apr 30, 2024
eb3e125
Use ClusterFirstWithHostNet DNS policy
Jul 3, 2024
47d8297
Merge pull request #27 from digitalocean/use-ClusterFirstWithHostNet-…
Jul 3, 2024
66ce3f5
remove docker socket mounts and cli
d-honeybadger Aug 22, 2024
923077f
Merge pull request #28 from digitalocean/dkomsa/remove-docker
d-honeybadger Aug 22, 2024
2cc0c8c
Add second '>' for correct output redirection in Dockerfile
okamidash Aug 23, 2024
1a41ee1
Update Dockerfile to include crictl
okamidash Aug 23, 2024
176c0d6
Add containerd mounts to daemonset
okamidash Aug 23, 2024
c3c7a3a
update deployment to include containerd mounts
okamidash Aug 23, 2024
6223905
Update README.md to clarify on wget and crictl
okamidash Aug 23, 2024
9dd15ee
Update README.md to remove duplicate 'atop' line
okamidash Aug 23, 2024
f631da5
Merge pull request #29 from okamidash/master
okamidash Aug 23, 2024
d4d08bf
Move image to ghcr (#30)
gottwald Apr 8, 2025
1319131
ci: fix ghcr auth (#31)
gottwald Apr 8, 2025
6877edf
ci: login to the correct registry (#32)
gottwald Apr 8, 2025
c9689f3
Add more debug tools (#34)
gottwald Feb 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: release

env:
DOCKER_USER: ${{ secrets.DockerHubUser }}

on:
push:
branches:
Expand All @@ -14,15 +11,15 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
with:
fetch-depth: 1

- name: build image
run: docker build -t digitalocean/doks-debug:latest .
run: docker build --platform linux/amd64 -t ghcr.io/digitalocean-packages/doks-debug:latest .

- name: Log into container registry
run: echo "${{ secrets.DockerHubToken }}" | docker login --username ${DOCKER_USER} --password-stdin
- name: log into container registry
run: echo "${{ secrets.GHCRTOKEN }}" | docker login ghcr.io --username "${{ secrets.GHCRUSER }}" --password-stdin

- name: push image
run: docker push digitalocean/doks-debug:latest
run: docker push ghcr.io/digitalocean-packages/doks-debug:latest
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fetch-depth: 1

- name: build image
run: docker build -t doks-debug .
run: docker build --platform linux/amd64 -t doks-debug .

- name: smoke test
run: docker run --rm doks-debug sleep 1
35 changes: 23 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# match doks-debug version with DOKS worker node image version for kernel
# tooling compatibility reasons
FROM debian:10-slim
FROM debian:12-slim

# Specify the version of crictl to install
ARG CRICTL_VERSION="v1.31.1"

WORKDIR /root

# use same dpkg path-exclude settings that come by default with ubuntu:focal
# image that we previously used
RUN echo 'path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo' > /etc/dpkg/dpkg.cfg.d/excludes
RUN echo 'path-exclude=/usr/share/doc/*' > /etc/dpkg/dpkg.cfg.d/excludes
RUN echo 'path-include=/usr/share/doc/*/copyright' > /etc/dpkg/dpkg.cfg.d/excludes
RUN echo 'path-include=/usr/share/doc/*/changelog.Debian.*' > /etc/dpkg/dpkg.cfg.d/excludes

RUN echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
RUN echo 'path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo' >> /etc/dpkg/dpkg.cfg.d/excludes
RUN echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/excludes
RUN echo 'path-include=/usr/share/doc/*/copyright' >> /etc/dpkg/dpkg.cfg.d/excludes
RUN echo 'path-include=/usr/share/doc/*/changelog.Debian.*' >> /etc/dpkg/dpkg.cfg.d/excludes

RUN apt-get update -qq && \
apt-get install -y apt-transport-https \
Expand All @@ -30,24 +31,34 @@ RUN apt-get update -qq && \
jq \
dnsutils \
tcpdump \
termshark \
traceroute \
iputils-ping \
iptables \
net-tools \
ncat \
iproute2 \
strace \
lsof \
telnet \
openssl \
psmisc \
dsniff \
mtr-tiny \
conntrack \
llvm-8 llvm-8-tools \
llvm-13 llvm-13-tools \
wget \
watch \
bpftool

RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \
apt-get update -qq && \
apt-get install -y docker-ce
# Install crictl
RUN wget https://github.com/kubernetes-sigs/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz && \
tar zxvf crictl-${CRICTL_VERSION}-linux-amd64.tar.gz -C /usr/local/bin && \
rm -f crictl-${CRICTL_VERSION}-linux-amd64.tar.gz
Comment on lines +55 to +57
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing crictl via a direct download without integrity verification introduces supply-chain risk. Consider verifying the tarball with a pinned SHA256 (or signature, if available) before extracting, and fail the build if validation doesn’t match.

Copilot uses AI. Check for mistakes.

# Specify the default image endpoint for crictl
RUN echo 'runtime-endpoint: unix:///run/containerd/containerd.sock' >> /etc/crictl.yaml
RUN echo 'image-endpoint: unix:///run/containerd/containerd.sock' >> /etc/crictl.yaml
RUN echo 'timeout: 2' >> /etc/crictl.yaml

CMD [ "/bin/bash" ]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This DaemonSet manifest will:
1. Ensure a pod with our Docker image is running indefinitely on every node.
2. Use `hostPID`, `hostIPC`, and `hostNetwork`.
3. Mount the entire host filesystem to `/host` in the containers.
4. Mount `/var/run/docker.sock` from the host.
4. Mount the `containerd` socket at `/run/containerd/containerd.sock` from the host into the container.

In order to make use of these workloads, you can exec into a pod of choice by name:

Expand Down Expand Up @@ -47,11 +47,11 @@ Once you're in, you have access to the set of tools listed in the `Dockerfile`.
- [`netcat`](https://linux.die.net/man/1/nc) - is a multi-tool for interacting with TCP and UDP; it can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6.
- [`iproute2`](https://wiki.linuxfoundation.org/networking/iproute2) - is a collection of utilities for controlling TCP / IP networking and traffic control in Linux.
- [`strace`](https://github.com/strace/strace) - is a diagnostic, debugging and instructional userspace utility with a traditional command-line interface for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state.
- [`docker`](https://docs.docker.com/engine/reference/commandline/cli/) - is the CLI tool used for interacting with Docker containers on the system.
- [`dstat`](http://dag.wiee.rs/home-made/dstat/) - is a versatile replacement for vmstat, iostat, netstat and ifstat. Dstat overcomes some of their limitations and adds some extra features, more counters and flexibility. Dstat is handy for monitoring systems during performance tuning tests, benchmarks or troubleshooting.
- [`htop`](https://hisham.hm/htop/) - is interactive process viewer for Unix systems.
- [`atop`](https://www.atoptool.nl/) - is an advanced interactive monitor for Linux-systems to view the load on system-level and process-level.

- [`wget`](https://www.gnu.org/software/wget/) - for retrieving files using HTTP, HTTPS, FTP and FTPS.
- [`crictl`](https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md) - A CLI for CRI endpoints. Configured to use `/run/containerd/containerd.sock` as a default endpoint.
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s trailing whitespace at the end of this line, which can cause noisy diffs and fail markdown linting in some pipelines. Consider removing the trailing space and keeping the bullet description formatting consistent (e.g., sentence-casing after the dash). NOS Coding Agent 🤖- Small steps, big learning

Copilot uses AI. Check for mistakes.
# Tips and Tricks

## chroot + systemctl
Expand Down
13 changes: 8 additions & 5 deletions k8s/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ spec:
name: doks-debug
annotations:
clusterlint.digitalocean.com/disabled-checks: "hostpath-volume"
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
spec:
dnsPolicy: ClusterFirstWithHostNet
hostPID: true
hostIPC: true
hostNetwork: true
Expand All @@ -25,7 +27,7 @@ spec:
- name: doks-debug
securityContext:
privileged: true
image: digitalocean/doks-debug:latest
image: ghcr.io/digitalocean-packages/doks-debug:latest
command: [ "sleep", "infinity" ]
resources:
requests:
Expand All @@ -37,15 +39,16 @@ spec:
volumeMounts:
- name: host
mountPath: /host
- name: docker
mountPath: /var/run/docker.sock
- name: containerd
mountPath: /run/containerd/containerd.sock
terminationGracePeriodSeconds: 0
volumes:
- name: host
hostPath:
path: /
- name: docker
- name: containerd
hostPath:
path: /var/run/docker.sock
path: /run/containerd/containerd.sock
type: Socket
updateStrategy:
rollingUpdate:
Expand Down
13 changes: 8 additions & 5 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ spec:
name: doks-debug
annotations:
clusterlint.digitalocean.com/disabled-checks: "hostpath-volume"
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
spec:
dnsPolicy: ClusterFirstWithHostNet
hostPID: true
hostIPC: true
hostNetwork: true
Expand All @@ -26,7 +28,7 @@ spec:
- name: doks-debug
securityContext:
privileged: true
image: digitalocean/doks-debug:latest
image: ghcr.io/digitalocean-packages/doks-debug:latest
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the latest tag makes rollouts non-reproducible and can lead to unexpected changes when the image updates. Consider pinning to an immutable tag (version) and/or digest (e.g., @sha256:...) so cluster state is deterministic.

Suggested change
image: ghcr.io/digitalocean-packages/doks-debug:latest
image: ghcr.io/digitalocean-packages/doks-debug:1.0.0

Copilot uses AI. Check for mistakes.
command: [ "sleep", "infinity" ]
resources:
requests:
Expand All @@ -38,15 +40,16 @@ spec:
volumeMounts:
- name: host
mountPath: /host
- name: docker
mountPath: /var/run/docker.sock
- name: containerd
mountPath: /run/containerd/containerd.sock
terminationGracePeriodSeconds: 0
volumes:
- name: host
hostPath:
path: /
- name: docker
- name: containerd
hostPath:
path: /var/run/docker.sock
path: /run/containerd/containerd.sock
type: Socket
strategy:
rollingUpdate:
Expand Down