Skip to content

Kubernetes

Kubectl

kubectl is the tool that is used to communicate with a Kubernetes cluster. Installation instructions can be found in the Kubernetes documentation

Helm

Helm helps you manage Kubernetes applications. It is not required to use Kubernetes, but it may be required in some projects. Installation instructions can be found in the Helm documentation.

Connecting to a Google Cloud Cluster

Instructions below are based on the Google Cloud Kubernetes quickstart

First, follow instructions on gcloud.

If you haven’t done so, log in to the Google Cloud SDK.

Terminal window
gcloud auth login

Set the correct configurations for the Google Cloud Cluster.

Terminal window
gcloud config set project <project-id>
gcloud config set compute/zone <zone>

The Kubernetes clusters that match the project can be listed using:

Terminal window
gcloud container clusters list

To log in kubectl to the cluster, run:

Terminal window
gcloud container clusters get-credentials <cluster-name>

Connecting to a Digital Ocean Cluster

doctl can be used to help connecting to a Kubernetes cluster running on Digital Ocean. Digital Ocean will reset the Kubernetes certificates every week. doctl allows one to fetch these certificates automatically when using kubectl.

The instructions below are based on this guide.

Install doctl following instructions from the README.

Follow instruction from for creating a personal access token.

Terminal window
doctl auth init

List clusters using:

Terminal window
doctl kubernetes cluster list

Connect using:

Terminal window
doctl kubernetes cluster kubeconfig save <my-cluster-name>

Linking DNS

To link a domain name, the VPS needs an IP address. The IP address to link can be found using the following command.

Terminal window
kubectl get service --all-namespaces | grep LoadBalancer