Giter VIP home page Giter VIP logo

crust-gather

Description

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.

Some key features:

  • Collect all available resources across the cluster.
  • Collect container logs.
  • Collect node kubelet logs.
  • Resource collection is parallel, with exponential backoff retry and configurable timeout.
  • Filter collected resources based on regexes, include/excludes, namespaces, groups or kinds.
  • Advanced filters can be specified by CLI flags, configuration files or fetched from ConfigMap via --config-map.
  • Collect snapshot from kubeconfig stored in the cluster via --kubeconfig-secret-name or --kubeconfig-secret-label.
  • Display events in an HTML table with filtering capabilities.
  • Store data in a zip/tar.gz archive.
  • Hide out secret data, by providing environment keys with values to exclude during processing, or a secrets file.
  • Browse cluster snapshot with kubectl/k9s, via a local web server.
  • Collect cluster snapshot or multiple cluster snapshots in github actions workflow artifact and serve it via crust-gather serve (Demo).

Demo

asciicast

Helm charts demo

asciicast

Artifact serving

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
...

Prerequisites

Depending on the installation type, there might be needed:

Usage

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

Testing

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

crust-gather's Projects

crust-gather icon crust-gather

kubectl debugging plugin to collect full or partial cluster state and serve via an api server. Kubernetes time machine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.