Coder Social home page Coder Social logo

kssadanand / windows-debug Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jsturtevant/windows-debug

0.0 0.0 0.0 304 KB

krew plugin for launching a Windows host process pod that will give you access to the node

License: MIT License

Shell 63.75% PowerShell 27.24% Dockerfile 9.01%

windows-debug's Introduction

windows-debug

krew plugin for launching a Windows host process pod that will give you access to the specified Windows node.

gif of using krew to install and run as kubectl plugin

To use this plugin you will need: - kubernetes 1.22+ (with the WindowsHostProcessContainers feature-gate enabled) - containerd 1.6+ as the runtime

Usage

krew install windows-debug
kubectl windows-debug <node-name>

Host process pods with debug tools

The command uses an image with some basic debugging tools, like vim.

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.

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.

Using a custom image

If you don't want the extra tools or you have custom tools you want installed you can specify a custom image:

kubectl windows-debug <node-name> --image <image-name>

Releasing

Images

Modify the images in images folder and them to main branch.

The run:

git checkout main
git tag image-v<nextversion>
git push --tags

plugin

Update the default image in kubectl-windows-debug.

Create a new release (Release is managed krew release bot).

git checkout main
git tag v<nextversion>
git push --tags

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.

test plugin locally

# generate manifest
docker run -v $(pwd)/.krew.yaml:/tmp/template-file.yaml rajatjindal/krew-release-bot:v0.0.43 krew-release-bot template --tag <github-tag> --template-file /tmp/template-file.yaml > manifest.yaml


# install local package
curl -LO <release-package-url>/kubectl-windows-debug-<tag0-version>.tar.gz
kubectl krew install --manifest=manifest.yaml  --archive=kubectl-windows-debug-latest.tar.gz

See the following for details:

Use as standalone without plugin

You don't have to install this as a plugin via krew. You can also download and invoke the tool directly:

./kubectl-windows-debug <node-name>

You can also use it as a manual plugin by coping it to a location on your PATH:

cp kubectl-windows-debug /usr/local/bin
kubectl windows-debug

windows-debug's People

Contributors

jsturtevant avatar marosset avatar lalitmsft avatar mweibel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.