在VSTS中创建Kubernetes端点会产生错误 [英] Creating Kubernetes Endpoint in VSTS generates error

查看:129
本文介绍了在VSTS中创建Kubernetes端点会产生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置一个新的Kubernetes端点并单击验证连接"错误消息: "Kubconfig不包含用户字段.请检查kubeconfig."-始终显示.

What setting up a new Kubernetes endpoint and clicking "Verify Connection" the error message: "The Kubconfig does not contain user field. Please check the kubeconfig. " - is always displayed.

尝试了多种输出配置文件的方法,但无济于事.我还从网络上复制并粘贴了许多示例配置文件,但最终都遇到了同样的问题.有人成功创建了新端​​点吗?

Have tried multiple ways of outputting the config file to no avail. I've also copy and pasted many sample config files from the web and all end up with the same issue. Anyone been successful in creating a new endpoint?

推荐答案

其后是 TsuyoshiUshio /KubernetesTask问题35

我尝试复制,但是我做不到.
但是,我不确定,我猜可能与您通过下载task/kubeconfig下载的集群/kubectl版本不匹配.
解决方法可能是这样的:

I try to reproduce, however, I can't do it.
I'm not sure, however, I can guess it might the mismatch of the version of the cluster/kubectl which you download by the download task/kubeconfig.
Workaround might be like this:

    您的本地计算机上的
  • kubectl版本,并检查当前的服务器/客户端版本
  • 在下载任务上指定与服务器相同的版本. (默认为1.5.2)
  • 查看发布管道失败的日志,您可以查看已执行了哪个kubectl命令,并在本地计算机上执行适合本地PC环境的相同操作.
  • kubectl version in your local machine and check the current server/client version
  • specify the same version as the server on the download task. (by default it is 1.5.2)
  • See the log of your release pipeline which is fail, you can see which kubectl command has been executed, do the same thing on your local machine with fitting your local pc's environment.

重点是,在转到VSTS之前,请先下载kubectl .
然后,将kubeconfg放在默认文件夹中,例如~/.kube/config或将环境变量KUBECONFIG设置为二进制文件.
然后执行kubectl get节点并确定它是否有效.

The point is, before go to the VSTS, download the kubectl by yourself.
Then, put the kubeconfg on the default folder like ~/.kube/config or set environment variables KUBECONFIG to the binary.
Then execute kubectl get nodes and make sure if it works.

我的kubeconfig与您使用的格式不同.如果使用AKS,请使用az aks install-cli命令和az aks get-credentials命令.
请参考 https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough .

My kubeconfig is different format with yours. If you use AKS, az aks install-cli command and az aks get-credentials command.
Please refer https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough .

如果它在本地工作,则配置文件必须在VSTS任务环境上工作. (或者此任务或VSTS有错误)

If it works locally, the config file must work on the VSTS task environment. (or this task or VSTS has a bug)

这篇关于在VSTS中创建Kubernetes端点会产生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆