0

After following the Kubernetes installation guide I found than all the RPMS were removed from the YUM repository https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/Packages. However, on the release notes page you can see the links to binaries but not RPMs (for example: https://dl.k8s.io/v1.18.0/kubernetes-server-linux-amd64.tar.gz).

Can someone point me to the location of the RPMs? I'm aware Fedora comes with their own RPMS but these are older compared to the ones offered from the website (For example, Fedora 29 offers 1.10 while the website offers 1.18).

Thanks in advance.

--Jose

josegts
  • 21
  • 5

3 Answers3

1

They are not gone, they are just not visible with the web browser (I dunno why). If you follow instructions on adding yum repository to your system, you will be able to install RPMs from that repository. Although kubernetes server related RPMs are not there.

$cat /etc/yum.repos.d/kubernetes.repo 
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=0
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg

$dnf list --disablerepo='*' --enablerepo=kubernetes --available 
Last metadata expiration check: 0:06:26 ago on Mon 13 Jul 2020 21:24:45 CEST.
Available Packages
cri-tools.x86_64                                                                                1.13.0-0                                                                            kubernetes
kubeadm.x86_64                                                                                  1.18.5-0                                                                            kubernetes
kubelet.x86_64                                                                                  1.18.5-0                                                                            kubernetes
kubernetes-cni.x86_64                                                                           0.8.6-0                                                                             kubernetes
rkt.x86_64                                                                                      1.27.0-1                                                                            kubernetes
Ottovsky
  • 1,242
  • 9
  • 17
  • You are correct. I enabled the repository and I was able to install the RPM from there. So looks like they disabled file listing instead. – josegts Jul 14 '20 at 00:15
0

Thanks, I did this on a CentOS 8.2 but had to make one tweak. In this file

/etc/yum.repos.d/kubernetes.repo

I changed this line to have it enabled, so I changed it from:

enabled=0

to:

enabled=1

So my /etc/yum.repos.d/kubernetes.repo file looks like:

[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg

I then was able to do (for CentOS 8.x or Red Hat 8.x you can use dnf instead of yum, the actual command is dnf but on 8.x they do an alias of some sort to point yum to dnf)

mkdir /tmp/k8s
yum -y install --downloadonly --downloaddir=/tmp/k8s kubeadm kubelet kubectl

This downloaded the 3 rpms and dependencies. So my output was

14bfe6e75a9efc8eca3f638eb22c7e2ce759c67f95b43b16fae4ebabde1549f3-cri-tools-1.13.0-0.x86_64.rpm
b1b077555664655ba01b2c68d13239eaf9db1025287d0d9ccaeb4a8850c7a9b7-kubectl-1.19.2-0.x86_64.rpm
conntrack-tools-1.4.4-10.el8.x86_64.rpm
d0ba40edfc0fdf3aeec3dd8e56c01ff0d3a511cc0012aabce55d9a83d9bf2b69-kubeadm-1.19.2-0.x86_64.rpm
d9d997cdbfd6562824eb7786abbc7f4c6a6825662d0f451793aa5ab8c4a85c96-kubelet-1.19.2-0.x86_64.rpm
db7cb5cb0b3f6875f54d10f02e625573988e3e91fd4fc5eef0b1876bb18604ad-kubernetes-cni-0.8.7-0.x86_64.rpm
libnetfilter_cthelper-1.0.0-15.el8.x86_64.rpm
libnetfilter_cttimeout-1.0.0-11.el8.x86_64.rpm
libnetfilter_queue-1.0.2-11.el8.x86_64.rpm
socat-1.7.3.3-2.el8.x86_64.rpm

An alternate way, I also did the following

yum install -y yum-utils

then ran these 3 commands

yumdownloader kubeadm
yumdownloader kubelet
yumdownloader kubectl

This got me these 3 files in the current directory that you ran the command from

-rw-r--r-- 1 root root  9450186 Oct  8 10:11 b1b077555664655ba01b2c68d13239eaf9db1025287d0d9ccaeb4a8850c7a9b7-kubectl-1.19.2-0.x86_64.rpm
-rw-r--r-- 1 root root  8725678 Oct  8 10:10 d0ba40edfc0fdf3aeec3dd8e56c01ff0d3a511cc0012aabce55d9a83d9bf2b69-kubeadm-1.19.2-0.x86_64.rpm
-rw-r--r-- 1 root root 20438926 Oct  8 10:11 d9d997cdbfd6562824eb7786abbc7f4c6a6825662d0f451793aa5ab8c4a85c96-kubelet-1.19.2-0.x86_64.rpm

FYI to download a specific version of kubectl run this command

yum --showduplicates list kubectl

This will show you all the versions available in the 2nd column. The syntax to download a specific version is:

yumdownloader <packagename>-<version number>.x86_64

So for example to download kubectl version 1.18.9.0 for the x86_64 platform run

yumdownloader kubectl-1.18.9-0.x86_64

See here on how to download specific versions of packages https://www.thegeekdiary.com/centos-rhel-how-to-install-a-specific-version-of-rpm-package-using-yum

-1

For completeness, I decided to post how to get the RPMS using DNF:

sudo  dnf install kubelet kubeadm kubectl --disableexcludes=kubernetes -v --downloaddir=/tmp/k8s --downloadonly

Dependencies resolved.
Excludes in repo kubernetes: kubeadm, kubectl, kubelet
===========================================================================================================================================================================================================
 Package                                                   Arch                                      Version                                           Repository                                     Size
===========================================================================================================================================================================================================
Installing:
 kubeadm                                                   x86_64                                    1.19.2-0                                          kubernetes                                    8.3 M
 kubectl                                                   x86_64                                    1.19.2-0                                          kubernetes                                    9.0 M
 kubelet                                                   x86_64                                    1.19.2-0                                          kubernetes                                     19 M
Installing dependencies:
 cri-tools                                                 x86_64                                    1.13.0-0                                          kubernetes                                    5.1 M
 kubernetes-cni                                            x86_64                                    0.8.7-0                                           kubernetes                                     19 M
 conntrack-tools                                           x86_64                                    1.4.4-8.fc29                                      strike-os                                     200 k
 ebtables                                                  x86_64                                    2.0.10-28.fc29                                    strike-os                                     132 k
 libnetfilter_cthelper                                     x86_64                                    1.0.0-14.fc29                                     strike-os                                      22 k
 libnetfilter_cttimeout                                    x86_64                                    1.0.0-12.fc29                                     strike-os                                      22 k
 libnetfilter_queue                                        x86_64                                    1.0.2-12.fc29                                     strike-os                                      26 k

Transaction Summary
===========================================================================================================================================================================================================
Install  10 Packages

Total size: 61 M
Installed size: 261 M
DNF will only download packages for the transaction.
Is this ok [y/N]:

The rpms will be waiting for you on /tmp/k8s

josegts
  • 21
  • 5