From e466f5e96569ba77071864263442af7d324ac50d Mon Sep 17 00:00:00 2001 From: biersoeckli Date: Sat, 28 Feb 2026 12:25:39 +0000 Subject: [PATCH 1/2] fix: setup-scripts disable multipathd service and enable dm_crypt module for Longhorn support --- setup/setup-canary.sh | 12 ++++++++++++ setup/setup-worker.sh | 12 ++++++++++++ setup/setup.sh | 14 ++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/setup/setup-canary.sh b/setup/setup-canary.sh index c45b9ca..ac98a68 100644 --- a/setup/setup-canary.sh +++ b/setup/setup-canary.sh @@ -102,6 +102,18 @@ echo "Using Longhorn version: $LONGHORN_VERSION" sudo systemctl stop rpcbind.service rpcbind.socket sudo systemctl disable rpcbind.service rpcbind.socket +if systemctl list-units --full --all | grep -q 'multipathd'; then + sudo systemctl stop multipathd + sudo systemctl disable multipathd +fi + +if ! lsmod | grep -q dm_crypt; then + sudo modprobe dm_crypt +fi +if ! grep -q 'dm_crypt' /etc/modules; then + echo "dm_crypt" | sudo tee -a /etc/modules +fi + # Installation of k3s #curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--node-ip=192.168.1.2 --advertise-address=192.168.1.2 --node-external-ip=188.245.236.232 --flannel-iface=enp7s0" INSTALL_K3S_VERSION="v1.31.3+k3s1" sh - diff --git a/setup/setup-worker.sh b/setup/setup-worker.sh index 8615c51..575c9b8 100644 --- a/setup/setup-worker.sh +++ b/setup/setup-worker.sh @@ -76,6 +76,18 @@ echo "Using K3s version: $K3S_VERSION" sudo systemctl stop rpcbind.service rpcbind.socket sudo systemctl disable rpcbind.service rpcbind.socket +if systemctl list-units --full --all | grep -q 'multipathd'; then + sudo systemctl stop multipathd + sudo systemctl disable multipathd +fi + +if ! lsmod | grep -q dm_crypt; then + sudo modprobe dm_crypt +fi +if ! grep -q 'dm_crypt' /etc/modules; then + echo "dm_crypt" | sudo tee -a /etc/modules +fi + # Installation of k3s echo "Installing k3s with --flannel-iface=$selected_iface" curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--flannel-iface=$selected_iface" INSTALL_K3S_VERSION="$K3S_VERSION" K3S_URL=${K3S_URL} K3S_TOKEN=${JOIN_TOKEN} sh - diff --git a/setup/setup.sh b/setup/setup.sh index 2335972..296ee36 100644 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -101,6 +101,20 @@ echo "Using Longhorn version: $LONGHORN_VERSION" sudo systemctl stop rpcbind.service rpcbind.socket sudo systemctl disable rpcbind.service rpcbind.socket +# Disable multipathd service, as it can cause issues with Longhorn --> https://longhorn.io/kb/troubleshooting-volume-with-multipath +if systemctl list-units --full --all | grep -q 'multipathd'; then + sudo systemctl stop multipathd + sudo systemctl disable multipathd +fi + +# Enable dm_crypt module for Longhorn encryption support +if ! lsmod | grep -q dm_crypt; then + sudo modprobe dm_crypt +fi +if ! grep -q 'dm_crypt' /etc/modules; then + echo "dm_crypt" | sudo tee -a /etc/modules +fi + # Installation of k3s #curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--node-ip=192.168.1.2 --advertise-address=192.168.1.2 --node-external-ip=188.245.236.232 --flannel-iface=enp7s0" INSTALL_K3S_VERSION="v1.31.3+k3s1" sh - From c771770711386df324137cc2a413f5b99209c780 Mon Sep 17 00:00:00 2001 From: biersoeckli Date: Sat, 28 Feb 2026 12:59:19 +0000 Subject: [PATCH 2/2] fix: update registry deployment logic and change image version to 2.8 --- src/server/services/registry.service.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server/services/registry.service.ts b/src/server/services/registry.service.ts index ff67d11..b4713ad 100644 --- a/src/server/services/registry.service.ts +++ b/src/server/services/registry.service.ts @@ -73,22 +73,23 @@ class RegistryService { } async deployRegistry(registryLocation: string, forceDeploy = false) { - const deployments = await k3s.apps.listNamespacedDeployment(BUILD_NAMESPACE); - if (deployments.body.items.length > 0 && !forceDeploy) { - return; - } - const useLocalStorage = registryLocation === Constants.INTERNAL_REGISTRY_LOCATION; const s3Target = useLocalStorage ? undefined : await s3TargetService.getById(registryLocation!); - - console.log("(Re)deploying registry because it is not deployed or forced..."); - console.log(`Registry storage location is set to ${registryLocation}.`); console.log("Ensuring namespace is created..."); await namespaceService.createNamespaceIfNotExists(BUILD_NAMESPACE); + // Always update the ConfigMap so storage settings are never stale await this.createOrUpdateRegistryConfigMap(s3Target); + const deployments = await k3s.apps.listNamespacedDeployment(BUILD_NAMESPACE); + if (deployments.body.items.length > 0 && !forceDeploy) { + return; + } + + console.log("(Re)deploying registry because it is not deployed or forced..."); + console.log(`Registry storage location is set to ${registryLocation}.`); + if (useLocalStorage) { await this.createPersistenvColumeCLaim(); } @@ -224,7 +225,7 @@ class RegistryService { containers: [ { name: deploymentName, - image: 'registry:latest', + image: 'registry:2.8', volumeMounts: [ ...localStorageVolumeMount, { @@ -314,7 +315,6 @@ http: ` }, }; - const existingConfigMaps = await k3s.core.listNamespacedConfigMap(BUILD_NAMESPACE); if (existingConfigMaps.body.items.find(cm => cm.metadata?.name === REGISTRY_CONFIG_MAP_NAME)) { console.log("ConfigMap already exists, deleting and recreating...");