k8s-knife

command module
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2024 License: GPL-3.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

kubectl-knife

goreleaser CI

kubectl-knife is a tool to run commands on multiple pods concurrently using kubectl commands

Install

Binary: MacOS (amd64/arm64), Windows, Linux
https://github.com/spideyz0r/kubectl-knife/releases
From source
git checkout https://github.com/spideyz0r/kubectl-knife
cd kubectl-knife; go build -v -o kubectl-knife

Usage

Usage: kubectl-knife [-dhs] [-C value] [-c value] [-m value] [-n value] [-p value] [-S value] [parameters ...]
 -C, --command=value
                    command to run, if empty, just list pods
 -c, --context=value
                    context regex
 -d, --debug        debug mode
 -h, --help         display this help
 -m, --max-concurrency=value
                    max concurrency, default: 10
 -n, --namespace=value
                    namespace regex
 -p, --pod=value    pod regex
 -S, --shell=value  default: sh
 -s, --skip-filter  skip filtering, does not use regex

Install it as a kubectl knife plugin:

1 Download or compile the binary 2 Rename it to kubectl-knife 3 Make sure the binary is included in your $PATH

$ kubectl knife -h
Usage: kubectl-knife [-dhs] [-C value] [-c value] [-m value] [-n value] [-p value] [-S value] [parameters ...]
 -C, --command=value
                    command to run, if empty, just list pods
 -c, --context=value
                    context regex
 -d, --debug        debug mode
 -h, --help         display this help
 -m, --max-concurrency=value
                    max concurrency, default: 10
 -n, --namespace=value
                    namespace regex
 -p, --pod=value    pod regex
 -S, --shell=value  default: sh
 -s, --skip-filter  skip filtering, does not use regex

TODO

  • Improve pod listing output, and make it more useful
  • Dynamically tries /bin/sh, /bin/dash, /bin/bash, /bin/ash ===> sh -c "ls -d /tmp" || bash -c "ls -d /tmp" || ash -c "ls -d /tmp" || dash -c "ls -d /tmp"
  • Put it availabe on krew
  • When no ns/ctx are specified, use whatever the user has set
  • Configure timeout for API calls via go context

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址