shell

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 13 Imported by: 1

README

retina-shell

Retina CLI provides a command to launch an interactive shell in a node or pod for adhoc debugging.

  • The CLI command kubectl retina shell creates a pod with HostNetwork=true (for node debugging) or an ephemeral container in an existing pod (for pod debugging).
  • The container runs an image built from the Dockerfile in this directory. The image is based on Azure Linux and includes commonly-used networking tools.
  • The pwru tool is bundled in the image for advanced kernel packet tracing.
  • bpftool is also included for eBPF debugging.

For testing, you can override the image used by retina shell either with CLI arguments (--retina-shell-image-repo and --retina-shell-image-version) or environment variables (RETINA_SHELL_IMAGE_REPO and RETINA_SHELL_IMAGE_VERSION).

Run kubectl retina shell -h for full documentation and examples.

Example: Running pwru and bpftool

To use pwru and bpftool inside the retina shell, you must grant the following Linux capabilities to the container:

  • NET_ADMIN
  • SYS_ADMIN

Capability requirements are based on common eBPF tool practices and not directly from the pwru documentation.

Example command to launch a shell with the required capabilities:

# Pod debugging
kubectl retina shell -n kube-system pod/coredns-57d886c994-8m2ph --capabilities=NET_ADMIN,SYS_ADMIN

Once inside the shell, you can run:

pwru --help
bpftool --help

Currently only Linux is supported; Windows support will be added in the future.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInNode

func RunInNode(config Config, nodeName, debugPodNamespace string) error

RunInNode starts an interactive shell on a node by creating a HostNetwork pod and attaching to it.

func RunInPod

func RunInPod(config Config, podNamespace, podName string) error

RunInPod starts an interactive shell in a pod by creating and attaching to an ephemeral container.

Types

type Config

type Config struct {
	RestConfig       *rest.Config
	RetinaShellImage string
	HostPID          bool
	Capabilities     []string
	Timeout          time.Duration

	// Host filesystem access applies only to nodes, not pods.
	MountHostFilesystem      bool
	AllowHostFilesystemWrite bool

	AppArmorUnconfined bool
	SeccompUnconfined  bool
}

Config is the configuration for starting a shell in a node or pod.

Jump to

Keyboard shortcuts

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