From faf78737bfb574175a65c311642e1347b7c5716e Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 18 Mar 2026 12:00:22 +0100 Subject: [PATCH 1/4] Fixing type error --- deploy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index c0aab20f42..2761b8a70e 100755 --- a/deploy.py +++ b/deploy.py @@ -413,8 +413,8 @@ def generate_configs(from_live, live_host, enable_ena, values_files=None): [ "python", "kubernetes/config-processor/config-processor.py", - temp_dir_path, - output_dir, + str(temp_dir_path), + str(output_dir), ] ) print(f"Config generation succeeded, processed config files available in {output_dir}") From 4c76082596680727929eb94114c96a14fca3f69f Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 18 Mar 2026 12:00:37 +0100 Subject: [PATCH 2/4] Added k3s-image argument --- deploy.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deploy.py b/deploy.py index 2761b8a70e..cc4d3a1a22 100755 --- a/deploy.py +++ b/deploy.py @@ -68,6 +68,7 @@ ) cluster_parser.add_argument("--delete", action="store_true", help="Delete the cluster") cluster_parser.add_argument("--bind-all", action="store_true", help="Bind to all interfaces") +cluster_parser.add_argument("--k3s-image", help="Specify the k3s image to use for the cluster") helm_parser = subparsers.add_parser("helm", help="Install the Helm chart to the k3d cluster") helm_parser.add_argument( @@ -180,10 +181,13 @@ def handle_cluster(): if cluster_exists(CLUSTER_NAME): print(f"Cluster '{CLUSTER_NAME}' already exists.") else: - run_command( - f"k3d cluster create {CLUSTER_NAME} {' '.join(port_bindings)} --agents 1", - shell=True, - ) + command = f"k3d cluster create {CLUSTER_NAME} {' '.join(port_bindings)} --agents 1" + + if args.k3s_image: + command += f" --image {args.k3s_image}" + + run_command([command], shell=True) + install_secret_generator() while not is_traefik_running(): print("Waiting for Traefik to start...") From 7f58e59e5e838a4c3d7796e475e01276e0a599b9 Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 18 Mar 2026 13:40:56 +0100 Subject: [PATCH 3/4] Added default k3s image of v1.31.14 --- deploy.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy.py b/deploy.py index cc4d3a1a22..de48cc022c 100755 --- a/deploy.py +++ b/deploy.py @@ -33,6 +33,11 @@ HELM_RELEASE_NAME = "preview" HELM_CHART_DIR = ROOT_DIR / "kubernetes" / "loculus" +# By default, uses K3s v1.31: https://hub.docker.com/r/rancher/k3s/tags?name=v1.31 +# K3s v1.31 is the latest version which installs Traefik v2 (Traefik v3 is not yet supported by Loculus) +# Also see: https://docs.k3s.io/upgrades#version-specific-caveats +DEFAULT_K3S_IMAGE = "rancher/k3s:v1.31.14-k3s1" + WEBSITE_PORT_MAPPING = "-p 127.0.0.1:3000:30081@agent:0" BACKEND_PORT_MAPPING = "-p 127.0.0.1:8079:30082@agent:0" LAPIS_PORT_MAPPING = "-p 127.0.0.1:8080:80@loadbalancer" @@ -68,7 +73,9 @@ ) cluster_parser.add_argument("--delete", action="store_true", help="Delete the cluster") cluster_parser.add_argument("--bind-all", action="store_true", help="Bind to all interfaces") -cluster_parser.add_argument("--k3s-image", help="Specify the k3s image to use for the cluster") +cluster_parser.add_argument( + "--k3s-image", default=DEFAULT_K3S_IMAGE, help="Specify the k3s image to use for the cluster" +) helm_parser = subparsers.add_parser("helm", help="Install the Helm chart to the k3d cluster") helm_parser.add_argument( From ace76fa96f0dc2da3a4188fc9d51417d45f4ea0a Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 18 Mar 2026 13:42:57 +0100 Subject: [PATCH 4/4] Added version to help message --- deploy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy.py b/deploy.py index de48cc022c..332c2efce0 100755 --- a/deploy.py +++ b/deploy.py @@ -74,7 +74,9 @@ cluster_parser.add_argument("--delete", action="store_true", help="Delete the cluster") cluster_parser.add_argument("--bind-all", action="store_true", help="Bind to all interfaces") cluster_parser.add_argument( - "--k3s-image", default=DEFAULT_K3S_IMAGE, help="Specify the k3s image to use for the cluster" + "--k3s-image", + default=DEFAULT_K3S_IMAGE, + help="Specify the k3s image to use for the cluster (default: %(default)s)", ) helm_parser = subparsers.add_parser("helm", help="Install the Helm chart to the k3d cluster")