1
0
Fork 0
Resources for deploying and managing my personal Kubernetes cluster
 
 
 
Go to file
Dustin 7f3287297b jenkins: Migrate to iSCSI persistent volume
Managing the Jenkins volume with Longhorn has become increasingly
problematic.  Because of its large size, whenever Longhorn needs to
rebuild/replicate it (which happens often for no apparent reason), it
can take several hours.  While the synchronization is happening, the
entire cluster suffers from degraded performance.

Instead of using Longhorn, I've decided to try storing the data directly
on the Synology NAS and expose it to Kubernetes via iSCSI.  The Synology
offers many of the same features as Longhorn, including
snapshots/rollbacks and backups.  Using the NAS allows the volume to be
available to any Kubernetes node, without keeping multiple copies of
the data.

In order to expose the iSCSI service on the NAS to the Kubernetes nodes,
I had to make the storage VLAN routable.  I kept it as IPv6-only,
though, as an extra precaution against unauthorized access.  The
firewall only allows nodes on the Kubernetes network to access the NAS
via iSCSI.

I originally tried proxying the iSCSI connection via the VM hosts,
however, this failed because of how iSCSI target discovery works.  The
provided "target host" is really only used to identify available LUNs;
follow-up communication is done with the IP address returned by the
discovery process.  Since the NAS would return its IP address, which
differed from the proxy address, the connection would fail.  Thus, I
resorted to reconfiguring the storage network and connecting directly
to the NAS.

To migrate the contents of the volume, I temporarily created a PVC with
a different name and bound it to the iSCSI PersistentVolume.  Using a
pod with both the original PVC and the new PVC mounted, I used `rsync`
to copy the data.  Once the copy completed, I deleted the Pod and both
PVCs, then created a new PVC with the original name (i.e. `jenkins`),
bound to the iSCSI PV.  While doing this, Longhorn, for some reason,
kept re-creating the PVC whenever I would delete it, no matter how I
requested the deletion.  Deleting the PV, the PVC, or the Volume, using
either the Kubernetes API or the Longhorn UI, they would all get
recreated almost immediately.  Fortunately, there was actually enough of
a delay after deleting it before Longhorn would recreate it that I was
able to create the new PVC manually.  Once I did that, Longhorn seemed
to give up.
2024-06-23 09:53:15 -05:00
argocd step-ca: Redeploy with DCH CA R3 2024-02-22 07:10:01 -06:00
authelia authelia: Fix Jenkins OIDC client 2024-04-10 21:26:00 -05:00
autoscaler autoscaler: Add SealedSecret for AWS key 2024-02-22 09:59:16 -06:00
cert-manager cert-manager: Remove unused secrets 2024-02-16 20:56:08 -06:00
dch-root-ca step-ca: Re-deploy (again) with DCH CA R2 2024-04-05 13:03:34 -05:00
dch-webhooks dch-webhooks: Disable HTTPS redirect 2024-01-22 16:55:03 -06:00
device-plugins device-plugins: Allow FUSE plugin on Jenkins nodes 2024-02-13 07:56:35 -06: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: Replace importer access token 2024-05-10 09:23:04 -05:00
fleetlock fleetlock: Deploy Zincati fleet lock manager 2024-05-31 15:18:01 -05:00
grafana grafana: Enable send_user_header option 2024-02-22 07:10:01 -06:00
home-assistant home-assistant: Add time-to-go timer to watch view 2024-05-10 09:24:34 -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
invoice-ninja invoice-ninja: Update PVC for restored backup 2024-02-15 09:45:57 -06:00
jenkins jenkins: Migrate to iSCSI persistent volume 2024-06-23 09:53:15 -05:00
keyserv keyserv: Add age keys for unifi2 2024-05-26 11:48:12 -05:00
kitchen kitchen: Run as non-root user 2024-06-06 11:03:42 -05:00
loki-ca loki-ca: Add cert-manager issuer for Loki CA 2024-02-22 07:10:01 -06: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: Enable Flower 2024-05-22 15:50:32 -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 postgresql: Fix pod secrets 2023-10-19 07:12:16 -05:00
prometheus_speedtest prom_speedtest: Add application manifest 2022-08-06 22:21:06 -05:00
promtail promtail: Deploy as DaemonSet 2024-02-22 07:10:01 -06:00
rent-reminder rent-reminder: Add CronJob to send reminders 2024-01-04 08:54:54 -06: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
sshca sshca: Add machine ID for Toad 2024-05-22 15:20:09 -05:00
step-ca step-ca: Re-deploy (again) with DCH CA R2 2024-04-05 13:03:34 -05:00
storage home-assistant: Deploy Home Assistant 2023-07-24 17:53:58 -05:00
victoria-metrics v-m: Scrape metrics from fleetlock 2024-05-31 15:18:55 -05:00
websites websites: Host darkchestofwonders.us in k8s 2024-01-04 08:56:12 -06:00
xactfetch xactfetch: Provide Vaultwarden password for sync 2024-05-29 09:36:30 -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.