kubectl debugging plugin to collect full or partial cluster state and serve via an api server. Kubernetes time machine
APACHE-2.0 License
crust-gather
is a kubectl
plugin that provides functionality, which allows to collect full or partial cluster state and serve it via an api server.
ConfigMap
via --config-map
.--kubeconfig-secret-name
or --kubeconfig-secret-label
.secrets
file.crust-gather serve
(Demo).One of the QoL features crust-gather
provides is an ability to collect cluster snapshots during CI workflow run and serve the content like a k8s cluster after the originating cluster is removed. It can serve any number of clusters simulaniously, each cluster stored under separate context.
Easy to use version of this provided via nix
shell script, which includes artifact download and crust-gather installation:
# Requires GITHUB_TOKEN to be set
./serve-artifact.sh --owner rancher-sandbox --repo cluster-api-provider-rke2 --artifact_id 1461387168 &
# alternatively, if you have an artifact link
./serve-artifact.sh -u https://github.com/rancher-sandbox/cluster-api-provider-rke2/actions/runs/8923331571/artifacts/1467008322 &
kubectl get ns
NAME
capd-system
capi-system
...
Depending on the installation type, there might be needed:
The plugin can be installed with krew
and used as follows:
kubectl krew install crust-gather
kubectl crust-gather --help
Alternatively, it can be installed standalone via install.sh
script:
curl -sSfL https://github.com/crust-gather/crust-gather/raw/main/install.sh | sh
crust-gather --help
Or used with nix
:
nix-shell -p 'callPackage (fetchGit https://github.com/crust-gather/crust-gather) {}'
kubectl-crust-gather --help
To run tests locally you need to have golang
and kwok
pre-installed. On linux and mac this will be done automatically with the test command:
make test
Alternatively you can pass GOOS
or GOARCH
directly to the make task:
GOOS=linux GOARCH=amd64 make test