Skip to content

Commit

Permalink
Document: add delete flag in Readme (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
yonahd authored Nov 5, 2023
1 parent fdec9c6 commit e74ae57
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,20 @@ Kor provides various subcommands to identify and list unused resources. The avai

### Supported Flags
```
--delete Delete unused resources
-l, --exclude-labels string Selector to filter out, Example: --exclude-labels key1=value1,key2=value2.
-e, --exclude-namespaces string Namespaces to be excluded, splited by comma. Example: --exclude-namespace ns1,ns2,ns3. If --include-namespace is set, --exclude-namespaces will be ignored.
-h, --help help for kor
-n, --include-namespaces string Namespaces to run on, splited by comma. Example: --include-namespace ns1,ns2,ns3.
-k, --kubeconfig string Path to kubeconfig file (optional)
--newer-than string The maximum age of the resources to be considered unused. This flag cannot be used together with older-than flag. Example: --newer-than=1h2m
--no-interactive Do not prompt for confirmation when deleting resources. Be careful using this flag!
--older-than string The minimum age of the resources to be considered unused. This flag cannot be used together with newer-than flag. Example: --older-than=1h2m
--output string Output format (table, json or yaml) (default "table")
--slack-auth-token string Slack auth token to send notifications to. --slack-auth-token requires --slack-channel to be set.
--slack-channel string Slack channel to send notifications to. --slack-channel requires --slack-auth-token to be set.
--slack-webhook-url string Slack webhook URL to send notifications to
```

To use a specific subcommand, run `kor [subcommand] [flags]`.
Expand Down Expand Up @@ -129,6 +132,21 @@ kor [subcommand] --help
| Pdbs | PDBs not used in Deployments<br/> PDBs not used in StatefulSets | |


## Deleting Unused resources
If you want to delete resources in an interactive way using Kor you can run:
```sh
kor configmap --namespace my-namespace --delete
```
You will be prompted with:
```sh
Do you want to delete ConfigMap test-configmap in namespace my-namespace? (Y/N):
```

To delete with no prompt ( ⚠️ use with caution):
```sh
kor configmap --namespace my-namespace --delete --no-interactive
```

## Ignore Resources
The resources labeled with:
```sh
Expand Down
2 changes: 1 addition & 1 deletion charts/kor/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 0.1.2
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.5"
appVersion: "0.2.7"
2 changes: 1 addition & 1 deletion charts/kor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kor

![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.5](https://img.shields.io/badge/AppVersion-0.2.5-informational?style=flat-square)
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.7](https://img.shields.io/badge/AppVersion-0.2.7-informational?style=flat-square)

A Helm chart for Kubernetes

Expand Down

0 comments on commit e74ae57

Please sign in to comment.