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(andtiles) are shared by several pods: use a ReadWriteMany storage class if they can run on different nodes. - Keep
FEDISPORT_KEY_ENCRYPTION_KEYoutside the cluster. - The Keycloak admin console is reached with
kubectl port-forward svc/keycloak 8080:8080, never through the ingress. - Backups: add the
components/backupcomponent and runmake-backup-secret.sh. - Upgrading: change the image tag and the base's
ref, apply, then runkeycloak-setuponce.
deploy/kubernetes/README.md in the repository has every detail.