Tootfinder

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

@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 03:16:15

Does there exist some zsh kubectl plugin/feature which provides tab-completion of (nouns from a cache of) *remote resource names*? I want this to work like local paths do for file arguments.
kubectl -n ku<TAB> get svc tr<TAB> -o yaml
#kubernetes #zsh #shell

@dwf@social.linux.pizza
2025-10-21 13:56:20

I should really set up #zsh on my desktop at work. Find myself really missing a lot of the quality of life stuff I have set up at home.

@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

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

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