GmanG77
GmanG77

Reputation: 101

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

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

Upvotes: 0

Views: 2104

Answers (1)

GmanG77
GmanG77

Reputation: 101

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

Upvotes: 4

Related Questions