Notes regarding my home lab and personal K8s cluster
All nodes will be headless installs of Ubuntu 20.04
We setup SSH to be on by default in our OS image. Once we locate the IP of this device we can simply ssh into it.
ssh ubuntu@<ip-addr>
Turning on SSH by default we get the default Raspberry Pi ssh credentials of pi
and raspberry
respectively.
Prior to anything else, let’s delete this user and add one of our own with slightly better security.
sudo adduser <mynewuser>
Then we can set the password and confirm the changes:
Adding user `<mynewuser>' ...
Adding new group `<mynewuser>' (1001) ...
Adding new user `<mynewuser>' (1001) with group `<mynewuser>' ...
Creating home directory `/home/<mynewuser>' ...
Copying files from `/etc/skel' ...
New password:
Next, since this user will need sudo
let’s grant that:
usermod -aG sudo <mynewuser>
Finally, let’s delete the default user:
userdel -r ubuntu
There are a couple of different ways to change the a hostname. In this case I used hostnamectl
as it provides the benefit of not needing a restart and persisting across restarts.
hostnamectl set-hostname <new-name>
caveat of your working on Ubuntu 18.04 or later then you’ll need to do an extra step due to cloud-init. This Stack Overflow addresses theissue (https://askubuntu.com/questions/9540/how-do-i-change-the-computer-name_.
IP Binding in router
Starting in headlessmode
Add SSH file to boot image
Set IP on each device
Do this n
more times for the n
more Pis.
To start, we’ll need a container runtime. I use Docker at work so let’s use that here:
Docker
TODO install Docker
Kubernetes
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
echo "$(<kubectl.sha256) kubectl" | sha256sum --check
Expecting kubec: ok
kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
helm
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm