Tootfinder

Opt-in global Mastodon full text search. Join the index!

@x_cli@infosec.exchange
2026-01-21 17:46:46

How do you manage your #Kubernetes resource lifecycle?
Let's say you installed a new product, with all the bells and whistles (deployments, service accounts, gateway, network policies, roles and bindings. But you don't need those anymore. How do you dispose of them?
Do you install stuff with a kubectl apply and do you dispose of them by manually calling kubectl delete?

@ellie@ellieayla.net
2025-12-19 03:28:56

Yes, the script emitted by "kubectl completion zsh" supports resource names!
#kubernetes #zsh #shell

@ellie@ellieayla.net
2025-12-19 04:04:47

Relevant code in kubectl doing the completions: #kubernetes #zsh #shell #completion

@ellie@ellieayla.net
2025-12-19 03:57:26

Internally the registered completion function runs kubectl __complete with the same terms, like: `kubectl __complete get ns ku`, which emits a list of terms back to the completion function.
kubectl can be run with higher verbosity (eg -v6) to see the underlying requests being made to the remote server, but they're the normal ones to retrieve a list of resources (eg GET https://10.11.12.13:6443/api/v1/namespaces?limit=500).
#kubernetes #zsh #shell #completion