Kubectl-neat je must have nástroj, který vám z existujících manifestů odebere balast, který tam buď nemá co dělat, anebo způsobuje, že ho kvůli tomu znovu nejste schopni nasadit, ačkoliv by tomu nemělo nic bránit.
Máte např. ubuntu nebo debian linux (kde jsem to testoval) a vložil do neat.sh
#!/bin/bash
wget „https://github.com/itaysk/kubectl-neat/releases/download/v2.0.4/kubectl-neat_linux_amd64.tar.gz“
tar -xvzf kubectl-neat_linux_amd64.tar.gz
sudo mv kubectl-neat /usr/local/bin/kubectl-neat # Přesune binárku do adresáře v PATH
sudo chmod +x /usr/local/bin/kubectl-neat # Nastaví spustitelná práva
Nápověda
kubectl-neat
# kubectl-neat --help
Usage:
kubectl-neat [flags]
kubectl-neat [command]
Examples:
kubectl get pod mypod -o yaml | kubectl neat
kubectl get pod mypod -oyaml | kubectl neat -o json
kubectl neat -f - <./my-pod.json
kubectl neat -f ./my-pod.json
kubectl neat -f ./my-pod.json --output yaml
Available Commands:
completion Generate the autocompletion script for the specified shell
get
help Help about any command
version Print kubectl-neat version
Flags:
-f, --file string file path to neat, or - to read from stdin (default "-")
-h, --help help for kubectl-neat
-o, --output string output format: yaml or json (default "yaml")
Use "kubectl-neat [command] --help" for more information about a command.
Jak bude vypadat výstup:
./neat.sh
–2025-06-21 13:01:35– https://github.com/itaysk/kubectl-neat/releases/download/v2.0.4/kubectl-neat_linux_amd64.tar.gz
Resolving github.com (github.com)… 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/198226595/6da26b83-7da2-4c31-a4ab-b926de905096?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250621%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250621T110042Z&X-Amz-Expires=1800&X-Amz-Signature=dd103cf1b159d0b8edc6e8260ebfa02cea742858201d39011d1697f5955a463a&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dkubectl-neat_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream [following]
–2025-06-21 13:01:36– https://objects.githubusercontent.com/github-production-release-asset-2e65be/198226595/6da26b83-7da2-4c31-a4ab-b926de905096?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250621%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250621T110042Z&X-Amz-Expires=1800&X-Amz-Signature=dd103cf1b159d0b8edc6e8260ebfa02cea742858201d39011d1697f5955a463a&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dkubectl-neat_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)… 185.199.110.133, 185.199.109.133, 185.199.108.133, …
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 9344311 (8,9M) [application/octet-stream]
Saving to: ‘kubectl-neat_linux_amd64.tar.gz.1’
kubectl-neat_linux_amd64.tar.gz.1 100%[================================================================================================>] 8,91M 35,9MB/s in 0,2s
2025-06-21 13:01:36 (35,9 MB/s) – ‘kubectl-neat_linux_amd64.tar.gz.1’ saved [9344311/9344311]
Zdravím autora aplikace a děkuji za tuhle užitečnou utilitu.