I have setup a DO server and a Kubernetes.I have kubectl and doctl downloaded and the config file in in place. However, when I try: kubectl cluster-info I always get an error stating that connection to localhost:8080 was refused. Can anybody sort me out?
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!
Accepted Answer
Hi there @RSrsRsrS,
Yes, this is doable, I have the same setup at my end as well.
You could either use the doctl command to save your Kubernetes configuration file:
- doctl kubernetes cluster kubeconfig save use_your_cluster_name
This downloads the kubeconfig for the cluster, merge it with any existing configuration from ~/.kube/config, and automatically handles the authentication token or certificate.
Another option would be to manually download the config file via your DigitalOcean control panel and upload it to your Droplet. Then you could use the following command to interact with the Kubernetes API:
- kubectl --kubeconfig="use_your_kubeconfig.yaml" get nodes
For more information I would recommend taking a look at the official documentation here:
https://www.digitalocean.com/docs/kubernetes/how-to/connect-to-cluster/
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.