Create a Cluster

This lesson focuses on creating a cluster and the necessary requirements and gists for this chapter.

Pulling the code #

We’ll continue using definitions from the vfarcic/k8s-specs repository. To be on the safe side, we’ll pull the latest version first.

🔍 All the commands from this chapter are available in the 03-monitor.sh Gist.

cd k8s-specs

git pull

Additional necessary things #

In this chapter, we’ll need a few things that were not requirements before, even though you have probably already used them.

We’ll start using UIs so we’ll need NGINX Ingress Controller that will route traffic from outside the cluster. We’ll also need the environment variable LB_IP with the IP through which we can access worker nodes. We’ll use it to configure a few Ingress resources.

Gists and specifications #

Choose the flavor you want and run the commands from its .sh file to create the cluster and the required specifications needed in this chapter. Due to new requirements (Ingress and LB_IP), all the cluster setup Gists are new.

NOTE: In the end, you will see a command to DELETE the cluster too. Don’t execute that command. Use the DELETE command only when you need to delete the cluster, preferably at the end of the chapter.

A note to Docker for Desktop users

🔍 You'll notice LB_IP=[...] command at the end of the Gist. You'll have to replace [...] with the IP of your cluster. Probably the easiest way to find it is through the ifconfig command. Just remember that it cannot be localhost, but the IP of your laptop (e.g., 192.168.0.152).

A note to minikube and Docker for Desktop users

🔍 We have to increase memory to 3GB. Please have that in mind in case you were planning only to skim through the Gist that matches your Kubernetes flavor.

Get hands-on with 1000+ tech skills courses.