kubernetes 에서 명령어 및 옵션등이 많은데 이것을 다 외울수 없기 때문에 자동완성 기능을 사용해보자
o/s : centos 7.x
1. bash-completion 설치
1 |
[root@k8sworker1 ~]# yum -y install bash-completion |
2. kubectl completion bash 파일 추가
1 |
[root@k8sworker1 ~]# kubectl completion bash >/etc/bash_completion.d/kubectl |
3. .bashrc에 적용
1 |
[root@k8sworker1 ~]# source /root/.bashrc |
4. kubectl 명령어 입력후 tap버튼을 누르면 추가 메뉴들이 나온다
1 2 3 4 5 6 7 8 9 10 11 |
[root@k8sworker1 ~]# kubectl annotate (자원에 대한 주석을 업데이트합니다) api-resources (Print the supported API resources on the server) api-versions (Print the supported API versions on the server, in the form of "group/version") apply (Apply a configuration to a resource by file name or stdin) attach (Attach to a running container) auth (Inspect authorization) autoscale (Auto-scale a deployment, replica set, stateful set, or replication controller) certificate (Modify certificate resources) cluster-info (Display cluster information) completion (Output shell completion code for the specified shell (bash, zsh, fis |
출저 : https://kubernetes.io/ko/docs/tasks/tools/included/optional-kubectl-configs-bash-linux/