DEV Community

Cover image for Let's Embark! Setting up Kubernetes (Part 1)
Adam Hammond
Adam Hammond

Posted on • Originally published at engi.fyi

Let's Embark! Setting up Kubernetes (Part 1)

Ever wanted to build a Kubernetes Cluster? Well, you can. It's easy. Cross-posted from engi.fyi.

I just went through the process of setting up my Kubernetes Cluster, and it was pretty easy the third time around! So, I thought I'd put up a series of tutorials that focus on getting a Kubernetes Cluster up and running with Ingress, Certificates, and a basic Service.

Setting up your Account

First thing is first. Head over to Digital Ocean using my Referral Code. I run my personal clusters on Digital Ocean and they are the cheapest and also one of the most featureful Hosted Kubernetes providers.

On top of this, they also provide an excellent cluster base using the best-in-class Kubernetes networking solution Cilium. They also provide a hosted dashboard that you can access via a link on the Digital Ocean Control Panel, and doesn't need to be installed on your cluster itself (unlike other providers, I'm looking at you AWS).

If you don't want to test this on a real cluster, feel free to install Docker Desktop and enable the Kubernetes feature which comes with a local cluster.

Setting up your Cluster

Once you're logged in and ready to go, open the Kubernetes Control Panel. On the top-right corner of the screen is the Create button. Click it, and select Clusters Create Kubernetes Clusters.

Create Cluster

Select your Region (I like to go to Singapore, as I'm in Australia), name your Node Pool, select Standard Nodes (2GB Memory / 1 vCPU), with 1 node. There is no need for any more nodes at the moment, but when we get to setting up nginx we will scale up this to demonstrate Daemon Sets.

The cost for your cluster should be below, at $10 a month. That means the credit you got from my referral link should last 10 months! Yay! Name and tag (optional) your cluster, then click Create Cluster.

Pending Cluster

Accessing our Cluster

While we're waiting for the cluster to provision, let's get our CLI access up. Click Download Config File. After this is downloaded, fire up a terminal and install kubectl. This can be done with either Choco (kubernetes-cli) on Windows or Brew on macOS (kubectl). Once this is installed, move your confg file to ~/.kube/config.

Once you're configured, run kubectl get pods -n kube-system. If you've suceessfully installed kubectl and the put the configuration file in the right place, it should list a bunch of pods including kube-proxy, cilium, do-node-agent, and kube-state-metrics. If it doesn't work, your cluster is still being configured. Try again in a few minutes.

adam.hammond@adam-laptop k8s-config % kubectl get pods -n kube-system
NAME                                    READY   STATUS    RESTARTS  AGE
cilium-7vd9t                            1/1     Running   0         5m
cilium-operator-d5cd7d758-stsqw         1/1     Running   0         5m
coredns-84c79f5fb4-m9snd                1/1     Running   0         5m
csi-do-node-zc5w8                       2/2     Running   0         5m
do-node-agent-mhc88                     1/1     Running   0         5m
kube-proxy-4nm5b                        1/1     Running   0         5m
kube-state-metrics-7fd44b48b5-jgmz4     1/1     Running   0         5m
kubelet-rubber-stamp-7f966c6779-ztb5s   1/1     Running   0         5m

Once your cluster is ready, a little green light will show on the Kubernetes Dashboard and the Kubernetes Dashboard button should be available. Click it.

Cluster Ready

If your cluster is up-and-running, you should see three green circles and a bunch of green Daemon Sets. Congratulations, you're up and running with a Kubernetes Cluster. It's that easy.

Kubernetes Dashboard

Next Time

Now that we've got a cluster up and running, we'll be getting into setting up our Ingress Controllers with plain ol' HTTP so we can access workloads!

Top comments (0)