Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add label to specify debug tools container for debugging #3472

Closed
panitaxx opened this issue Jan 3, 2020 · 5 comments
Closed

Add label to specify debug tools container for debugging #3472

panitaxx opened this issue Jan 3, 2020 · 5 comments
Labels
area/debug kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@panitaxx
Copy link
Contributor

panitaxx commented Jan 3, 2020

I would like to submit a PR to be able to select a different image for the duct-tape (extra tools for debugging). Specifically in go if your image is built with alpine it does not work with skaffold debug.

Expected behavior

Being able to specify my own debug tools init containers

Actual behavior

Debug tools init containers are hard coded

Information

I have thought some possible ways of doing this:

  1. via a flag. something like

`skaffold debug --debug-tools-image='go=gcr.io/myownregistry/go-debug:xyz'

Like this. It will affect all go images marked for debugging.

  1. via a label.
spec:
  replicas: 1
  selector:
    matchLabels:
      app: models
  template:
    metadata:
      labels:
        app: models
        debugTool: "gcr.io/myownregistry/go-debug:xyz"
    spec:
      containers:
      - name: models
        image: models
        command: ["/dbg/go/bin/dlv","debug","--headless","--api-version=2","--listen=:56268","--log"]
  1. Just disable the automatically adding an init container witth a flag

skaffold debug --no-init-container

In this case init-container is not added. User is responsible for creating the dbg volume, and adding an init container that contains the tools and that copies them into the dbg mountpoint.

@balopat
Copy link
Contributor

balopat commented Jan 16, 2020

Thanks @panitaxx for opening! I like the name debug-tools :)
I think this is a reasonable direction - WDYT @briandealwis?

@balopat balopat added the priority/p3 agreed that this would be good to have, but no one is available at the moment. label Jan 16, 2020
@briandealwis
Copy link
Member

Since you're already rewriting your pod definition to invoke Delve, and presumably your container includes dlv, perhaps debug should just skip the initContainer entirely.

@tstromberg
Copy link
Contributor

@panitaxx - are you still thinking about writing a PR to address this?

@briandealwis
Copy link
Member

debug will now skip transforms on pods with an existing debug.cloud.google.com/config annotation (#4027). We have a contribution for configuring alternative locations for the debug support images in #3945.

@panitaxx
Copy link
Contributor Author

@tstromberg I am sorry but right now I can't do this PR. It also seems that the PR mentioned by @briandealwis address the spirit of this issue so I think it's ok to close it.

@nkubala nkubala closed this as completed Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/debug kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

No branches or pull requests

5 participants