canonical / microk8s

MicroK8s is a small, fast, single-package Kubernetes for datacenters and the edge.
https://microk8s.io
Apache License 2.0
8.49k stars 773 forks source link

Issue with installation process of microk8s via snap regarding outage of registry.k8s.io #3953

Closed Gh05t-PL closed 6 months ago

Gh05t-PL commented 1 year ago

Hello everyone,

Summary

I'm facing issue with installation process of microk8s via snap regarding outage of registry.k8s.io https://github.com/kubernetes/registry.k8s.io/issues/234

What Should Happen Instead?

Cluster should be started without errors

Reproduction Steps

  1. Install microk8s via snap
  2. run snap logs -f microk8s and wait until mentioned error

Error from logs

failed to get sandbox image \\"registry.k8s.io/pause:3.7\\": failed to pull image \\"registry.k8s.io/pause:3.7\\": failed to pull and unpack image \\"registry.k8s.io/pause:3.7\\": failed to resolve reference \\"registry.k8s.io/pause:3.7\\": pulling from host registry.k8s.io failed with status code [manifests 3.7]: 503 Service Unavailable\"

Is it possible to mitigate this issue?

Thank you!

neoaggelos commented 1 year ago

Hi @Gh05t-PL

There are two possible workarounds that you could consider from the MicroK8s side:

  1. Change the pause image used by MicroK8s by editing /var/snap/microk8s/current/args/containerd-template.toml and restarting MicroK8s. For example:
sudo sed -i 's,registry.k8s.io/pause:3.7,k8s.gcr.io/pause:3.7' /var/snap/microk8s/current/args/containerd-template.toml
sudo snap restart microk8s.daemon-containerd
  1. Configure a registry mirror for registry.k8s.io (should protect in case of more general outages if multiple images are affected):
echo '
server = "https://registry.k8s.io"

[host."https://k8s.gcr.io"]
  capabilities = ["pull", "resolve"]
' | sudo tee /var/snap/microk8s/current/args/certs.d/registry.k8s.io/hosts.toml

sudo snap restart microk8s.daemon-containerd

See also the relevant section in the docs https://microk8s.io/docs/registry-private#configure-registry-mirrors-7

stale[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.