"오류: 'kubectl'에 대한 알 수 없는 명령 'join'" 수정 방법

"오류: 'kubectl'에 대한 알 수 없는 명령 'join'" 수정 방법

kubectl Join 명령을 사용하여 작업자 노드를 Kubernetes 클러스터에 가입하려고 했습니다. 다음 명령을 실행하여 문제를 해결해 보세요.

이 문제를 해결하려면 Kubernetes 클러스터 버전과 일치하도록 kubectl 명령줄 도구를 업데이트해야 합니다.

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"

최신 버전의 kubectl을 다운로드한 후 이를 실행 가능하게 만들고 PATH의 위치로 이동해야 합니다.

chmod +x kubectl
sudo mv kubectl /usr/local/bin/kubectl

명령 아래에 제안된 새로운 방법도 작동하지 않습니다.

sudo snap install kubectl --classic

시스템에 설치된 현재 Kubernetes 버전을 보려면 kubectl version 명령을 사용할 수 있습니다.

ubuntu@master:~$ sudo kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.4+k3s1", GitCommit:"8d0255af07e95b841952563253d27b0d10bd72f0", GitTreeState:"clean", BuildDate:"2023-04-20T00:33:38Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"linux/arm"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.4+k3s1", GitCommit:"8d0255af07e95b841952563253d27b0d10bd72f0", GitTreeState:"clean", BuildDate:"2023-04-20T00:33:38Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"linux/arm"}

*To view the current version of kubectl, you can use the kubectl version command.*

ubuntu@master:~$ **sudo kubectl version --client**
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.4+k3s1", GitCommit:"8d0255af07e95b841952563253d27b0d10bd72f0", GitTreeState:"clean", BuildDate:"2023-04-20T00:33:38Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"linux/arm"}
Kustomize Version: v4.5.7

ubuntu@worker:~$ **kubectl version --client**
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.1", GitCommit:"4c9411232e10168d7b050c49a1b59f6df9d7ea4b", GitTreeState:"clean", BuildDate:"2023-04-14T13:21:19Z", GoVersion:"go1.20.3", Compiler:"gc", Platform:"linux/arm"}
Kustomize Version: v5.0.1

# Linux master 6.2.0-1004-raspi #5-Ubuntu SMP PREEMPT Mon Apr  3 10:50:45 UTC 2023 armv7l armv7l armv7l GNU/Linux
# Linux worker 6.2.0-1004-raspi #5-Ubuntu SMP PREEMPT Mon Apr  3 11:15:14 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

답변1

사용해야 하는 클러스터에 노드를 연결하기 위해 잘못된 명령을 실행했습니다.kubeadm join. 아니, 참고하세요.kubeadmkubectl

관련 정보