Private registry for an air-gapped install #3616
-
I'm having trouble with configuring the mirrors:
docker.io:
endpoint:
- https://example.com:5000/some/path
configs:
example.com:5000:
auth:
username: AzureDiamond
password: hunter2 What I think is different with my setup is that the required Rancher images are to be found in a path, like I have tried several combinations for the
Funny thing, I believe that the authentication works as shown above because using the option So, my question is... are sub paths for image mirroring supported? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
UPDATE This may be the accepted answer, but the solution I proposed is actually not officially supported by K3s. Please see @brandond's answer below: #3616 (comment) ORIGINAL ANSWER Try to start/install your k3s server with:
K3s will then download all internal images from this registry. When using the air-gapped bundle, it will even rename the bundled images so it appears like they have been pulled from this registry: k3s/pkg/agent/containerd/containerd.go Line 249 in cbfe673 Caveats:
Related PR: #3285 Edit: Correction: I think I originally read about it in the release notes of 1.21.1, so it probably just isn't part of the proper docs yet: https://github.com/k3s-io/k3s/releases/tag/v1.21.1%2Bk3s1 |
Beta Was this translation helpful? Give feedback.
-
--system-default-registry should be just a host and optional port, without a path component. We don't cover it in the docs at the moment, but you can rewire the paths in registries.yaml. There's an example in rancher/rke2#865 - for example, if you wanted mirrors:
docker.io:
endpoint:
- https://registry.lan:5000/v2/
rewrite:
"(.*)": "docker.io/$1"
configs:
registry.lan:5000:
tls:
insecure_skip_verify: true |
Beta Was this translation helpful? Give feedback.
UPDATE
This may be the accepted answer, but the solution I proposed is actually not officially supported by K3s. Please see @brandond's answer below: #3616 (comment)
ORIGINAL ANSWER
Try to start/install your k3s server with:
K3s will then download all internal images from this registry. When using the air-gapped bundle, it will even rename the bundled images so it appears like they have been pulled from this registry:
k3s/pkg/agent/containerd/containerd.go
Line 249 in cbfe673
Caveats: