Skip to content

Kubernetes

Fedisport comes with a kustomize base in deploy/: the database, Keycloak with Fedisport's theme, web, worker, the hourly Keycloak setup, and optional backups. You write a small overlay for your server and apply it.

git clone https://github.com/oculos/fedisport.git
cp -r fedisport/examples/kubernetes ~/my-fedisport && cd ~/my-fedisport
docker run --rm ghcr.io/oculos/fedisport:0.1.0 fedisport new-env --domain run.example --name "Run Club" > .env
#   fill in the email settings in .env
sh make-secrets.sh .env fedisport     # the Secret in the cluster; settings.env here

In kustomization.yaml, point the base at a release:

resources:
  - namespace.yaml
  - github.com/oculos/fedisport//deploy?ref=v0.1.0
  - ingress.yaml
  - networkpolicy.yaml

…set your storage class, hosts and ingress, then:

kubectl apply -k .
kubectl -n fedisport create job --from=cronjob/keycloak-setup ks-now
kubectl -n fedisport exec deploy/web -- fedisport invite --note me

Good to know

  • Storage: uploads (and tiles) are shared by several pods: use a ReadWriteMany storage class if they can run on different nodes.
  • Keep FEDISPORT_KEY_ENCRYPTION_KEY outside the cluster.
  • The Keycloak admin console is reached with kubectl port-forward svc/keycloak 8080:8080, never through the ingress.
  • Backups: add the components/backup component and run make-backup-secret.sh.
  • Upgrading: change the image tag and the base's ref, apply, then run keycloak-setup once.

deploy/kubernetes/README.md in the repository has every detail.