Search code examples
kubernetes

Change kubernetes default registry to registry.k8s.io


I have a k8s cluster deployed with kubeadm and its current version is v1.21 and use docker as CRI I want to upgrade it to v1.25, so I was reading the release notes, and I read about the new k8s registry, which is registry.k8s.io in its release notes there in the last paragraph but I don't know how to check what my current registry is and how to change the default registry to the new one?

I found this link about this change, but I can't find my answers.


Solution

  • To check your current registry run the below command

    kubeadm config images list
    

    Output will be the images list where you can find the current registry.

    To change the registry to registry.k8s.io you can use the kubeadm init command.

    Kubeadm init –image-repository= registry.k8s.io
    

    Restart the cluster after changing the image as the configuration will be updated correctly,Then run kubeadm upgrade v1.25 to update your cluster.Now the clusters will be upgraded and will use the new registry.

    After that you can use kubeadm config images pull command to pull the images from the new registry, also make sure to update any existing deployments.