I traded an old curved monitor for a powerful, full-fledged workstation on OfferUp, was by surprise, as the seller was just trying to get rid off, which I accepted. In this article, we'll share the story of how an old monitor was traded for a Dell XPS 8500 with 16 GB of RAM and an Intel i7-3770 processor. We'll also guide you through the step-by-step process of setting up a single-node Kubernetes cluster for local projects and testing, making use of an upgraded 500 GB Samsung 870 EVO SATA SSD and a 1 TB Seagate HDD for logs and persistent volumes.

Step 1: Preparing the Hardware

The first step in the process is to prepare the hardware. In this case, the XPS 8500 workstation was upgraded with a 500 GB Samsung 870 EVO SATA SSD to host the Kubernetes installation and a 1 TB Seagate HDD for logs and persistent volumes.

  1. Open the workstation case and locate the SSD and HDD bays.
  2. Install the 500 GB SSD into an available SSD bay and connect the SATA data and power cables.
  3. Install the 1 TB Seagate HDD into an available HDD bay and connect the SATA data and power cables.
  4. Close the workstation case and connect all necessary peripherals, such as a keyboard, mouse, and monitor.

Step 2: Installing the Operating System

For this setup, we'll use Ubuntu 20.04 LTS as the operating system. Download the ISO image from the official website (https://ubuntu.com/download/desktop) and create a bootable USB drive.

  1. Insert the bootable USB drive into the workstation and power it on.
  2. Press the appropriate key to access the boot menu (usually F12 or DEL) and choose to boot from the USB drive.
  3. Follow the Ubuntu installation prompts, selecting the 500 GB SSD as the installation target.
  4. Complete the installation and reboot the system, removing the USB drive when prompted.

Step 3: Installing Docker

Kubernetes requires Docker as the container runtime. Install Docker using the following commands

Step 4: Installing Kubernetes

Use the following commands to install Kubernetes and its required components:

sudo apt update
sudo apt install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt update
sudo apt install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl

Step 5: Initializing the Kubernetes Cluster

Initialize the single-node Kubernetes cluster using the kubeadm command:

sudo kubeadm init --pod-network-cidr=10.244.0.0/16

After the initialization is complete, run the following commands to configure kubectl:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Step 6: Setting up a Pod Network

To enable communication between Pods, install a pod network add-on. In this example, we'll use Flannel:

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

Step 7: Allowing Single-Node Execution

By default, Kubernetes prevents Pods from running on the control-plane node for security reasons. To allow Pods to run on your single-node cluster, remove the taint on the control-plane node:

kubectl taint nodes --all node-role.kubernetes.io/master-

Step 8: Verifying the Cluster

To verify that your single-node Kubernetes cluster is up and running, execute the following command:

kubectl get nodes

You should see your node listed with a "Ready" status.

Step 9: Configuring Storage and Logging

To utilize the 1 TB Seagate HDD for logs and persistent volumes, you'll need to set up storage classes and persistent volume claims in your Kubernetes configuration.

1. Format and mount the 1 TB Seagate HDD on a directory (e.g., /mnt/data):

sudo mkfs.ext4 /dev/sdb1
sudo mkdir /mnt/data
sudo mount /dev/sdb1 /mnt/data
sudo chown -R $USER:$USER /mnt/data

2. Configure /etc/fstab to mount the HDD on boot:

echo '/dev/sdb1 /mnt/data ext4 defaults 0 0' | sudo tee -a /etc/fstab

3. Set up a storage class and a persistent volume claim (PVC) in your Kubernetes configuration to allocate storage from the mounted HDD.

4. Configure your applications to use the PVC for persistent storage and logs.

Conclusion

You've successfully upgraded your workstation and set up a single-node Kubernetes cluster for local projects and testing. This powerful setup will allow you to run and test containerized applications efficiently. With the 16 GB of RAM and Intel i7-3770 processor, you'll be able to run multiple containers simultaneously, while the 500 GB SSD and 1 TB Seagate HDD ensure fast and reliable storage for your applications and logs. Now, you're ready to start deploying and experimenting with your local Kubernetes projects.