3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Kubernetesのkubectl自動補完エラー: -bash: _get_comp_words_by_ref: command not found

Posted at

作業内容

https://kubernetes.io/docs/tasks/tools/install-kubectl/#enable-kubectl-autocompletion
K8S公式サイト通りに、設定してみたが、エラーです。

echo 'source <(kubectl completion bash)' >>~/.bashrc

問題事象

[centos@zzeng-hdp-1 ~]$ kubectl  gen-bash: _get_comp_words_by_ref: command not found
-bash: _get_comp_words_by_ref: command not found

対策

Bashの自動補完パッケージが足りない
https://www.tecmint.com/install-and-enable-bash-auto-completion-in-centos-rhel/

sudo yum install bash-completion bash-completion-extras

結果

[centos@zzeng-hdp-1 ~]$ kubectl de
delete    describe
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?