この記事では、Azure Local で AKS クラスターを作成してデプロイしようとしたときに発生する K8sVersionValidation エラー コードを特定して解決する方法について説明します。
現象
AKS Arc クラスターを作成しようとすると、次のいずれかのエラー メッセージが表示されます。
Kubernetes version 1.27.7 is not ready for use on Linux. Please go to https://aka.ms/aksarccheckk8sversions for details of how to check the readiness of Kubernetes versionsKubernetes version 1.26.12 is not supported. Please go to https://aka.ms/aksarcsupportedversions for details about the supported Kubernetes version on this platform.Admission webhook \'vhybridakscluster.kb.io\' denied the request: Kubernetes version 1.26.12 is not available
エラー メッセージ
このセクションでは、K8sVersionValidation エラー コードが発生したときに表示される可能性があるエラー メッセージについて説明します。
Kubernetes バージョン 1.27.7 が Linux で使用できる状態ではありません
このエラー メッセージは、不完全な Linux VHD のダウンロードが原因で発生します。
Azure Local をインストールすると、サイズが約 4 から 5 GB の Linux VHD をダウンロードします。 この Linux VHD は、AKS Arc クラスター内の Kubernetes ノードの基になる VM を作成するために使用されます。 このエラー メッセージは、Linux VHD のダウンロードが完了しなかった場合に発生する可能性があります。 この問題を解決するには、インターネット接続が Linux VHD イメージのダウンロードを完了するまで待つ必要があります。
イメージのダウンロードが進行中または完了しているかどうかを確認するには、次のコマンドを実行します。
$cl_id = "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.ExtendedLocation/customLocations/<custom_location_name>"
# Get the kubernetes version using CLI (it automatically creates the **kubernetesVersions/default** Azure resource).
az aksarc get-versions --custom-location $cl_id
このコマンドで K8s のバージョンの準備ができたと表示され、Azure Local release 2411 以降を実行している場合 、 サポート リクエストを送信。
Azure Local リリース 2408 以前を実行している場合は、次のセクションに進みます。 最新のバグ修正とセキュリティ更新プログラムを取得するには、Azure ローカル デプロイを最新バージョンにアップグレードすることを強くお勧めします。
kubernetesVersions/default を再作成する
同じ名前とパラメーターを使用して Azure Local を再デプロイする場合は、 kubernetesVersions/defaultを再作成する必要があります。 これを行うには、次の コマンドを実行します。
$subscription = <subscription_id>
$cl_id = <custom_location_id>
az login --use-device-code
az account set -s $subscription
$token = $(az account get-access-token --query accessToken)
$url = "https://management.azure.com${cl_id}/providers/Microsoft.HybridContainerService/kubernetesVersions/default?api-version=2024-01-01"
# Get the Kubernetes version Azure resource
az rest --headers "Authorization=Bearer $token" "Content-Type=application/json;charset=utf-8" --uri $url --method GET
# Delete the Kubernetes version Azure resource
az rest --headers "Authorization=Bearer $token" "Content-Type=application/json;charset=utf-8" --uri $url --method DELETE
# Get the Kubernetes version using CLI (it automatically creates the Kubernetes version Azure resource)
az aksarc get-versions --custom-location $cl_id
Azure portal で Kubernetes のバージョンまたは VM サイズのオプションが表示されない
このシナリオは、Kubernetes バージョン (または VM サイズ) の既定のリソースが Azure ローカル デプロイの一部として作成されなかった場合に、Azure Local リリース 2408 以前で発生する可能性があります。
この問題を解決するには、次のコマンドを実行します。
$cl_id = "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.ExtendedLocation/customLocations/<custom_location_name>"
# Get the kubernetes version using CLI (it automatically creates the **kubernetesVersions/default** Azure resource).
az aksarc get-versions --custom-location $cl_id
Kubernetes バージョン 1.26.12 はサポートされていません
Azure Local では、各リリースで特定の Kubernetes バージョンがサポートされています。 エラー メッセージに記載されているように、デプロイされた Azure ローカル リリースに基づいて、サポートされている Kubernetes バージョンの一覧については、 https://aka.ms/aksarcsupportedversions に移動してください。