Getting "You must be logged in to the server (Unauthorized)" when trying to use Kubernetes on Docker desktop

huangapple go评论57阅读模式
英文:

Getting "You must be logged in to the server (Unauthorized)" when trying to use Kubernetes on Docker desktop

问题

"我已在Mac上的Docker桌面上启用了Kubernetes,并在运行以下命令时出现了错误:

kubectl apply -f deployment.yml  

我收到如下错误消息:

"error: You must be logged in to the server (Unauthorized)"

感谢任何帮助。"

英文:

I've enabled Kubernetes on Docker Desktop (on a Mac) - and when I run

kubectl apply -f deployment.yml  

I get -

"error: You must be logged in to the server (Unauthorized)"

Any help appreciated

答案1

得分: 3

以下是要翻译的内容:

"In my case the problem was that somehow context was changed.
Checked it by

kubectl config current-context

and then changed it back to the correct one by

kubectl config use-context docker-desktop
```"

<details>
<summary>英文:</summary>

In my case the problem was that somehow context was changed. 
Checked it by

kubectl config current-context

and then changed it back to the correct one by

kubectl config use-context docker-desktop


</details>



huangapple
  • 本文由 发表于 2023年2月9日 01:38:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75389701.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定