다운 로드 curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" 3 실행 가능하도록 실행 권한 주기 sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl 4 vi kubeconfig-1.yaml 5 kubectl --kubeconfig="kubeconfig-1.yaml" get nodes [root@pub1 ~]# kubectl --kubeconfig="kubeconfig-1.yaml" get nodes NAME STATUS ROLES AGE VERSION nks-k8s-node-w-xed Ready 2d22h v1.20.13 nks-k8s-node-w-xee Ready 2d22h v1.20.13 bash 프로파일에 alias 주자 kubectl 로 사용하도록 ^^ vi ~/.bash_profile [root@command-server1 ~]# vi ~/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH alias kubectl='kubectl --kubeconfig="/root/kubeconfig-1.yaml"' 15 source ~/.bash_profile 16 kubectl get nodes [root@pub1 ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION nks-k8s-node-w-xed Ready 2d22h v1.20.13 nks-k8s-node-w-xee Ready 2d22h v1.20.13