gpt4 book ai didi

azure - 错误: no context exists with the name: "Aks_cluster_name" when tried from WSL

转载 作者:行者123 更新时间:2023-12-03 00:38:08 24 4
gpt4 key购买 nike

我正在尝试从适用于 Linux 的 Windows 子系统部署 kubernetes 管道。

我能够运行这些命令

az login
az account set --subscription Azure.NPE.Riviera
az aks get-credentials --resource-group RivieraRG --name RivieraAksCls0

当我运行以下命令时

kubectl config use-context RivieraAksCls0

它给了我

error: no context exists with the name: "RivieraAksCls0"

如何解决这个问题?

(注意:我拥有所有权限并且能够从 Powershell 运行上述命令)

最佳答案

我已经在我的环境中进行了测试。错误的原因是 .kube/config 文件是在 windows 中创建的,而不是在 wsl 中创建的。 .kube/config 文件需要复制到 wsl。

请使用以下命令将配置文件从 Windows 计算机复制到 ubuntu。

cp /mnt/c/Users/[USERNAME]/.kube/config ~/.kube/config

请引用下面的屏幕截图:

enter image description here

关于azure - 错误: no context exists with the name: "Aks_cluster_name" when tried from WSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68960589/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com