From e86bbbfa5a2b7f88bfa8670d1206d6df53ae60b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 1 Aug 2026 08:59:21 +0200 Subject: [PATCH] Add parameter for Kubernetes registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now supports a parameter "mirror" for pulling the images from: mirror: "http://host.lima.internal:8080" A pull-through cache for docker.io and other registries is at: https://aceeric.github.io/ociregistry/ Signed-off-by: Anders F Björklund --- templates/k3s.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/k3s.yaml b/templates/k3s.yaml index 8a6e288e..d155d199 100644 --- a/templates/k3s.yaml +++ b/templates/k3s.yaml @@ -41,6 +41,15 @@ provision: INSTALL_K3S_ARTIFACT_URL={{.Param.proxy}}/HTTPS///github.com/k3s-io/k3s/releases/download export INSTALL_K3S_ARTIFACT_URL {{- end}} + {{if .Param.mirror }} + mkdir -p /etc/rancher/k3s + cat </etc/rancher/k3s/registries.yaml + mirrors: + "*": + endpoint: + - "{{.Param.mirror}}" + EOF + {{end}} {{if not ( and .Param.url .Param.token )}} curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --write-kubeconfig-mode 644" sh - {{else}} @@ -78,5 +87,8 @@ param: # The proxy to use when downloading artifacts from k3s.io # For a local proxy use for instance "http://host.lima.internal:3142" proxy: "" + # The mirror to use when pulling images from registry + # For a local mirror use for instance "http://host.lima.internal:8080" + mirror: "" url: "" token: ""