"エラー: '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

おすすめ記事