Skip to content

Enable remote debugging with breakpoints with Minikube #4340

@lacroixthomas

Description

@lacroixthomas

Is your feature request related to a problem? Please describe.
This feature is not related to a problem but more likely to help debugging locally while implementing or debugging with agones locally.

Describe the solution you'd like
I would like to be able to build agones binaries, deploy them in minikube and being able to use the breakpoints from vscode to debug my containers running within minikube

Describe alternatives you've considered

  • Debugging with more logs or connecting manually to the different pods, but it won't pause the flow where I want, that could be helpful for different scenarios

Additional context
The design would looks like this:

                     ┌──────────────────────────────────────────┐
                     │             Minikube Cluster             │
                     │                                          │
                     │   ┌──────────────────────────────────┐   │
                     │   │            Agones Pod            │   │
                     │   │                                  │   │
                     │   │  ┌─────────────┐   ┌────────────────┐│
                     │   │  │    Delve    │◄──► Agones Binary   ││
                     │   │  │  Debugger   │   │ (debug build)   ││
                     │   │  │   :2345     │   │ e.g. /agones-   ││
                     │   │  └─────────────┘   │ allocator       ││
                     │   │                    └────────────────┘│
                     │   └──────────────────────────────────┘   │
                     │                                          │
                     │       ▲                                   │
                     │       │ kubectl port-forward 2345:2345    │
┌────────────────────┴───────┼───────────────────────────────────┐
│                            │                                    │
│                            ▼                                    │
│        ┌──────────────────────────────────────────────────┐     │
│        │               Local Machine                      │     │
│        │                                                  │     │
│        │   ┌─────────────────────┐      ┌──────────────┐  │     │
│        │   │  VS Code            │◄────►│ localhost:2345│ │     │
│        │   │  Debug Mode         │ Debug│ (Delve Remote │ │     │
│        │   │  Breakpoints        │      │   Endpoint)   │ │     │
│        │   └─────────────────────┘      └──────────────┘  │     │
│        │                                                  │     │
│        │   - Local source code (matches pod build)        │     │
│        │   - launch.json (remote attach)                  │     │
│        └──────────────────────────────────────────────────┘     │
└─────────────────────────────────────────────────────────────────┘

Metadata

Metadata

Assignees

Labels

area/build-toolsDevelopment tooling. I.e. pretty much everything in the `build` directory.kind/featureNew features for Agones

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions