Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
install kubernetes 1.6 on centos 7.3

install kubernetes 1.6 on centos 7.3

Install kubelet, kubeadm, docker, kubectl and kubernetes-cni

1. Install Yum Repo

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://yum.kubernetes.io/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

2. Disable SELinux

setenforce 0

3. Install from yum

yum install -y docker kubelet kubeadm kubectl kubernetes-cni

4. Enable docker and kubelet

systemctl enable docker && systemctl start docker
systemctl enable kubelet && systemctl start kubelet

5. Edit the 10-kubadm.conf see

vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

Add the following before "ExeStart="

Environment="KUBELET_EXTRA_ARGS=--cgroup-driver=systemd"

6. Enable Overlay FS

sudo tee /etc/modules-load.d/overlay.conf <<-'EOF'
overlay
EOF

7. Reboot to reload kernel modules

reboot

8. Verify that OverlayFS is enabled:

lsmod | grep overlay
overlay

9. Edit the docker-storage-setup file

vi /etc/sysconfig/docker-storage-setup

add

STORAGE_DRIVER="overlay"

10. Start Docker and Kubelet Services

systemctl start docker
systemctl start kubelet
@semad
Copy link

semad commented Nov 23, 2017

Perfect! Thanks!
Actually, from your instructions, I made an Ansible playbook, with that I created a basic Cenots7.3/Docker/Kubelet VM. After imaging, this VM, I created a cluster of VMs having Kubelet and Docker running. And then followed these instructions: https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm to start the master node, and join the next ones. Now, I am running k8s v1.8.4. Thanks again.

@vevsatechnologies
Copy link

vevsatechnologies commented Mar 24, 2018

For any issue you can checkout this documentation
https://github.com/vevsatechnologies/Install-Kubernetes-on-CentOs

@rhounkpe
Copy link

rhounkpe commented Dec 31, 2019

Hi, I've followed this and got error Permission denied. This error persists event if I run the command with a privileged user with sudo. I am using CentOs 7

Command
sudo 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

Error:
-bash: /etc/yum.repos.d/kubernetes.repo: Permission denied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment