I installed kubernetes using these commands on centos7
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-$basearch
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
This will install the latest version, so i'm looking for a method to install a specific version. for example 1.8.1
Thank you
To install a specific version of the package it is enough to define it during the yum install
command:
yum install -y kubelet-<version> kubectl-<version> kubeadm-<version>
But for your particular case, when you want to install kubernetes
version 1.8.1
, kubernetes-cni
package should be 0.5.1
version to satisfy dependency requirements:
--> Finished Dependency Resolution
Error: Package: kubelet-1.8.1-1.x86_64 (kubernetes)
Requires: kubernetes-cni = 0.5.1
Available: kubernetes-cni-0.3.0.1-0.07a8a2.x86_64 (kubernetes)
kubernetes-cni = 0.3.0.1-0.07a8a2
Available: kubernetes-cni-0.5.1-0.x86_64 (kubernetes)
kubernetes-cni = 0.5.1-0
Available: kubernetes-cni-0.5.1-1.x86_64 (kubernetes)
kubernetes-cni = 0.5.1-1
Installing: kubernetes-cni-0.6.0-0.x86_64 (kubernetes)
kubernetes-cni = 0.6.0-0
So, the final command is:
yum install -y kubelet-1.8.1 kubectl-1.8.1 kubeadm-1.8.1 kubernetes-cni-0.5.1
Kubernetes cluster can be ready to use in minutes, and it does not depend much on rpm/deb packages delivered by operating system vendors.
Packages are delivered for user's comfort and consistency of installation. Usually, it is possible to downgrade packages provided by CentOS without breaking dependencies, but you need to be careful.
Kubernetes includes the kubeadm tool, which can setup all dependencies and spin up cluster in version provided in the command line:
sudo kubeadm init --kubernetes-version=v1.9.2
The installation process of a specific version is described in installation manual. I've also used scripts.
To avoid compatibility problem, please make sure your Kubernetes version is compatible with Docker containers engine version.