1

-1

I am taking a Coursera class for CKA Prep and as part of that we are provisioning an instance of a node on Amazon EC2, installing the container runtime (which is containerd in this case) and now I am at the step where I need to install kubeadmn and kubectl. When I run this command:

sudo yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

I get this:

Error: Package: kubeadm-1.28.1-150500.1.1.x86_64 (kubernetes)
           Requires: cri-tools >= 1.28.0
           Available: cri-tools-1.25.0-1.amzn2.0.1.x86_64 (amzn2-core)
               cri-tools = 1.25.0-1.amzn2.0.1
           Available: cri-tools-1.26.1-1.amzn2.0.1.x86_64 (amzn2-core)
               cri-tools = 1.26.1-1.amzn2.0.1
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

So . . . I tried going to this site (https://github.com/kubernetes-sigs/cri-tools) and downloading the most recent crictl and critest but when I run the same command (the one above) I get the same error.

I also tried running the above by adding the --skip-broken modifier at the end, and that allows me to run without error... BUT it doesn't actually install kubeadm or kubectl either. So it is not very helpful. Also I did try running the rpm command. That did not seem to do anything.

Any help here? I saw a discussion on a kubernetes message board about how they ought not have kubeadmn dependent on cri-tools, but that doesn't help me with my current situation. Any help/suggestion?

3 Answers3

1

You have to disable the plugin from yum's command line with this line:

--disableplugin=priorities

Run this command :

sudo yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes --disableplugin=priorities
bjoster
  • 5,241
1

You can try adding RPM repository with the latest releases of CRI-O Container Runtime packages.

If on RHEL 7 based system then add the repository as below:

VERSION=1.28
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/CentOS_7/devel:kubic:libcontainers:stable.repo
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:${VERSION}/CentOS_7/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo

For RHEL 8 based system add:

VERSION=1.28
OS=CentOS_8
curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/devel:/kubic:/libcontainers:/stable.repo
curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo

Then install cri-o and cri-tools packages:

sudo yum install cri-o cri-tools

And try again your installation it should be successful.

0

I ran into the same issue in which the output stated the following

1 packages excluded due to repository priority protections

Only after disabling yum repository priorities was I able to fetch repo packages from https://pkgs.k8s.io/core:/stable:/v1.28/rpm to my AMZN linux 2 box.

Similar question posed here: https://serverfault.com/questions/312472/what-does-that-mean-packages-excluded-due-to-repository-priority-protections

[root@ip-172-31-89-230 system]# sudo yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
1 packages excluded due to repository priority protections        
Resolving Dependencies
--> Running transaction check
---> Package kubeadm.x86_64 0:1.28.2-150500.1.1 will be installed