-
-
Save mrjamiebowman/ca03b227e5c8d3f297b0f71138792c72 to your computer and use it in GitHub Desktop.
Script for starting remote debugging of dotnet app in kubernetes from Visual Studio 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SELECTOR = "" | |
# searching for the pod to connect to by selector and namespace | |
$POD=`kubectl get pods -n $NAMESPACE --selector=$SELECTOR -o jsonpath='{.items[0].metadata.name}'`; | |
Write-Host "POD: " + $POD | |
# starting remote debugger that we installed earlier inside our docker image | |
#kubectl exec $POD -n $NAMESPACE -i -- ../vsdbg/vsdbg --interpreter=vscode; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
while [ "$1" != "" ]; do | |
case $1 in | |
-n | --namespace) | |
NAMESPACE=$2 | |
shift 2 | |
;; | |
-s | --selector) | |
SELECTOR=$2 | |
shift 2 | |
;; | |
esac | |
done | |
# searching for the pod to connect to by selector and namespace | |
POD=`kubectl get pods -n ${NAMESPACE} --selector=$SELECTOR -o jsonpath='{.items[0].metadata.name}'`; | |
# starting remote debugger that we installed earlier inside our docker image | |
kubectl exec $POD -n ${NAMESPACE} -i -- ../vsdbg/vsdbg --interpreter=vscode; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment