vitobotta / hetzner-k3s

The easiest and fastest way to create and manage Kubernetes clusters in Hetzner Cloud using the lightweight distribution k3s by Rancher.
MIT License
1.91k stars 143 forks source link

[Documentation request] How to use private registry with auth #449

Open nicolas-mehlei-dh opened 2 months ago

nicolas-mehlei-dh commented 2 months ago

Hey all,

First of all, wonderful project and so far a very straight-forward experience to create a low-cost Kubernetes cluster.

Currently, the documentation does not yet explain how one can set up a private registry with the embedded k3s (see k3s docs).

For example, the terraform-hcloud-kube-hetzner project allows setting this via the configuration file (Example). In my specific case this would be for an ACR registry (Azure Container Registry), although the same would apply to other providers as well.

Unfortunately, I did not yet find out how to do it, and would appreciate some guidance. I'd gladly push the description as a PR afterwards.

vitobotta commented 2 months ago

HI! I hadn't thought of making custom registries configurable because it hasn't been requested before, but I could add this as a new setting easily.

At the moment the only option is to edit the yaml file on the servers manually and restarting k3s, but unfortunately that change would be overridden next time you run hetzner-k3s create.

I am taking a note now so I can try and add this to the next release.

nmehlei commented 2 months ago

Interesting, I would have thought this is a very common use case, as it's strictly necessary to host custom applications that are not public.

The workaround works, thank you for the tip. Looking forward to seeing this functionality in a future release.

axgkl commented 2 months ago

Interesting, I would have thought this is a very common use case, as it's strictly necessary to host custom applications that are not public.

The workaround works, thank you for the tip. Looking forward to seeing this functionality in a future release.

i think the 'normal' way to do this, is to to supply the full paths, with registry hostnames, plus image pull secrets, for images on those private registries. have not problems with that, even without that workaround.