Skip to content

Commit

Permalink
Add README content, update log statement and hide default cobra cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Abhisman Sarkar <abhisman_sarkar@lineaje.com>
  • Loading branch information
Abhisman Sarkar committed Jan 9, 2024
1 parent 7b98b5f commit 0ee0d66
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
# Kubecollect

Go tool to scan your Kubernetes cluster and provide you with a quick summary

## Installation

You can run `go build -o kcl` to build the binary locally or download from the **Releases** tab

## Features

1. Quick summary of your Kubernetes cluster status and the option to point to specific namespaces
2. Customizable logging

## Requirements

1. Go version 1.21.5 or higher
2. Access to a Kubernetes cluster

## Issues

Open issues if you're having trouble with the tool or you feel that the documentation is lacking

## Flags

Currently there exists a single sub-command: `check` with 3 flags:

1. **--kubeconfig**: This flag stores the path to the kubeconfig file for your cluster. If not specified, it will try to access the file from the default location in `~/.kube/config`

2. **--logger**: This flag enables logging for the application run and creates a `kubecollect.log` based on the path where your run the app from

3. **--namespaces**: This flag stores a string slice of the namespaces that you want to get cluster status from. If no namespaces are provided then, all the namespaces from your cluster are used to get the cluster status update

## Usage

![kcl command screenshot 1](/images/image1.png)

![kcl command screenshot 2](/images/image2.png)
4 changes: 3 additions & 1 deletion cmd/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ var CheckCmd = &cobra.Command{
log.Fatal("Kubeconfig file not found. Program will exit.")
}
}
} else {
log.Print("Using kubeconfig file from the path provided")
}

if err := readData(kubeconfig, namespaces); err != nil {
Expand Down Expand Up @@ -156,7 +158,7 @@ func readData(kubeconfig string, namespaces []string) error {
table.Append(row)
}

table.Render() // Send output
table.Render() // Create Table output

return nil
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ func Execute() {

func init() {
rootCmd.AddCommand(check.CheckCmd)
// Hide the default "completion" sub-command
rootCmd.CompletionOptions.HiddenDefaultCmd = true
}
Binary file added images/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/image2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0ee0d66

Please sign in to comment.