I did it.

I signed up to take the CKA exam. It’s been a process learning all things k8s. The hands on study of k8s has been my favorite. So I think I’m ready (not ready) to take the test.

At the end of the KodeKloud CKA course. There’s a walkthrough to bootstrap a kubernetes cluster the hard way. I’m working through the tutorial, but modifying it to my lab environment to help drive in the point of how Kuberntes works.

Already this has been full of a lessons.

I’ll be working through the tutorial, modifying it to fit my environment, and learning! lol You can track the progress here: GitHub - smiggiddy/kubernetes-the-hard-way: Bootstrap Kubernetes the hard way

Step 1: is going through the Prereqs.

  • XCP-ng host machine. I’m using one pool with two hosts inside

  • Ansible - I’ll be using Ansible to create some playbooks and roles to provision this process

Step 2: Provisioning the compute Resources;

  • I provisioned a Ubuntu 20.04 XCP-ng cloud template image. I loaded it up with my SSH keys and cloned 3 copies of the VM.

  • I provisioned an Alpine cloud template image to use as a load balancer.

  • I also have a jumpbox to quickly ssh in and out of the cluster from my home network.

I decided to use the templates offered by XCP-ng to save time. These templates allow a base ubuntu system to be installed and configured in seconds.

BUT

After a battle with setting the hostname. I played a game of setting the hostname a few times. I used hostnamectl and alsochanged it in /etc/hostname and those changes didn’t persistent reboots.

So after that “hacking” and “slashed” I found my way on google to discover what is going on.

Learned about how the hostname is set in the cloudinit config file /etc/cloud/cloud.cfg

There’s a preserver hostname filed that’s set to false

Easy fix with sed.

sed -i '/preserve_hostname: false/c\preserve_hostname: true' /etc/cloud/cloud.cfg && sudo hostnamectl set-hostname <hostname>

Another reason why I like to bootstrap things. If I have the time to of course.

The lessons I learn along the way are so valuable. I always learn something because something is broken or will be.

So far everything is provisioned and I’m ready to move on to Installing the client tools. I’ll take care of that on the next session.