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

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

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

问题

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

  1. kubectl apply -f deployment.yml

我收到如下错误消息:

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

感谢任何帮助。"

英文:

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

  1. kubectl apply -f deployment.yml

I get -

  1. "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

  1. kubectl config current-context

and then changed it back to the correct one by

  1. kubectl config use-context docker-desktop
  2. ```"
  3. <details>
  4. <summary>英文:</summary>
  5. In my case the problem was that somehow context was changed.
  6. Checked it by

kubectl config current-context

  1. and then changed it back to the correct one by

kubectl config use-context docker-desktop

  1. </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:

确定