kube-shell icon indicating copy to clipboard operation
kube-shell copied to clipboard

Pod name autocompletion does not work for the kubectl logs command

Open mbangert-smarsh opened this issue 7 years ago • 4 comments

Issue: When attempting to use the kubectl logs command, the available pods are not displayed.

Steps to reproduce: With the kube-shell open, type kubectl logs and hit the tab key

Expected Results: The available pods are displayed in the shell

Observed Results: Nothing is displayed

mbangert-smarsh avatar Jul 05 '17 21:07 mbangert-smarsh

@mbangert-smarsh thanks for opening issue. We will work on it.

In general, there are scenarios like 'kubectl logs' which need to be handled case by case (unlike kubeclt get kubectl-resource-name for e.g). I am collecting such scenarios, and make kube-shell at the least compatible with kubectl auto completion. We will fix it next release.

murali-reddy avatar Jul 06 '17 09:07 murali-reddy

I am having the same issue.. for few people its working on mac. I am using centos and trying on the master node and it's not working for me

harshakondreddy avatar Dec 04 '20 20:12 harshakondreddy

I am using a centos machine to run kubectl and executing the below instruction worked for me

yum install bash-completion 
 
echo 'source <(kubectl completion bash)' >>~/.bashrc 
kubectl completion bash >/etc/bash_completion.d/kubectl 
echo "alias k=\'kubectl\'" >> ~/.bashrc 
echo 'complete -F __start_kubectl k' >>~/.bashrc 
source ~/.bashrc 

once it's completed, it should be able to get the response with TAB TAB

harshakondreddy avatar Dec 04 '20 21:12 harshakondreddy

got the problem too running

  • inside bash
  • on WSL2/Ubuntu 20.04.2 LTS
  • in connection with AWS EKS and IAM auth which needs the aws-iam-authenticator

i noticed that

  • every once in a great while it works
  • always? when i just do kubectl logs TAB TAB then i get listed the files in the current dir

elonderin avatar Jul 07 '21 13:07 elonderin