-
Notifications
You must be signed in to change notification settings - Fork 113
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
Open question - Using dotnet-monitor as part of an ephemeral / debug container #2486
Comments
We haven't explicitly tested ephemeral container scenarios but this is something I can look into. One thing that does stand out from your logs is:
This suggests that |
Yeah sorry @jander-msft - you're correct I would really appreciate if you had a look at this. Also, by using: env:
- name: ASPNETCORE_URLS
value: http://+:80
- name: DOTNET_DiagnosticPorts
value: /diag/port.sock The container waits until a debugger is attached. Is there a way to prep. a 2022-09-13T20:49:46.240066838+02:00 reservation-api The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port. │
│ 2022-09-13T20:49:46.240129835+02:00 reservation-api DOTNET_DiagnosticPorts="/diag/port.sock" │
│ 2022-09-13T20:49:46.240140342+02:00 reservation-api DOTNET_DefaultDiagnosticPortSuspend=0 So that one can use Thank you very munchies |
So we tried going another route. So not use This is the curl https://192.168.23.18:6443/api/v1/namespaces/spas/pods/{POD_NAME}/ephemeralcontainers \
--cacert ~/.kcli/clusters/some-cluster/auth/ca.crt \
--cert ~/.kcli/clusters/some-cluster/auth/client.crt \
--key ~/.kcli/clusters/some-cluster/auth/client.key \
-XPATCH \
-H 'Content-Type: application/strategic-merge-patch+json' \
-d '
{
"spec":
{
"ephemeralContainers":
[
{
"name": "debugger",
"args": [
"--no-auth"
],
"env": [{
"name": "DOTNETMONITOR_DiagnosticPort__ConnectionMode",
"value": "connect"
},
{
"name": "DOTNETMONITOR_DiagnosticPort__EndpointName",
"value": "/diag/port.sock"
},
{
"name": "DOTNETMONITOR_Storage__DumpTempFolder",
"value": "/diag/dumps"
}],
"image": "mcr.microsoft.com/dotnet/monitor",
"targetContainerName": "api",
"securityContext": {
"runAsUser": 1000
},
"stdin": true,
"tty": true,
"volumeMounts": [{
"emptyDir": "{}",
"mountPath": "/diag",
"name": "diagvol"
}]
}
]
}
}'
Any ideas and thanks. |
DOTNETMONITOR_DiagnosticPort__ConnectionMode needs to be set to |
I'm going to close this out due to lack of activity and I believe I've answered your last question of why the port.sock file was not appearing in the /diag directory. |
Yes sorry @jander-msft for being unresponsive. |
So from v1.23+ and stable in
Kubernetes
v1.25. We have ephemeral containers. I've tried to get the dotnet-monitor to work withephemeral
containers. So far haven't been able to.I've even tried manually calling the
RAW
Kubernetes
API
with good 'olcURL
. To get thevolumeMount
( diag / emptyDir ) mounted ( succeeding ). However, not getting much further from there.The application itself - running as a
Kubernetes
Deployment
- into which I'm trying to inject the dotnet-monitor as anephemeral
/debug
container, IS adotnet
v6
application.I'm just seeing:
Any advice or simply stating that this is not a supported use-case and why will be greatly appreciated.
Thank you
The text was updated successfully, but these errors were encountered: