Skip to content

jbasement/cp-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unofficial crossplane CLI - cp-cli

Unofficial Crossplane CLI as hobby project. The goal was to implement two commands describe and diagnose. These commands were created to speed up the debugging process of Composite Resources.

Commands

describe

The describe command takes a Composite Resource or Claim resource and name of the resource as args input. It then gets the resource and all its children and prints it out either as table in the CLI or a .png.

Variable Name Shorthand Default Description
namespace -n "default" Kubernetes namespace
kubeconfig -k "" Path to the Kubeconfig file.
output -o "cli" Output format of the resource. Must be one of "cli" or "graph".
fields -f parent, kind, name, synced, ready Comma-separated list of fields to display. Available fields are "parent", "name", "kind", "namespace", "apiversion", "synced", "ready", "message", "event".
path -p "./graph.png" Absolute path and filename for the output graph PNG. The filename must end with '.png'.

Usage: cp-cli describe TYPE[.GROUP] NAME

Example usage:

  1. cp-cli describe objectstorage my-object-storage
  2. cp-cli describe objectstorage my-object-storage -f name,kind,apiversion -o graph

diagnose

The diagnose command takes a Composite Resource or Claim resource and name of the resource as args input. Health checks are performed on the resource and its children, and every resource that is considered unhealthy will be printed out.

The command is similar to the describe command but only outputs resources diagnosed as unhealthy.

Variable Name Shorthand Default Description
namespace -n "default" Kubernetes namespace
kubeconfig -k "" Path to the Kubeconfig file.
fields -f parent, kind, apiversion, name, synced, ready, message, event Comma-separated list of fields to display. Available fields are "parent", "name", "kind", "namespace", "apiversion", "synced", "ready", "message", "event".

Usage: cp-cli describe TYPE[.GROUP] NAME

Example usage:

  1. cp-cli diagnose objectstorage my-object-storage
  2. cp-cli diagnose objectstorage my-object-storage -n my-namespace

TODOs

There are obviously still a lot of todos. Things to add:

  1. Testing
  2. Logging
  3. Better error handling
  4. Discover secrets of resources

Reference

cp-cli has been inspired by other projects:

About

Crossplane CLI written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages