Categorygithub.com/sbreitf1/testpod
repositorypackage
0.11.1
Repository: https://github.com/sbreitf1/testpod.git
Documentation: pkg.go.dev

# README

Testpod

Util to run a Pod for testing in your currently selected Kubernetes namespace via kubectl and enter a shell in it.

Installation

go install github.com/sbreitf1/testpod@latest

Usage

First run will create a default configuration in ~/.config/testpod (XDG compatible). Execute testpod --dry-run to only create a default configuration file without applying it to Kubernetes.

Edit the configuration file to set default image and shell to execute, as well as additional labels to apply to your Pod and configure a NetworkPolicy.

list

testpod list

Shows a list of running testpods in the currently selected context. No specialized flags are available for this command.

run (Default)

testpod run

Runs a new testpod in the currently selected context and enters a tty. This command is executed when no command is given. The following flags are available:

FlagDescription
--imageOverrides the default image from your template.
--shellOverrides the default shell from your template.
--label, -lDefine additional pod labels like foo=bar.
--nodeDefine node name to schedule the pod.
--select-nodeShow interactive node selection for pod scheduling.
--dry-runPrints the rendered manifests instead of applying them to Kubernetes.
--no-temp-kubeconfigDo not use temporary copy of kubeconfig file.

enter

testpod enter

Opens another shell on a running testpod in the selected context. Fails if none or multiple testpods are available. The following flags are available:

FlagDescription
--shellOverrides the default shell from your template.
--mineIgnores all testpods not managed by you.
--dry-runPrints the selected testpod instead of opening a new shell.
--no-temp-kubeconfigDo not use temporary copy of kubeconfig file.