kubectl asking for username and password

I have just set up a Kubernetes cluster on DigitalOcean. I have followed the suggested tutorial but when I try and run the commands I keep getting prompted for a username and password which I have not been provided with.

I have seen a few posts where people say it will be emailed to me but it’s been well over an hour since the set-up completed and I have still not been emailed with anything (yes, I checked the usual places)

Commands I ran: $> doctl kubernetes cluster kubeconfig save MY-CLUSTER Notice: adding cluster credentials to kubeconfig file found in “/Users/anthonybudd/.kube/config” Notice: setting current-context to do-sfo2-ideea-prod $> kubctl get nodes Please enter Username:


Any help or insights would be appreciated.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

After pulling my hair out for a few hours and seriously questioning why I moved to DO, I’ve got to the bottom of the issue…

Manually downloading the config file and using doctl will retrieve different files. The manually downloaded config file has the auth details and the doctl one doesn’t.

Don’t use. doctl kubernetes cluster kubeconfig save ideea-prod

It’s a bug on your side 👍

This does not happen on my local Mac workstation, but it does seem to happen when I try to do it from a Linux container. The solution was

doctl auth init -t {digital ocean api token}
doctl k8s cluster config show b68876cd-8a1d-4073etc. > /root/.kube/myconf
kubectl --kubeconfig=/root/.kube/myconf get pods

It’s Nov 8, 2020 and just came across this problem. Question here is when this is going to be fixed? The docs still refers to doctl as recommended option (Generate Using doctl (Recommended))… […]

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel