Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions setup/setup-canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -

Expand Down
12 changes: 12 additions & 0 deletions setup/setup-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down
14 changes: 14 additions & 0 deletions setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -

Expand Down
20 changes: 10 additions & 10 deletions src/server/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -224,7 +225,7 @@ class RegistryService {
containers: [
{
name: deploymentName,
image: 'registry:latest',
image: 'registry:2.8',
volumeMounts: [
...localStorageVolumeMount,
{
Expand Down Expand Up @@ -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...");
Expand Down