Report this

What is the reason for this report?

Setting up Kubernetes | How do I connect to Kubectl and DigitalOcean command line tool?

Posted on February 26, 2020

Hey together, i am a beginner and already have some experience with cloud servers and wordpress. Now I would like to install Wordpress on a DigitalOcean Kubernetes cluster.

Unfortunately I don’t know how to install Kubectl and I don’t know how to use the DigitalOcean command line tool.

I have a MacBook and currently no Kubernetes cluster. Do I need to install Kubectl locally on my MacBook? How do I connect to the Kubernetes cluster from DigitalOcean?

Many thanks to all help!

best Jonas



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.

Hi there @jonashartmann,

Yes you will need kubectl installed locally on your Mac. Here is a link to the official documentation on how you can do that for Mac:

https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-macos

After that you can download your Kubernetes Cluster config from your DigitalOcean Control Panel directly rather than using the doctl command-line tool. You can see the exact steps as described here in the official DigitalOcean documentation:

https://www.digitalocean.com/docs/kubernetes/how-to/connect-to-cluster/#download

Once you have the config file downloaded, you can run the following command to interact with the Kubernetes Cluster:

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

Hope that this helps! Let me know if you have any questions. Regards, 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.