Both bash and zsh support scripts that complete the print command when you press <TAB> . This function is called Programmable copmletion, and you can find more information about it here: zsh completion .
Fortunately, you do not need to write your own script - kubectl provides it for zsh> 5.2. Try running this command: source <(kubectl completion zsh) .
Another option is to use this tool: https://github.com/mkokho/kubemrr (discalimer: I'm the author). The reason it exists is because the standard completion of the script is too slow - it may take a few seconds before the responses of the tunnels will answer all the names of the subframes. But kubemrr stores the names locally, so the answer is returned almost immediately.
source share