Report this

What is the reason for this report?

how to change the token in the yaml file for my Kubernetes

Posted on November 20, 2021

Error: Unable to use supplied token to access API: GET https://api.digitalocean.com/v2/account: 401 (request “8f4eab16-45bb-49f5-8519-6b20870ca913”) Unable to authenticate you Admins-MBP-2:~ admin$ doctl auth

I know is because i regenerate my personal api token. Is there a way to update it in the config file which i know i can downlaod



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!

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.

Hello,

With doctl you could do the following:

  • Initialize doctl to use the new token:
doctl auth init
  • List available authentication contexts:
doctl auth list
  • Remove authentication context that you do not need:
doctl auth remove	
  • Switches to the new authentication context:
doctl auth switch	

Then finally you can use the following command to get the new Kubernetes config yaml:

doctl kubernetes cluster kubeconfig save

Hope that this helps. Best, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.