kubernetes: Unable to install Kubernetes following the official installation guide on CentOS 7 on a VM

Is this a BUG REPORT or FEATURE REQUEST?:

/kind bug /sig Release /sig CLI

What happened: When I execute the following commands (taken from the official installation guide for kubernetes), the output is unexpected (shown below: ) Command (On CentOS 7): cat <<EOF > /etc/yum.repos.d/kubernetes.repo [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 exclude=kube* EOF setenforce 0 yum install -y kubelet kubeadm kubectl systemctl enable kubelet && systemctl start kubelet

Output: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile

  • base: centos.sonn.com
  • extras: mirror.sesp.northwestern.edu
  • updates: mirrors.cat.pdx.edu kubernetes/signature | 454 B 00:00:00 kubernetes/signature | 1.4 kB 00:00:00 !!! kubernetes/primary | 33 kB 00:00:00 kubernetes 237/237 No package kubelet available. No package kubeadm available. No package kubectl available. Error: Nothing to do

What you expected to happen: kubeadm, kubeclt and kubelet get installed and are enabled How to reproduce it (as minimally and precisely as possible):

Run the above mentioned commands on centos 7 (by following the guide at https://kubernetes.io/docs/setup/independent/install-kubeadm/) Anything else we need to know?: Docker version: Client: Version: 17.03.2-ce API version: 1.27 Go version: go1.7.5 Git commit: f5ec1e2 Built: Tue Jun 27 02:21:36 2017 OS/Arch: linux/amd64

Server: Version: 17.03.2-ce API version: 1.27 (minimum version 1.12) Go version: go1.7.5 Git commit: f5ec1e2 Built: Tue Jun 27 02:21:36 2017 OS/Arch: linux/amd64 Experimental: false

Environment:

  • Kubernetes version (use kubectl version): Unable to install the latest version following the official guide.
  • Cloud provider or hardware configuration: Vertual machine as per the guidelines on the official guide(2GB ram and 2 CPUs)
  • OS (e.g. from /etc/os-release): NAME=“CentOS Linux” VERSION=“7 (Core)” ID=“centos” ID_LIKE=“rhel fedora” VERSION_ID=“7” PRETTY_NAME=“CentOS Linux 7 (Core)” ANSI_COLOR=“0;31” CPE_NAME=“cpe:/o:centos:centos:7” HOME_URL=“https://www.centos.org/” BUG_REPORT_URL=“https://bugs.centos.org/

CENTOS_MANTISBT_PROJECT=“CentOS-7” CENTOS_MANTISBT_PROJECT_VERSION=“7” REDHAT_SUPPORT_PRODUCT=“centos” REDHAT_SUPPORT_PRODUCT_VERSION=“7”

  • Kernel (e.g. uname -a): Linux k1 3.10.0-862.9.1.el7.x86_64 #1 SMP Mon Jul 16 16:29:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

  • Install tools:

  • Others:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (1 by maintainers)

Most upvoted comments

This was solved. There is a mistake in the docs.

I can see there is a mistake in the docs.

Line containing exclude=kube* should be removed.

It should be as follows:

cat <<EOF > /etc/yum.repos.d/kubernetes.repo [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 EOF setenforce 0 yum install -y kubelet kubeadm kubectl systemctl enable kubelet && systemctl start kubelet

Please refer SO issue at https://stackoverflow.com/questions/51615343/unable-to-install-kubernetes-latest-version-following-the-official-installation

yum remove kubernetes-client 
yum remove kubernetes-node
yum clean packages
yum update
yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet

The exclude=kube* will actually exclude all pkgs. Just remove it and it should work.

For me, this issue was solved by following the instructions more closely:

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

the flag there at the end makes this work.

Hi

It sounds like packages not found by yum repo commands. Do try yum repo clean & yum update & then try installing the packages.

There is no such thing as “yum repo clean”, maybe you meant “yum clean all”?

Still error for me on CentOS 7.5 , worked after removed line: exclude=kubelet kubeadm kubectl and systemctl enable kubelet && systemctl start kubelet

@pcm1984 thanks for pointing it out. that is true. an older version of kubernetes was chefed in that i was not aware of.