Skip to content

Conversation

@rosanch
Copy link

@rosanch rosanch commented Nov 8, 2025

Summary

I wanted to add some clarity into how to leverage kubectl in order to make a quick injection of a dotnet monitor container to debug running .Net containers with minimal steps.

Release Notes Entry

@rosanch rosanch requested a review from a team as a code owner November 8, 2025 02:42
@rosanch
Copy link
Author

rosanch commented Nov 10, 2025

@dotnet-policy-bot agree company="Microsoft"
@dotnet-policy-service agree company="Microsoft"

2. Target pod created with required env vars, volume, and volume mounts. See example [template](./_dotnetmonitor.tpl).

## Inject dotnet monitor into a Pod
Prepare a [config file](config.yaml) whose values match the target's deployment as it does our [example template](./_dotnetmonitor.tpl). This step is performed once per pod lifetime; the ephemeral container persists until the pod restarts.
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove the tpl file references here. You can point to our other docs regarding the app's environment/mounting configuration.

MonitorPort=52323

kubectl debug -n "$Namespace" "pod/$Pod" \
--image "mcr.microsoft.com/dotnet/monitor:8.0" \
Copy link
Member

Choose a reason for hiding this comment

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

Consider pointing to 10 since it just released.

kubectl debug -n "$Namespace" "pod/$Pod" \
--image "mcr.microsoft.com/dotnet/monitor:8.0" \
--container "debugger" \
--target "$AppContainer" \
Copy link
Member

Choose a reason for hiding this comment

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

Note that target is not strictly necessary since you are connecting over volume mounts anyway.

Copy link
Member

@wiktork wiktork left a comment

Choose a reason for hiding this comment

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

Thanks for contributing this! I added some minor feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants