KubeTidy is a PowerShell tool designed to clean up your Kubernetes configuration file by removing unreachable clusters, along with associated users and contexts. It simplifies the management of your kubeconfig
by ensuring that only reachable and valid clusters remain, making it easier to work with multiple Kubernetes environments. KubeTidy also supports merging multiple kubeconfig
files into one.
For complete installation, usage, and advanced configuration instructions, please visit the KubeTidy Documentation Site.
kubeconfig
before cleanup.-Force
parameter to force cleanup even if all clusters are unreachable.kubeconfig
files into one.To install KubeTidy via PowerShell Gallery:
Install-Module -Name KubeTidy -Repository PSGallery -Scope CurrentUser
To install KubeTidy as a kubectl plugin using Krew:
# Fetch the latest release tag using GitHub's API
LATEST_VERSION=$(curl -s https://api.github.com/repos/KubeDeckio/KubeTidy/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
# Download the KubeTidy.yaml file from the latest release
curl -L -H "Cache-Control: no-cache" -O https://github.com/KubeDeckio/KubeTidy/releases/download/$LATEST_VERSION/KubeTidy.yaml
# Install the plugin using the downloaded KubeTidy.yaml file
kubectl krew install --manifest="./KubeTidy.yaml"
Please note that KubeTidy installed via Krew is supported only on Linux and macOS. It does not support Windows at this time.
For additional instructions, refer to the KubeTidy Documentation Site.
All notable changes to this project are documented in the CHANGELOG.
This project is licensed under the MIT License. See the LICENSE file for more details.