diff --git a/README.md b/README.md index e056a120..c3a9f2d6 100644 --- a/README.md +++ b/README.md @@ -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]`. @@ -129,6 +132,21 @@ kor [subcommand] --help | Pdbs | PDBs not used in Deployments
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 diff --git a/charts/kor/Chart.yaml b/charts/kor/Chart.yaml index 635bb8ca..43a75a1b 100644 --- a/charts/kor/Chart.yaml +++ b/charts/kor/Chart.yaml @@ -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" diff --git a/charts/kor/README.md b/charts/kor/README.md index a3c93836..01f55012 100644 --- a/charts/kor/README.md +++ b/charts/kor/README.md @@ -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