Skip to main content

A natural shell for debugging Juju Kubernetes workload containers via Pebble

Project description

borescope

A natural shell for debugging Juju Kubernetes workload containers.

Kubernetes charm workload containers usually run a rock with no shell — so when something breaks, juju ssh --container=workload … drops you nowhere useful. borescope gives you a prompt that feels like bash but talks to the container's Pebble instead of a real shell:

$ borescope myapp/0
pebble:/# ls /var/log/myapp
pebble:/# tail -f /var/log/myapp/error.log
pebble:/# services
pebble:/# logs --follow myapp
pebble:/# plan
pebble:/# exit

No setup ceremony: borescope picks up your current Juju controller/model and uses your existing juju authority — if you can juju ssh to the unit, borescope works; if you can't, it fails the same way.

Install

v1 is under active development. For now, from a checkout:

uv tool install .        # or: pipx install .

Usage

borescope <unit>                       # default (first) workload container
borescope <unit> --container=<name>    # a specific workload container
borescope --model <model> <unit>
borescope <unit> --command "services"  # one-shot, no REPL (for scripts)
borescope <unit> --snapshot            # dump container state as JSON

How it works

borescope is three thin, independently-testable layers:

  • Transport — talks to a Pebble. The primary backend (CliTransport) reaches the workload's Pebble through the charm containerjuju ssh <unit> (the charm container always has a shell) pointed at the workload's socket, which Juju mounts there at /charm/containers/<name>/pebble.socket. This works even against rocks with no shell (the shell lives in the charm container, not the rock) and stays entirely within your Juju authority — no kubectl or cluster-admin. It drives pebble via shimmer (a drop-in ops.pebble.Client over the Pebble CLI). When the Pebble socket is directly reachable (running inside the charm, or a local Pebble), SocketTransport uses the real ops.pebble.Client HTTP API instead.
  • Discovery — turns a unit reference into the right Pebble: confirms the unit, reads the charm's metadata.yaml for workload container names, and sanity-checks the container is alive. Everything uses your Juju model access — no kubectl / cluster-admin.
  • Shell — a small REPL: cd/pwd, path-aware tab completion, history, and a minimal command set. Pebble's own vocabulary (services, logs, plan, …) is first-class, not hidden behind a pebble prefix. For anything else, exec <cmd> runs a binary that's already in the container.

Scope

borescope is for Kubernetes charms (which run Pebble). Machine charms already have a real shell and are out of scope. It deliberately ships a minimal command set and grows on request — if a tool exists in the container, reach it with exec.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

borescope-0.1.0.dev1.tar.gz (39.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

borescope-0.1.0.dev1-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file borescope-0.1.0.dev1.tar.gz.

File metadata

  • Download URL: borescope-0.1.0.dev1.tar.gz
  • Upload date:
  • Size: 39.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for borescope-0.1.0.dev1.tar.gz
Algorithm Hash digest
SHA256 5b593287746bc791a1f09e286a79ba1a6686023b61f600acfe8aa469c4d4afe1
MD5 754d1551e2fe17ce49f53184f4edea75
BLAKE2b-256 8bfacb27089c4f4be781bffe64e8c3b2d96f4ea1091a5a3cbb20bdb3a83cc755

See more details on using hashes here.

Provenance

The following attestation bundles were made for borescope-0.1.0.dev1.tar.gz:

Publisher: publish.yaml on tonyandrewmeyer/borescope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file borescope-0.1.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: borescope-0.1.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for borescope-0.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 394bf715ab8cc04b37d575a7f70b35a754d86ee1bb6bdcdfa3027f0c4d7b698a
MD5 3ac0782327e96f264fc791d7d952d20a
BLAKE2b-256 407fc9ec7badad2bb37dc0f3b759eff01aa952128eb826fc3ac41b87f25003d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for borescope-0.1.0.dev1-py3-none-any.whl:

Publisher: publish.yaml on tonyandrewmeyer/borescope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page