Add parameter for Kubernetes registry

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 <anders.f.bjorklund@gmail.com>
This commit is contained in:
Anders F Björklund committed 2026-08-01 20:24:36 +02:00
1 parent 424d221699
commit e86bbbfa5a
1 file changed
+12
+12
View File
@@ -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 <<EOF >/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: ""