├── .gitattributes ├── .github └── workflows │ ├── cleanup.yaml │ ├── images.yaml │ └── release.yaml ├── .gitignore ├── .krew.yaml ├── LICENSE ├── README.md ├── images ├── Dockerfile ├── Dockerfile.installer-cache ├── build-installer-cache.ps1 ├── build.sh ├── clean-up.sh └── content │ ├── ContainerPlatform.wprp │ ├── Get-NetworkDebuggingScripts.ps1 │ └── collect-hcs-traces.md ├── kubectl-windows-debug └── kubectl-windows-debug.gif /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf 2 | *.yaml text eol=lf 3 | kubectl-windows-debug eol=lf -------------------------------------------------------------------------------- /.github/workflows/cleanup.yaml: -------------------------------------------------------------------------------- 1 | name: image-cleanup 2 | 3 | on: 4 | schedule: 5 | - cron: '4 */23 * * *' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | # use gh cli to delete container images from registry when it is pr event 10 | clean-up-pr-images: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | # delete images 15 | - name: delete images 16 | env: 17 | GH_TOKEN: ${{ secrets.DELETE_PAT }} 18 | run: | 19 | ./images/clean-up.sh 20 | -------------------------------------------------------------------------------- /.github/workflows/images.yaml: -------------------------------------------------------------------------------- 1 | name: image 2 | 3 | on: 4 | push: 5 | tags: ["image-v*"] 6 | pull_request: 7 | branches: 8 | - main 9 | path: 10 | - 'images/**' 11 | - '.github/workflows/images.yaml' 12 | - '.github/workflows/cleanup.yaml' 13 | 14 | permissions: 15 | packages: write 16 | pull-requests: write 17 | 18 | defaults: 19 | run: 20 | working-directory: images 21 | 22 | jobs: 23 | build-installer-image: 24 | runs-on: windows-2022 25 | steps: 26 | - name: login to GitHub container registry 27 | uses: docker/login-action@v1 28 | with: 29 | registry: ghcr.io 30 | username: ${{ github.repository_owner }} 31 | password: ${{ secrets.GITHUB_TOKEN }} 32 | - uses: actions/checkout@v2 33 | # set image version based on event type 34 | - name: get version from tag 35 | if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} 36 | run: | 37 | $imageversion=$env:GITHUB_REF_NAME -replace "image-", "" 38 | "IMAGE_VERSION=$imageversion" >> $env:GITHUB_ENV 39 | - name: get version for PR 40 | if: ${{ github.event_name == 'pull_request' }} 41 | run: | 42 | "IMAGE_VERSION=pr-${{ github.event.number }}" >> $env:GITHUB_ENV 43 | # build and publish image 44 | # need to always publish this image so can use it to build the debug image for verification 45 | - name: build image 46 | run: | 47 | echo $env:IMAGE_VERSION 48 | .\build-installer-cache.ps1 -version $env:IMAGE_VERSION 49 | - name: push image 50 | run: | 51 | echo $env:IMAGE_VERSION 52 | $tag=$env:IMAGE_VERSION 53 | docker image push ghcr.io/jsturtevant/debug-installer-cache:$tag 54 | - name: comment on PR 55 | if: ${{ github.event_name == 'pull_request' }} 56 | env: 57 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 58 | run: | 59 | $comment=@" 60 | Thank you for the contribution :rocket: The debug installer cache image has been published to a temporary repository. 61 | 62 | You can use it by referencing: ``ghcr.io/jsturtevant/debug-installer-cache:$env:IMAGE_VERSION``. 63 | 64 | It will be removed in 24 hours. 65 | "@ 66 | 67 | gh api --method POST -H "Accept: application/vnd.github+json" /repos/jsturtevant/windows-debug/issues/${{ github.event.pull_request.number }}/comments -f body="$comment" 68 | build-debug-image: 69 | needs: build-installer-image 70 | runs-on: ubuntu-latest 71 | steps: 72 | - name: login to GitHub container registry 73 | uses: docker/login-action@v1 74 | with: 75 | registry: ghcr.io 76 | username: ${{ github.repository_owner }} 77 | password: ${{ secrets.GITHUB_TOKEN }} 78 | - uses: actions/checkout@v2 79 | # set image version based on event type 80 | - name: get version from tag 81 | if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} 82 | run: | 83 | imageversion=$(echo $GITHUB_REF_NAME | sed 's/^image-//') 84 | echo "IMAGE_VERSION=$imageversion" >> $GITHUB_ENV 85 | - name: get version for PR 86 | if: ${{ github.event_name == 'pull_request' }} 87 | run: | 88 | echo "IMAGE_VERSION=pr-${{ github.event.number }}" >> $GITHUB_ENV 89 | # build and publish image 90 | - name: build image 91 | run: | 92 | echo $IMAGE_VERSION 93 | sudo VERSION=$IMAGE_VERSION INSTALLER_VERSION=$IMAGE_VERSION ./build.sh 94 | - name: push image 95 | if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} 96 | run: | 97 | echo $IMAGE_VERSION 98 | OUTPUT=registry VERSION=$IMAGE_VERSION INSTALLER_VERSION=$IMAGE_VERSION ./build.sh 99 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*.*.*' 7 | branches: 8 | - main 9 | pull_request: 10 | branches: 11 | - main 12 | 13 | jobs: 14 | release: 15 | runs-on: ubuntu-latest 16 | if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@master 20 | - name: build package 21 | run: | 22 | tar -czvf kubectl-windows-debug-${GITHUB_REF_NAME}.tar.gz LICENSE README.md kubectl-windows-debug 23 | - name: Release package 24 | uses: softprops/action-gh-release@v1 25 | with: 26 | files: kubectl-windows-debug-${{ github.ref_name }}.tar.gz 27 | - name: Update new version in krew-index 28 | uses: rajatjindal/krew-release-bot@v0.0.43 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /manifest.yaml 3 | /kubectl-windows-debug-*.tar.gz 4 | -------------------------------------------------------------------------------- /.krew.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: krew.googlecontainertools.github.com/v1alpha2 2 | kind: Plugin 3 | metadata: 4 | name: windows-debug 5 | spec: 6 | version: {{ .TagName }} 7 | homepage: https://github.com/jsturtevant/windows-debug 8 | platforms: 9 | - selector: 10 | matchLabels: 11 | os: darwin 12 | {{addURIAndSha "https://github.com/jsturtevant/windows-debug/releases/download/{{ .TagName }}/kubectl-windows-debug-{{ .TagName }}.tar.gz" .TagName }} 13 | bin: kubectl-windows-debug 14 | - selector: 15 | matchLabels: 16 | os: linux 17 | arch: amd64 18 | {{addURIAndSha "https://github.com/jsturtevant/windows-debug/releases/download/{{ .TagName }}/kubectl-windows-debug-{{ .TagName }}.tar.gz" .TagName }} 19 | bin: kubectl-windows-debug 20 | shortDescription: Windows node access via kubectl 21 | description: | 22 | kubectl plugin for launching a Windows pod that will give you access to the specified node 23 | and provide a few useful utilities for debugging Windows processes. 24 | Access to the node is provided by a Windows Host Process Containers feature in Kubernetes. 25 | 26 | To use this plugin you will need: 27 | - kubernetes 1.22+ (with the WindowsHostProcessContainers feature-gate enabled) 28 | - containerd 1.6+ as the runtime 29 | 30 | By default it uses container image https://github.com/jsturtevant/windows-debug/pkgs/container/windows-debug 31 | which has some useful utilities for debugging Windows processes pre-installed. 32 | You can provide your own image by using --image flag. 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 James Sturtevant 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # windows-debug 2 | krew plugin for launching a Windows host process pod that will give you access to the specified Windows node. 3 | 4 | ![gif of using krew to install and run as kubectl plugin](./kubectl-windows-debug.gif) 5 | 6 | To use this plugin you will need: 7 | - kubernetes 1.22+ (with the [WindowsHostProcessContainers](https://kubernetes.io/docs/tasks/configure-pod-container/create-hostprocess-pod/) feature-gate enabled) 8 | - containerd 1.6+ as the runtime 9 | 10 | ## Usage 11 | 12 | ```bash 13 | krew install windows-debug 14 | kubectl windows-debug 15 | ``` 16 | 17 | ## Host process pods with debug tools 18 | 19 | The command uses an image with some basic debugging tools, like vim. 20 | 21 | It is also built using the host process scratch image which contains nothing but the tools required. This minimizes download times since you don't need to download nanoserver or windows server core images which are large and the binaries are not used in host process pods. 22 | 23 | The scratch image has a limitation that it can only be built with buildx. Buildx cannot be used to install the tools since it doesn't support `RUN` commands for Windows. To work around this, the installer image is built on windows and used a cache. The final image copies the files from the cache to the scratch image. 24 | 25 | ## Using a custom image 26 | If you don't want the extra tools or you have custom tools you want installed you can specify a custom image: 27 | 28 | ```bash 29 | kubectl windows-debug --image 30 | ``` 31 | 32 | ## Releasing 33 | 34 | ### Images 35 | 36 | Modify the images in `images` folder and them to main branch. 37 | 38 | The run: 39 | 40 | ```bash 41 | git checkout main 42 | git tag image-v 43 | git push --tags 44 | ``` 45 | 46 | ### plugin 47 | 48 | Update the default image in [kubectl-windows-debug](/kubectl-windows-debug). 49 | 50 | Create a new release (Release is managed [krew release bot](https://github.com/rajatjindal/krew-release-bot)). 51 | 52 | ```bash 53 | git checkout main 54 | git tag v 55 | git push --tags 56 | ``` 57 | 58 | The automation will create a github release and open a PR in https://github.com/kubernetes-sigs/krew-index. As long as only the version is changed, the PR will be automatically merged. 59 | 60 | ## test plugin locally 61 | 62 | ```bash 63 | # generate manifest 64 | docker run -v $(pwd)/.krew.yaml:/tmp/template-file.yaml rajatjindal/krew-release-bot:v0.0.43 krew-release-bot template --tag --template-file /tmp/template-file.yaml > manifest.yaml 65 | 66 | 67 | # install local package 68 | curl -LO /kubectl-windows-debug-.tar.gz 69 | kubectl krew install --manifest=manifest.yaml --archive=kubectl-windows-debug-latest.tar.gz 70 | ``` 71 | 72 | See the following for details: 73 | 74 | - https://krew.sigs.k8s.io/docs/developer-guide/testing-locally/ 75 | - https://github.com/rajatjindal/krew-release-bot#testing-the-template-file 76 | 77 | ## Use as standalone without plugin 78 | 79 | You don't have to install this as a plugin via krew. You can also download and invoke the tool directly: 80 | 81 | ```bash 82 | ./kubectl-windows-debug 83 | ``` 84 | 85 | You can also use it as a manual plugin by coping it to a location on your `PATH`: 86 | 87 | ``` 88 | cp kubectl-windows-debug /usr/local/bin 89 | kubectl windows-debug 90 | ``` -------------------------------------------------------------------------------- /images/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG INSTALLER_VERSION="${latest}" 2 | FROM ghcr.io/jsturtevant/debug-installer-cache:${INSTALLER_VERSION} as installer 3 | 4 | FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v0.1.0 AS runtime 5 | 6 | WORKDIR /debug 7 | COPY --from=installer /content/ContainerPlatform.wprp . 8 | COPY --from=installer /content/collect-hcs-traces.md . 9 | COPY --from=installer /debug/net ./network 10 | 11 | WORKDIR /apps 12 | ENV PATH="%CONTAINER_SANDBOX_MOUNT_POINT%\apps\vim;%CONTAINER_SANDBOX_MOUNT_POINT%\apps\sysinternals;C:\Windows\system32;C:\Windows" 13 | 14 | COPY --from=installer /ProgramData/scoop/apps/vim/9.0 ./vim/ 15 | -------------------------------------------------------------------------------- /images/Dockerfile.installer-cache: -------------------------------------------------------------------------------- 1 | ARG OS=ltsc2022 2 | FROM mcr.microsoft.com/windows/servercore:${OS} as installer 3 | 4 | # Install VIM via https://scoop.sh/ 5 | RUN powershell /c "iex ""& {$(irm get.scoop.sh)} -RunAsAdmin""" 6 | RUN scoop install vim@9.0 --global 7 | 8 | # Get ntwork debugging scripts 9 | COPY ./content /content/ 10 | RUN powershell ./content/Get-NetworkDebuggingScripts.ps1 -dest /debug/net/ 11 | -------------------------------------------------------------------------------- /images/build-installer-cache.ps1: -------------------------------------------------------------------------------- 1 | param ($version='latest', $image='ghcr.io/jsturtevant/debug-installer-cache') 2 | 3 | docker build -t "${image}:${version}" -f Dockerfile.installer-cache . 4 | -------------------------------------------------------------------------------- /images/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | output=${OUTPUT:=local,dest=/tmp/} 4 | INSTALLER_VERSION="${INSTALLER_VERSION:=latest}" 5 | version="${VERSION:=latest}" 6 | image="${IMAGE:=ghcr.io/jsturtevant/windows-debug:$version}" 7 | 8 | on_exit() { 9 | docker buildx rm img-builder 10 | } 11 | 12 | trap on_exit EXIT 13 | 14 | docker buildx create --name img-builder --use --platform windows/and64 15 | docker buildx build \ 16 | --platform windows/amd64 \ 17 | --output=type=$output \ 18 | --build-arg INSTALLER_VERSION="$INSTALLER_VERSION" \ 19 | -f Dockerfile \ 20 | -t "$image" . 21 | -------------------------------------------------------------------------------- /images/clean-up.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | image="${IMAGE:-debug-installer-cache}" 4 | 5 | 6 | echo "deleting images '$image' that start with 'pr-'" 7 | imageid=$(gh api \ 8 | -H "Accept: application/vnd.github+json" \ 9 | /users/jsturtevant/packages/container/${image}/versions \ 10 | --jq '.[] | select(.metadata.container.tags | any(startswith("pr-"))) | .id') 11 | 12 | for id in $imageid; do 13 | # check if image is older than 20hrs 14 | image_age=$(gh api \ 15 | -H "Accept: application/vnd.github+json" \ 16 | /users/jsturtevant/packages/container/${image}/versions/$id \ 17 | --jq '.updated_at') 18 | 19 | tags=$(gh api \ 20 | -H "Accept: application/vnd.github+json" \ 21 | /users/jsturtevant/packages/container/${image}/versions/$id \ 22 | --jq '.metadata.container.tags') 23 | 24 | if [[ $(date -d "$image_age" +%s) > $(date -d "24 hours ago" +%s) ]]; then 25 | echo "image $id with tag $tags isn't old enough, skipping" 26 | continue 27 | fi 28 | 29 | echo "deleting image $id with $tags" 30 | # https://github.com/cli/cli/issues/3937 31 | echo -n | gh api --method DELETE -H "Accept: application/vnd.github+json" \ 32 | /users/jsturtevant/packages/container/${image}/versions/$id \ 33 | --input - 34 | done -------------------------------------------------------------------------------- /images/content/ContainerPlatform.wprp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /images/content/Get-NetworkDebuggingScripts.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | [string] $dest = "." 3 | ) 4 | 5 | $ErrorActionPreference = "Stop" 6 | 7 | if (-not(Test-Path -Path $dest)) { 8 | New-Item -Path $dest -ItemType Directory -Force 9 | } 10 | 11 | $scripts = @( 12 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/hns.psm1", 13 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/hns.v2.psm1", 14 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/VFP.psm1", 15 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/collectlogs.ps1", 16 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/dumpVfpPolicies.ps1", 17 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/networkhealth.ps1", 18 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/portReservationTest.ps1", 19 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/starthnstrace.cmd", 20 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/starthnstrace.ps1", 21 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/startpacketcapture.cmd", 22 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/startpacketcapture.ps1", 23 | "https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/stoppacketcapture.cmd" 24 | ) 25 | 26 | foreach ($script in $scripts) { 27 | $filename = Split-Path $script -leaf 28 | Write-Output "Downloading $filename" 29 | $destPath = Join-Path $dest $filename 30 | curl.exe -L $script -o $destPath -s 31 | } 32 | -------------------------------------------------------------------------------- /images/content/collect-hcs-traces.md: -------------------------------------------------------------------------------- 1 | # Collecting HCS traces 2 | 3 | Use Windows Performance Recorder and the included ContainerPlatform.wprp file to collect HCS traces. 4 | To do so run: 5 | 6 | ```cmd 7 | wpr.exe -start c:\hpc\debug\containerplatform.wprp 8 | 9 | wpr.exe -stop trace.etl 10 | ``` 11 | 12 | Then use https://docs.microsoft.com/windows-hardware/test/wpt/windows-performance-analyzer to view the traces saved in trace.etl -------------------------------------------------------------------------------- /kubectl-windows-debug: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # default image 4 | image="ghcr.io/jsturtevant/windows-debug:v1.0.0" 5 | 6 | POSITIONAL=() 7 | while [[ $# -gt 0 ]] 8 | do 9 | key="$1" 10 | 11 | case $key in 12 | -h|--help) 13 | echo "Windows node access via kubectl" 14 | echo " " 15 | echo "kubectl windows-debug [options]" 16 | echo " " 17 | echo "options:" 18 | echo "-h, --help Show brief help" 19 | echo "-i, --image use custom image" 20 | echo "-r, --requests set resource requests for the debug container (e.g., CPU and memory)" 21 | echo "-l, --limits set resource limit for the debug container (e.g., maximum CPU and memory)" 22 | exit 0 23 | ;; 24 | -i | --image) 25 | image="$2" 26 | shift # past argument 27 | shift # past value 28 | ;; 29 | -r|--requests) 30 | requests="$2" 31 | shift # past argument 32 | shift # past value 33 | ;; 34 | -l|--limits) 35 | limits="$2" 36 | shift # past argument 37 | shift # past value 38 | ;; 39 | *) # unknown option 40 | POSITIONAL+=("$1") 41 | shift # past argument 42 | ;; 43 | esac 44 | done 45 | set -- "${POSITIONAL[@]}" # restore positional parameters 46 | nodename="$1" 47 | 48 | echo "Running on node '$nodename' with image '$image'" 49 | 50 | echo "Running with requests '$requests' and limits '$limits'" 51 | 52 | if [[ -n "${requests}" ]]; then 53 | request_json=$(echo $requests | awk 'BEGIN{FS="[=,]"}{printf "{\"%s\":\"%s\",\"%s\":\"%s\"}", $1, $2, $3, $4}') 54 | else 55 | request_json="{}" 56 | fi 57 | 58 | if [[ -n "${limits}" ]]; then 59 | limit_json=$(echo $limits | awk 'BEGIN{FS="[=,]"}{printf "{\"%s\":\"%s\",\"%s\":\"%s\"}", $1, $2, $3, $4}') 60 | else 61 | limit_json="{}" 62 | fi 63 | 64 | # sometime ns default is empty from this command so default if it is 65 | namespace=$(kubectl config view --minify --output 'jsonpath={..namespace}') 66 | if [ -z "$namespace" ]; then namespace="default"; fi; 67 | 68 | podname=windows-debug-${RANDOM} 69 | 70 | overrides=$(cat <<-JSON 71 | { 72 | "spec": { 73 | "containers": [ 74 | { 75 | "name": "$podname", 76 | "image": "$image", 77 | "resources": { 78 | "requests": $request_json, 79 | "limits": $limit_json 80 | } 81 | } 82 | ], 83 | "nodeName": "$nodename", 84 | "nodeSelector": { 85 | "kubernetes.io/os": "windows" 86 | }, 87 | "hostNetwork": true, 88 | "securityContext": { 89 | "windowsOptions": { 90 | "hostProcess": true, 91 | "runAsUserName": "NT AUTHORITY\\\\SYSTEM" 92 | } 93 | } 94 | } 95 | } 96 | JSON 97 | ) 98 | 99 | kubectl run $podname \ 100 | -it --rm -n $namespace --image $image \ 101 | --image-pull-policy=Always \ 102 | --restart=Never --overrides "$overrides" \ 103 | --override-type=strategic \ 104 | --pod-running-timeout=15m0s \ 105 | --command -- powershell 106 | -------------------------------------------------------------------------------- /kubectl-windows-debug.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsturtevant/windows-debug/b2e7b0902cb1536ff5ba391cbb867c2c1dbc83bb/kubectl-windows-debug.gif --------------------------------------------------------------------------------