Skip to content

CLI

KBeacon ships a Kubernetes-native CLI.

The preferred executable name is kbeacon. The backwards-compatible executable name is kbeaconctl.

By default, the CLI uses your current kubeconfig context and talks to the in-cluster KBeacon Agent through the Kubernetes API server Service proxy.

No kubectl port-forward is required for normal CLI usage.

Default connection

The default Agent Service target is:

kbeacon-system/kbeacon:http

That means this works when your kubeconfig context can access the cluster and the KBeacon Agent is installed in the default namespace:

kbeacon ready
kbeacon get config
kbeacon get secrets --limit 20

Use a temporary namespace override when KBeacon is installed elsewhere:

kbeacon --namespace platform-observability ready
kbeacon -n platform-observability get dependency-map --limit 100

Persistent defaults

Set the Agent namespace once:

kbeacon config set namespace kbeacon-system

Then use the CLI without repeating --namespace:

kbeacon ready
kbeacon impact report payments payments-db

Inspect and manage stored defaults:

kbeacon config path
kbeacon config view
kbeacon config get namespace
kbeacon config unset namespace
kbeacon config reset

Supported persistent keys:

namespace
service
service-port
kubeconfig
context
server

The default persistent config file is ~/.kbeaconctl/config.json. The path keeps the historical kbeaconctl name so both kbeacon and kbeaconctl share the same defaults.

Temporary overrides

Global flags must be placed before the command:

kbeacon --namespace kbeacon-system ready
kbeacon --service kbeacon --service-port http ready
kbeacon --context minikube ready
kbeacon --kubeconfig ~/.kube/config ready

Release binaries

Semantic releases publish preferred kbeacon binaries and backwards-compatible kbeaconctl binaries for Linux and macOS. Both binaries use the same implementation and differ only by executable name in help and version output.

Download the matching asset for your OS and architecture, verify it with checksums.txt, and install it as kbeacon on your PATH.

Direct Agent URL mode

For controlled debugging or compatibility with older automation, pass --server.

This disables Kubernetes service proxy mode and sends HTTP requests directly to the Agent URL. Use this only when the Agent API is exposed through an approved internal endpoint.

kbeacon --server https://kbeacon.example.internal ready

Common commands

Check Agent health and readiness:

kbeacon health
kbeacon ready

Discover API resources and graph summary:

kbeacon api
kbeacon get config

List graph resources:

kbeacon get secrets --limit 50
kbeacon get workloads --namespace payments
kbeacon get dependency-map --secret-name payments-db --limit 100

Inspect Secret blast radius:

kbeacon impact report payments payments-db
kbeacon impact --format json payments payments-db

Fetch workload dependencies:

kbeacon dependencies payments Deployment payments-api

Export and diff snapshots:

kbeacon snapshot export --output before.json
kbeacon snapshot export --output after.json
kbeacon snapshot diff --format markdown before.json after.json

Request a raw Agent API path:

kbeacon raw /api/v1/config

RBAC notes

The CLI uses your kubeconfig credentials.

In Kubernetes proxy mode, the user or service account running the CLI must be allowed to access the KBeacon Service proxy in the target namespace.

A restricted user may need permission for the services/proxy subresource for the kbeacon Service.

The CLI does not read Kubernetes Secret values. It only queries the KBeacon Agent API, which exposes Secret names, metadata, and dependency relationships.

Troubleshooting

Show the active CLI configuration:

kbeacon config view

Try an explicit namespace:

kbeacon --namespace kbeacon-system ready

If Kubernetes proxy mode returns 403, check the current kubeconfig identity and RBAC for the KBeacon Service proxy.

Use --server only when the Agent API is intentionally exposed through an approved internal endpoint.