Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install Kubernetes Latest version following the official installation guide on CentOS 7 on a VM

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 < /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:

Run the above mentioned commands on centos 7 (by following the guide at https://kubernetes.io/docs/setup/independent/install-kubeadm/)

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. hardware configuration: Vertual machine as per the guidelines on the official guide(2GB ram and 2 CPUs) OS:

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:

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
like image 203
Banyanbat Avatar asked Jan 28 '23 16:01

Banyanbat


2 Answers

You seem to be missing <<EOF at the end of the first line.

Also, 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
like image 138
Crou Avatar answered Jan 31 '23 09:01

Crou


It worked for me after removing following line from the kubernetes.repo:

exclude=kubelet kubeadm kubectl

like image 34
Vipul Sonar Avatar answered Jan 31 '23 08:01

Vipul Sonar