Skip to content

toledompm/qubectl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Q

The q plugin queries the namespace for a pod and prompts the user for selection, after which it will forward the selected pod to a provided kubectl command. Some commands are handled directly by q and require further input from the user, simpler use cases should be handled by the custom command.

example-pf.gif

Installation

This plugin is not yet available in the krew index, but can be installed directly from the repository (go1.20 required).

# edit makefile to set the correct plugin path
make build

Usage

kubectl q [command] [flags]

Commands

custom

kubectl q custom [flags] -- [command + args + optional(replacement string)]

This command will prompt the user for a pod and then forward the selected pod to the provided command. The command must be provided after the -- flag as the first argument. The pod name will replace every instance of the string %% in the command.

# Describe the selected pod
kubectl q custom -- describe pod # -> kubectl describe pod <pod>

# Follow the logs of the selected pod (custom is the default command)
kubectl q -- logs -f # -> kubectl logs -f <pod>
# Execute a custom command on the selected pod (tty not supported)
kubectl q -- exec %% -- ls # -> kubectl exec <pod> -- ls

port-forward

kubectl q port-forward [flags] -- [args]

This command will prompt the user for a pod and then forward the selected ports using the kubectl port-forward command.

Flags

-r (regex)

kubectl q -r [regex]

This flag will filter the list of pods by the provided regex. The regex is applied to the pod name.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors