Personal Website

Here you will find information about my website

Project Overview

You are on this website now. My personal site was initially some static pages hosted on Github pages. It worked, but I felt that I could host it somewhere else while also learning about how most websites are hosted nowadays, especially when most of them are not static.

The first version was just HTML and CSS from a template served by Github pages with a couple links to my online profiles. I have rebuilt it to be a container running on Kubernetes in Amazon Web Services, with a Prometheus service scraping both the cluster it is running on and my Proxmox server running where I am at. I have set up my site to display metrics via direct calls with Rest API and to my personal computers with Grafana running in Docker containers.

Objectives

  • Deploy my website using Kubernetes on Amazon Web Services
  • Configure Prometheus to display my Home Lab's metrics live on my website

The Process

Step 1: Re-learning Kubernetes and cloud deployments

I had previous had my site deployed on Github pages, but going to a Kubernetes cluster on AWS was going to be something more challenging. I have previously used Google Cloud and Kubernetes in college, and I was able to deploy a sample application for a class. It had been a couple years since I had done that type of work, so I did several tutorials on setting up Kubernetes clusters on Youtube and AWS documentation. Once I got the hang of deploying clusters and configuring them once again, I was ready to try deploying my website with Kubernetes.

Step 2: Reformatting my website and setting up my cluster

I thought about using Amazon Web Services to deploy my website, as that is what I used to re-learn. However, I decided not to use AWS as it was too costly and I put it on Linode instead. To make sure my website was organized for deployment on Kubernetes, I moved around and renamed files to prepare them for packaging with Nginx, and then I tested my page locally on Docker. The only part that was not working on this setup was Prometheus, as I ran that before locally on another port. Once I finished Docker testing, I created a Kubernetes cluster in Linode.

Step 3: Getting Prometheus metrics to my website and deploying it

Getting Prometheus working was definitely the trickiest part of this project, as this required the most moving parts. Starting off, I added Prometheus and Tailscale pods and namespaces to enable my cluster to grab metrics from my server also on the Tailscale network. I proceeded to deploy my site image to the cluster.

More to be added once finished...

Challenges and Solutions

Issue 1: Secure exposure of my Proxmox Server

As I was figuring out how to have my Prometheus read my server from Kubernetes, I thought about concerns about having my server exposed to the internet. I had a hard time figuring out how to expose my metrics securely until I learned that Prometheus can scrape metrics off of a Tailscale node. However, setting this up was complicated and it required a lot of research.

I learned that I could do it by adding a sidecar to my Prometheus pods. Rather than doing that though, I edited my Tailscale configuration and added an ACL rule to allow my Kubernetes nodes to access the ports that Proxmox runs off of. It took me a while to get this working as I was new to configuring the trust center policies and getting the correct rules and tags on the correct instances, but I finally got the Tailscale pod on my cluster to work.

What I learned

In this project, I learned about how CI-CD pipelines work and how to get a website on the cloud through Kubernetes. Putting my home lab server's metrics online also taught me about how backend services reach the frontend securely. I learned about containers, container orchestration and deployment of a project. Every part of deploying the website with Kubernetes from Github Pages was a difficult learning experience, but the most difficult part for me was getting my Proxmox metrics securely. By making sure that the cluster and the home lab are on the Tailscale network, this prevents an attacker from making calls to the backend arbitrarily.