Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 1.95 KB

README.md

File metadata and controls

59 lines (47 loc) · 1.95 KB

k3s-cluster

Tools used

Name Description
k3s K8s Distribution of my Raspberry Cluster (more info)
ArgoCD GitOps Tool to manage Kubernetes Apps
Cloudflare DNS and Tunnel for the local K8s Cluster (more info)
Terraform IaC Tool used to manage Cloudflare DNS and Tunnels

Infrastructure as Code

The cloudflare configuration of DNS records and tunnels are made with terraform. To make the process even easier, a github action uses the terraform cloud to plan and apply changes. All necessary variables (e.g. tunnel id) are stored as secrets in the terraform cloud project.

How to create the cluster

Install argocd

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Fix TLS

Add insecure tls to the config map. This enables the use of Cloudflare tunnels.

apiVersion: v1
data:
  server.insecure: "true"
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cmd-params-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cmd-params-cm

Add this repo as argocd app

Option A

kubectl apply -f init.yaml

Option B

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
kubectl port-forward svc/argocd-server -n argocd 8080:80
argocd login localhost:8080
argocd app create k3s-argocd --repo https://github.com/gerrited/k3s-cluster.git --path . --dest-namespace default --dest-server https://kubernetes.default.svc --directory-recurse

Use sealed secrets

Add new argocd app

kubectl apply -f sealed-secrets.yaml

Don't forget to restore the old sealed-secrets-key