Mic*_*u93 8 azure azure-powershell kubernetes kubectl
我从in byconfig为 Kubernetes 创建了新文件。收到消息说。我将此文件复制到默认位置,现在当我尝试运行任何命令时,例如我收到:AzurePowershellaz aks get-credentials --resource-group <RGName> --name <ClusterName>Merged "cluster_name" as current context in C:\michu\.kube\config.kube\configkubectl get pods
Unable to connect to the server: getting credentials: exec: executable kubelogin not found
It looks like you are trying to use a client-go credential plugin that is not installed.
To learn more about this feature, consult the documentation available at:
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins
Run Code Online (Sandbox Code Playgroud)
这里有什么问题吗?
我刚刚意识到,当我输入kubectl config get-contexts时,我可以看到我的cluster_name,我什至可以切换到这个,并且kubectl config use-context cluster_name消息是正确的:Switched to context cluster_name但所有其他命令仍然以Unable to connect to the server: getting credentilas: exec: executable kubelogin not found
小智 8
该错误意味着kubelogin无法找到可执行文件。您需要kubelogin使用 azure cli
安装az aks install-cli,然后它就会按预期工作。
安装过程参考github 。
我在我的环境中尝试了相同的要求,它对我有用,如下所示。
az aks get-credentials --resource-group caroline --name sampleaks1
kubectl get pods
Run Code Online (Sandbox Code Playgroud)
输出:

获得aks凭据后,运行时kubectl get pods将提示您输入Azure kubernetes service authentication with AAD,如图所示。

只需 kubectl 输入bash 即可验证是否安装成功。

如果问题仍然存在,
--admin删除 ~/.kube/ 中的所有缓存或任何未使用的文件夹,并通过在末尾添加标志来运行 akscredentials 命令
。
请参阅@Geert Baeke 的这篇文档以获取更多相关信息。
检查 kube 配置版本并根据需要进行升级。
| 归档时间: |
|
| 查看次数: |
36118 次 |
| 最近记录: |