/homelab-gitops

My cluster managed by ArgoCD.

Primary LanguageSmartyMIT LicenseMIT

🏠 homelab-gitops

My Kubernetes cluster state. Managed by ArgoCD.

GitHub last commit GitHub commit activity GitHub

⚙️ Hardware

Device Count Specs Purpose
Lenovo ThinkCentre M75q-1 1 Ryzen 5 Pro 3400GE + 16GB RAM + 512GB NVMe SSD k8s master & worker node

k0s quick install

The install assumes that all external secrets are already created in GitLab.

Start the k0s cluster:

cd ~/homelab-gitops
sudo k0s install controller --enable-worker -c ./k0s.yaml
sudo k0s start
sleep 5
sudo k0s status
sudo k0s kubeconfig admin > ~/.kube/config
kubectl taint nodes --all node-role.kubernetes.io/master-

Create the GitLab token secret used by external-secrets:

kubectl create ns external-secrets
kubectl apply -f -
apiVersion: v1
kind: Secret
metadata:
  name: gitlab-secret
  namespace: external-secrets
type: Opaque
stringData:
  token: xxx

Change the token value and type <Ctrl+D> <Enter> to create the secret.

Deploy external-secrets and ArgoCD apps:

cd ../../k8s-apps/external-secrets && helm dependency update && helm template external-secrets -n external-secrets . | kubectl apply -n external-secrets -f -
kubectl create ns argocd
cd ../../k8s-apps/argocd && helm dependency update && helm template argocd . -n argocd | kubectl apply -n argocd -f -
kubectl apply -f ../../argocd-apps/app-of-apps.yaml -n argocd

Cluster should be ready!

💣 Teardown

Save the GitLab token secret

kubectl get secret -n external-secrets gitlab-secret -o yaml > gitlab-secret.yaml

Teardown the cluster

sudo k0s stop
sudo k0s reset -v -d