Can I configure DO kubernetes on my DO server?

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?


Submit an 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.

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:

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

  1. kubectl --kubeconfig="use_your_kubeconfig.yaml" get nodes

For more information I would recommend taking a look at the official documentation here:

Hope that this helps! Regards, Bobby