No description
Find a file
2025-12-05 23:11:06 +01:00
apps Adjusted names for seeder jobs 2025-12-05 23:11:06 +01:00
clusters/k0s-homelab Reapply "Added TeamCity" 2025-12-02 03:55:04 +01:00
k0s-cluster-config Updated k0s cluster config 2025-11-28 16:06:03 +01:00
secrets@4dbfee2089 Secrets update 2025-12-05 05:20:35 +01:00
.gitattributes Added Pixelmon 2025-09-25 21:27:53 +02:00
.gitmodules Renamed secrets folder to lower case 2025-11-13 01:39:28 +01:00
README.md Added reconciliation advice 2025-11-18 18:46:28 +01:00
renovate.json Add renovate.json 2025-06-26 21:20:06 +00:00

HomeLab

How to deploy

Step 1.: K0s Cluster deployment

First we need to deploy k0s on each node. To do so, head into the k0s-cluster-config/ folder and make sure all IP addresses and settings are correct! Then run the k0sctl apply command.

Next, generate a kubeconfig via k0sctl kubeconfig and optionally store it as your main kubeconfig:

k0sctl kubeconfig > ~/.kube/config

Let's verify that the cluster is deployed and working:

> kubectl get nodes
NAME             STATUS   ROLES           AGE     VERSION
k0s-controller   Ready    control-plane   6m33s   v1.34.1+k0s
k0s-worker-1     Ready    <none>          6m29s   v1.34.1+k0s
k0s-worker-2     Ready    <none>          6m29s   v1.34.1+k0s

Optionally, if we want to run container on the controller node too, we have to untaint it:

kubectl taint nodes k0s-controller node-role.kubernetes.io/control-plane:NoSchedule-

Note the - at the end. That'll remove the taint.

Step 2.: Bootstrap Flux

From the root of the repository run:

flux bootstrap git \
  --url=ssh://git@github.com/SakulFlee/HomeLab.git \
  --branch=main \
  --private-key-file ~/.ssh/id_ed25519 \
  --path=clusters/k0s-homelab

This will bootstrap Flux and setup this repository as the flux-source for syncronization. When prompted to give access to the repository, type y.

The private key mentioned here isn't strictly required as the repository itself is public. However, the secret repository (... containing all the secrets, credentials, auth info, etc. ...) is private and requires access. You can also use a GitHub app, deploy key or other means, but since I am deploying from my work machine, which also uses this SSH key to access GitHub, I can just pass this on.

Step 3.: Verification & Troubleshooting

After a bit, Flux should report that it is ready. If the cluster is freshly installed, it sometimes fails to do DNS queries for unknown reasons. Fully restarting each node usually fixes that, but you'll have to restart the flux bootstrap!

E.g.:

for node in $(cat k0s-cluster-config/k0sctl.yaml | grep address | awk {'print $2'}); do echo "> Rebooting $node ..."; ssh debian@$node -- sudo /sbin/reboot; echo ""; done

Assuming the username is debian.

Step 4.: Reconciliation

After a change has been pushed into this repository, FluxCD will automatically detect changes about every 10 minutes. If you want to force a reconciliation early, run the following command:

flux reconcile kustomization flux-system --with-source

flux-system is the main file handling this whole repository. If you just want to update a specific kustomization, simply exchange flux-system with the flux kustomization name of your choice!