Bootstrap for the k8s platform on the homeserver
Find a file
Lukas Gysin 5df64e1037
feat: Version Pumb
Signed-off-by: Lukas Gysin <l.gysin@pm.me>
2025-07-24 00:47:07 +02:00
.gitignore Initial commit 2025-02-03 19:30:17 +01:00
docker.yaml feat: Install Docker 2025-02-11 08:27:26 +01:00
letsencrypt.yaml Initial commit 2025-02-03 19:30:17 +01:00
LICENSE Initial commit 2025-02-03 19:30:17 +01:00
provisioning.yaml feat: Version Pumb 2025-07-24 00:47:07 +02:00
README.md feat: Version Pumb 2025-07-24 00:47:07 +02:00

Platform

With this repository the platform for all services on the homeserver are setup and provisioned.

Getting Started

These instructions will give you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on deploying the project into production.

Prerequisites

Requirements for the software and other tools to build, test and push

Supported IDEs

You can use the IDE of your choice to continue developing the project. However, the following IDEs are recommended and officially supported:

Installing

A step by step series that tell you how to get a development environment up and running

Clone the repository to your local computer

git clone ${REPO_SSH_URL}

Deployment

The server is provisioned with Ansible and the following command

ansible-playbook -i inventory.yaml provisioning.yaml
ansible-playbook -i inventory.yaml docker.yaml

On each node of the kubernetes cluster docker must be installed. Docker is used by the game server and the ci/cd pipeline.

After the ansible playbook is run, the server is provisioned and a kubernetes cluster is present Now you have to copy the kubeconfig file from /etc/rancher/k3s/k3s.yaml from the server to ~/.kube/config on your local machine. Make sure to replace 127.0.0.1 in the kubeconfig with the ip address of the server.

scp <username>@<ip-address>:/etc/rancher/k3s/k3s.yaml ~/.kube/config
chmod 600 ~/.kube/config
vim ~/.kube/config

You should now be able to connect to the server. Test this connection with the following command

kubectl get nodes

Part of the platform is to install cert-manager, rancher and longhorn. The following chapters deploy theses service one by one.

First we need to install cert-manager

helm repo add jetstack https://charts.jetstack.io --force-update
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.18.2 --set crds.enabled=true
kubectl apply -f letsencrypt.yaml

After installing the cert-manager, rancher is installed.

helm repo add rancher-latest https://releases.rancher.com/server-charts/latest --force-update
helm install rancher rancher-latest/rancher --namespace cattle-system --create-namespace --version v2.11.3 --set hostname=rancher.testgoofy.ch --set replicas=-1 --set ingress.tls.source=letsEncrypt --set letsEncrypt.ingress.class=traefik --set letsEncrypt.email=certificates@testgoofy.ch

After installing rancher, login to the dashboard and deactivate fleet (the GitOps module) and harvester (the hypervisor module). The initial password is stored in the secret bootstrap-secret. To get the password, run the following command

kubectl get secret --namespace cattle-system bootstrap-secret -o json | jq -r .data.bootstrapPassword | base64 --decode

After logging in and changing the password, deactivate fleet and harvester in the Settings > Feature Flag. The initial password can be deleted, since it is not valid anymore.

kubectl delete secret --namespace cattle-system bootstrap-secret

Now longhorn can be installed.

helm repo add longhorn https://charts.longhorn.io --force-update
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --set longhornUI.replicas=1 --set persistence.defaultClassReplicaCount=1 --version 1.9.1

Now deploy the Identity Provider and the Git Server in this order. Theses services are needed for the GitOps with ArgoCD and must be deployed manually.

Versioning

We use Semantic Versioning for versioning.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments