1
0
Fork 0
Resources for deploying and managing my personal Kubernetes cluster
 
 
 
Go to file
Dustin b07e141fa3 authelia: Convert to a stateless service
By default, Authelia uses a local SQLite database for persistent data
(e.g. authenticator keys, TOTP secrets, etc.) and keeps session data in
memory.  Together, these have some undesirable side effects.  First,
since needing access to the filesystem to store the SQLite database
means that the pod has to be managed by a StatefulSet.  Restarting
StatefulSet pods means stopping them all and then starting them back up,
which causes downtime.  Additionally, the SQLite database file needs to
be backed up, which I never got around to setting up.  Further, any time
the service is restarted, all sessions are invalidated, so users have to
sign back in.

All of these issues can be resolved by configuring Authelia to store all
of its state externally.  The persistent data can be stored in a
PostgreSQL database and the session state can be stored in Redis.  Using
a database managed by the existing Postgres Operator infrastructure
automaticaly enables high availability and backups as well.

To migrate the contents of the database, I used [pgloader].  With
Authelia shut down, I ran the migration job.  Authelia's database schema
is pretty simple, so there were no problems with the conversion.
Authelia started back up with the new database configuration without any
issues.

Session state are still stored only in memory of the Redis process.
This is probably fine, since Redis will not need restarted often, except
for updates.  At least restarting Authelia to adjust its configuration
will not log everyone out.

[pgloader]: https://pgloader.readthedocs.io/en/latest/ref/sqlite.html
2023-10-19 07:12:02 -05:00
argocd argocd/apps: kitchen: Initial commit 2023-10-14 22:13:09 -05:00
authelia authelia: Convert to a stateless service 2023-10-19 07:12:02 -05:00
autoscaler autoscaler: Tolerate control-plane taint 2022-12-16 17:20:22 -06:00
cert-manager cert-manager: Drop acmeDNS solver 2023-08-28 12:00:23 -05:00
dch-root-ca dch-webhooks: Configure SSH cert signer 2023-10-10 22:31:44 -05:00
dch-webhooks dch-webhooks: Configure SSH cert signer 2023-10-10 22:31:44 -05:00
device-plugins device-plugins: Add fuse-device-plugin DaemonSet 2023-10-10 22:31:44 -05:00
docker-distribution docker-distribution: Deploy OCI image registry 2022-07-31 01:15:01 -05:00
dynk8s-provisioner dynk8s-provisioner: Set instance label for Argo CD 2023-10-14 07:43:37 -05:00
firefly-iii firefly-iii: Set instance label for Argo CD 2023-10-14 07:40:14 -05:00
home-assistant home-assistant: Upgrade ZWaveJS UI to 9.1.2 2023-10-14 22:26:09 -05:00
hudctrl hudctrl: Update for v0.2.0 2022-12-18 16:26:07 -06:00
ingress home-assistant: Deploy Home Assistant 2023-07-24 17:53:58 -05:00
jenkins jenkins: Set instance label for Argo CD 2023-10-14 07:24:42 -05:00
kitchen kitchen: Remove config.yml ConfigMap generator 2023-10-14 22:01:26 -05:00
metrics metrics: Add role to allow anon access to metrics 2022-11-05 16:23:02 -05:00
ntfy ntfy: Set instance label for Argo CD 2023-10-14 07:28:05 -05:00
paperless-ngx paperless-ngx: Set instance label for Argo CD 2023-10-14 07:33:27 -05:00
photoframesvc photoframesvc: Initial commit 2023-10-14 11:25:50 -05:00
phpipam phpipam: Migrate to Sealed Secrets 2023-10-14 10:56:20 -05:00
postgresql authelia: Convert to a stateless service 2023-10-19 07:12:02 -05:00
prometheus_speedtest prom_speedtest: Add application manifest 2022-08-06 22:21:06 -05:00
scanservjs scanservjs: Update to v2.27.0 2023-07-08 07:06:10 -05:00
sealed-secrets sealed-secrets: Deploy Bitnami Sealed Secrets 2023-10-13 18:34:01 -05:00
setup setup: ks: Generate iSCSI initiator name 2022-08-23 21:22:01 -05:00
step-ca step-ca: Deploy Step CA service 2023-10-10 22:31:44 -05:00
storage home-assistant: Deploy Home Assistant 2023-07-24 17:53:58 -05:00
README.md README: Add storage section 2022-07-31 01:38:46 -05:00

README.md

Dustin's Kubernetes Cluster

This repository contains resources for deploying and managing my on-premises Kubernetes cluster

Cluster Setup

The cluster primarily consists of libvirt/QEMU+KVM virtual machines. The Control Plane nodes are VMs, as are the x86_64 worker nodes. Eventually, I would like to add Raspberry Pi or Pine64 machines as aarch64 nodes.

All machines run Fedora, using only Fedora builds of the Kubernetes components (kubeadm, kubectl, and kubeadm).

See Cluster Setup for details.

Jenkins Agents

One of the main use cases for the Kubernetes cluster is to provide dynamic agents for Jenkins. Using the Kubernetes Plugin, Jenkins will automatically launch worker nodes as Kubernetes pods.

See Jenkins Kubernetes Integration for details.

Persistent Storage

Persistent storage for pods is provided by Longhorn. Longhorn runs within the cluster and provisions storage on worker nodes to make available to pods over iSCSI.

See Persistent Storage Using Longorn for details.