aylei / aylei/kubectl-debug

Run kubectl-debug from private docker registry (not just https://hub.docker.com/)

Open
#89 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
2.3k
Forks
303
PR merge metrics
No merged PRs in 30d

Description

Hi, i really like the tool guys, but is there a way to run this from private docker registry (like nexus) that is inside corporate network.

The reason for this question is that i have some k8s clusters that doesn have access to hub.docker.com (every image is being downloaded from private registry) and want to use this awesome tool.

so basically i pulled both debug-agent:latest and netshoot:latest and pushed to my private docker registry (Sonatype Nexus) and prepared the cfg file ~/.kube/debug-config

`agentImage: myregistry:myport/debug-agent:latest
(...)
image: myregistry:myport/netshoot:latest`

ive also modified yaml manifest for debug-agent daemonset and changed `Image:` to point to image in my private registry

But when starting `kubectl-debug` i get:

`pulling image myregistry:myport/netshoot:latest...
Pulling repository myregistry:myport/netshoot
starting debug container...
error execute remote, Internal error occurred: error attaching to container: Error: No such image: myregistry:myport/netshoot:latest
error: Internal error occurred: error attaching to container: Error: No such myregistry:myport/netshoot:latest`

I saw that there is possibilty to configure the `kubectl-debug-registry-secret` but it seems its also only for private repositories in official DockerHub registry.

Is it possible to run it this way ? Are You planning to support this ? I know the easiest solution would be to open traffic to hub.docker.com but i cannot do that on some of our k8s clusters for security reasons.

I was looking long time for such image to debug inside a running container, and never had before found one that contains all the needed troubleshooting tools and also to be so lightweight, already been able to debug bunch of containers (on other k8s clusters that have wide access to official dockerhub registry)

Any feedback would be much appreciated!
Cheers

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ~/.kube/debug-config and the modified debug-agent DaemonSet manifest, then inspect the kubectl-debug image-pull and attach flow for both debug-agent and netshoot. Done means images from the specified private registry are pulled successfully and the debug container attaches without the shown no-image error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go, kubernetes
Domain
cli, devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
22/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.