An introduction to my GitOps approach for self-hosting my portfolio, with code/infrastructure separation, Kubernetes deployment, and automated CI/CD.
Project Context
As part of my shift towards DevOps, I decided to automate the deployment of my personal website.
The project follows a GitOps model: in other words, the Git repository (hosted on GitHub) serves as the single source of truth. Any change merged into the repository should be automatically reflected in the production environment.
Repository Structure
To follow this GitOps logic, I chose to separate the application code from the infrastructure configuration in two distinct Git repositories:
- An application repository:
Wooulf/forkfolio
, which contains the website’s source code (Next.js), theDockerfile
, and a CI pipeline to build and deploy the Docker image. - An infrastructure repository:
Wooulf/infra-k8s-terraform
, which includes all Kubernetes configuration files (deployment.yaml
,service.yaml
,ingress.yaml
, etc.), along with another pipeline that automatically applies changes to the cluster.
🔁 This separation improves maintainability, clarifies responsibilities, and follows GitOps best practices.
Project Goals
The aim is to build a Minimum Viable Product (MVP) with an agile mindset, focusing first on the essential features:
- A minimalist Kubernetes cluster using MicroK8s
- Deployment of my portfolio as a Docker container
- Public exposure via a custom domain name
- A CI/CD pipeline to automate updates
- Basic monitoring to observe cluster health
Why MicroK8s?
I chose MicroK8s for its simplicity and lightweight setup.
It’s an ideal solution for testing environments, proof-of-concept setups, or personal projects like this one.
Other options like K3s, kind, or minikube may be considered later as the project evolves.
Environment Used
I’m using a VPS already set up at PulseHeberg, with the following specs:
- Processor: Intel Xeon E5-2680v4
- RAM: 8 GB DDR4
- Storage: 1 TB RAID 10
- Connection: 750 Mbps
- System: Ubuntu 22.04 LTS
This VPS easily exceeds MicroK8s requirements:
“MicroK8s runs in as little as 540MB of memory, but to accommodate workloads, we recommend a system with at least 20G of disk space and 4G of memory.”
- Official documentation
What’s Next?
In the next article, I’ll walk through the initial configuration of the MicroK8s cluster on this VPS, including:
- Installing MicroK8s
- Enabling required modules (DNS, ingress…)
- Setting up the firewall
🔧 The idea is to lay the technical foundations on which the entire project will be built.