Skip to content

Commit

Permalink
Add Grafana Dashboard (#118)
Browse files Browse the repository at this point in the history
* add initial dashboard

* add initial dashboard to readme

* Added all/multi selection filtering for namespaces and filtering by kind. Added new panel for displaying all unused resources (pie and bar chart options). (#121)

Retained original panels at the bottom with added namespace filter options for comparison.

* add dashboard and screenshot

---------

Co-authored-by: Yonah Dissen <[email protected]>
Co-authored-by: Yonatan Sasson <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2023
1 parent 86e1bff commit 88aae2f
Show file tree
Hide file tree
Showing 3 changed files with 1,246 additions and 27 deletions.
35 changes: 8 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,34 +127,11 @@ kor [subcommand] --help


## Ignore Resources
The resources labeled with "kor/used = true" will be ignored by kor even if they are unused. You can add this label to resources you want to ignore.

## Import Option
You can also use kor as a Go library to programmatically discover unused resources. By importing the github.com/yonahd/kor/pkg/kor package, you can call the relevant functions to retrieve unused resources. The library provides the option to get the results in JSON format by specifying the outputFormat parameter.

```go
import (
"github.com/yonahd/kor/pkg/kor"
)

func main() {
myNamespaces := kor.IncludeExcludeLists{
IncludeListStr: "my-namespace1, my-namespace2",
}
outputFormat := "json" // Set to "json" for JSON output

if outputFormat == "json" {
jsonResponse, err := kor.GetUnusedDeploymentsStructured(myNamespaces, kubeconfig, "json")
if err != nil {
// Handle error
}
// Process the JSON response
// ...
} else {
kor.GetUnusedDeployments(namespace)
}
}
The resources labeled with:
```sh
kor/used=true
```
will be ignored by kor even if they are unused. You can add this label to resources you want to ignore.

## In Cluster Usage

Expand Down Expand Up @@ -192,6 +169,10 @@ helm upgrade -i kor \
./charts/kor
```

## Grafana Dashboard
Dashboard can be found [here](https://grafana.com/grafana/dashboards/19863-kor-dashboard/).
![Grafana Dashboard](/grafana/dashboard-screenshot-1.png)

## Contributing

Contributions are welcome! If you encounter any bugs or have suggestions for improvements, please open an issue in the [issue tracker](https://github.com/yonahd/kor/issues).
Expand Down
Binary file added grafana/dashboard-screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 88aae2f

Please sign in to comment.