-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: microk8s.kubectl completion #242
Comments
You have two options:
|
Thanks for your response! Your second suggestion worked like a charm for bash as well as for zsh.
|
Quick tip for folks stumbling across this like I did - if you don't want to alias kubectl (if you want to run kubectl and microk8s.kubectl side-by-side, for instance), you're going to have a bad time with that sed command. Here's my approach:
|
My working approach for Ubuntu with Snap and ZSH:
|
For me to get kubectl (with a production cluster) and microk8s to work at the same time. I had to do
|
Adding the alias and sed works for me in bash but not in zsh. What am I doing wrong? Thanks! Update: using a snap alias like @drstoehr suggested does work. |
For me on MacOS (11.6.2) with zsh 5.8 I configured the following in .zshrc. The shell function was necessary to make a single command
|
I used https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/microk8s/microk8s.plugin.zsh, along with @rba last 2 line:
|
Is the
|
For me this workes in zsh shell without using snap alias: # some alias for microk8s kubectl + autocompletion
alias kubectl="microk8s.kubectl"
alias k="kubectl"
source <(kubectl completion zsh | sed "s/kubectl/microk8s.kubectl/g")
source <(k completion zsh | sed "s/k/microk8s.kubectl/g")
# some alias for microk8s helm3 + autocompletion
alias helm="microk8s.helm3"
source <(helm completion zsh | sed "s/helm/microk8s.helm3/g")
# set KUBECONFIG environment variable for k9s + helm
export KUBECONFIG=/var/snap/microk8s/current/credentials/client.config |
I was curious if it was already somehow possible to use kubectl's completion feature in microk8s. I really like the idea of testing my services locally on a single node cluster but working with kubectl without its completion feature is quite tedious.
I tried sourcing microk8s.kubectl completion zsh/bash but the scripts appear to be the original ones of kubectl.
Any idea how the completion feature can be achieved easily or any plans to make it possible in the future?
inspection-report-20181213_113531.tar.gz
The text was updated successfully, but these errors were encountered: