“认证为:您所在的匿名组"检查kubectl版本时出错

编程入门 行业动态 更新时间:2024-10-25 02:28:00
本文介绍了“认证为:您所在的匿名组"检查kubectl版本时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图在我的机器上设置kubectl工具来远程管理Kubernetes集群并使用Helm.我正在Ubuntu 16.04机器上尝试.

I am trying to setup the kubectl tool in my machine to remotely manage Kubernetes cluster and also to use Helm. I am trying in Ubuntu 16.04 machine.

我正在通过以下链接关注Kubernetes的官方文档,

I am following the official Kubernetes documentation from the following link,

kubernetes.io/docs/tasks/tools/install- kubectl/

我运行了以下命令,

sudo apt-get update && sudo apt-get install -y apt-transport-https curl -s packages.cloud.google/apt/doc/apt-key.gpg | sudo apt-key add - echo "deb apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubectl

然后,当我运行" kubectl版本"命令来验证安装之后,我得到了以下内容,

And after when I am running the 'kubectl version' command to verify the installation , I am getting the following ,

Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"} Error from server (Forbidden): <html><head><meta http-equiv='refresh' content='1;url=/login?from=%2Fversion%3Ftimeout%3D32s'/> <script>window.location.replace('/login?from=%2Fversion%3Ftimeout%3D32s'); </script></head><body style='background-color:white; color:white;'> Authentication required <!-- You are authenticated as: anonymous Groups that you are in: Permission you need to have (but didn't): hudson.model.Hudson.Read ... which is implied by: hudson.security.Permission.GenericRead ... which is implied by: hudson.model.Hudson.Administer -->

也没有在计算机中找到〜/.kube/config"文件.

And also not finding the '~/.kube/config' file in machine.

为什么检查kubectl版本时会出现此身份验证错误?

Why do I get this authentication error when checking the kubectl version?

推荐答案

您必须手动将群集节点中的 .kube/目录复制到本地〜/.kube

You have to manually copy .kube/ directory from you cluster node into your local ~/.kube

如果主节点上没有 .kube/,请从/etc/kubernetes/kube.conf

If you don't have .kube/ on the master node, copy it from /etc/kubernetes/kube.conf

mkdir $HOME/.kube scp root@<master-public-ip>:/etc/kubernetes/kubelet.conf $HOME/.kube/config

您还可以通过传入--kubeconfig参数(即

You can also define the filepath of kubeconfig by passing in --kubeconfig parameter, i.e.

kubectl version --kubeconfig ~/.kube/config

更多推荐

“认证为:您所在的匿名组"检查kubectl版本时出错

本文发布于:2023-11-12 12:45:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581529.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:您所在   版本   quot   kubectl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!