Use insecure registry with k0s or k0sctl

Hello,

I can’t find revelant documentation on how configure K0s to use insecure registry (easily).
Is someone has done it with v1.30.2+k0s.0 ?
If you can share it would be great !

Hello,

Insecure registry is configured in containerd, k0s allows you to configure containerd[1] using partial configuration files, so you can create a new file called /etc/k0s/containerd.d/privateregistry.toml with the following content [2]:

[plugins."io.containerd.grpc.v1.cri".registry]
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."1.2.3.4:5000"]
      endpoint = ["http://1.2.3.4:5000"]
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."myregistry.corp"]
      endpoint = ["http://myregistry.corp"]

  [plugins."io.containerd.grpc.v1.cri".registry.configs]
    [plugins."io.containerd.grpc.v1.cri".registry.configs."<IP>:5000".tls]
      insecure_skip_verify = true 
    [plugins."io.containerd.grpc.v1.cri".registry.configs."myregistry.corp".tls]
      insecure_skip_verify = true 

Keep in mind that k0s doesn’t use containerd 2 yet.

References:
1- https://docs.k0sproject.io/v1.30.2+k0s.0/runtime/
2- https://github.com/containerd/containerd/blob/v2.0.0-rc.3/docs/cri/registry.md

1 Like