Skip to content

A simple kubectl plugin to launch ephemeral containers.

License

Notifications You must be signed in to change notification settings

embik/kubectl-ephemeral

Repository files navigation

kubectl-ephemeral

A simple kubectl plugin that allows launching ephemeral containers from a YAML file (as kubectl debug does not expose all options).

Installation

kubectl-ephemeral is currently available from my krew index or my Homebrew tap.

Krew

This installation method requires krew installed.

Add the krew index and synchronize the local copy of it:

$ kubectl krew index add embik https://github.com/embik/krew-index.git
$ kubectl krew update

kubectl-ephemeral can now be installed with the following command:

$ kubectl krew install embik/ephemeral

Homebrew

Installation via Homebrew is possible with the following command:

$ brew install embik/tap/kubectl-ephemeral

Manual

Run make build to get the binary _build/kubectl-ephemeral built. Then run:

$ chmod +x _build/kubectl-ephemeral
$ cp _build/kubectl-ephemeral /usr/local/bin/kubectl-ephemeral # or somewhere else where it will be available in your PATH

Usage

kubectl-ephemeral requires you to provide a YAML file that describes the ephemeral container you want to launch. An example on how to launch Delve to debug a running Go application is provided in examples/delve.yaml.

The ephemeral container specification mostly aligns with normal containers, but some differences exist. In doubt, check the corev1.EphemeralContainer type.

$ kubectl ephemeral <target pod name> -f <path to ephemeral container>.yaml -c <target container name>