Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sangdongvan/667149cc49cbcbc29ff4c6a7fbfd9341 to your computer and use it in GitHub Desktop.
Save sangdongvan/667149cc49cbcbc29ff4c6a7fbfd9341 to your computer and use it in GitHub Desktop.
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 Docker

yum remove -y docker docker-common docker-selinux docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce-17.12.0.ce
systemctl enable docker && systemctl start docker

2. Install kubelet kubeadm kubectl

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 kubernetes-cni-0.5.1 kubelet-1.8.0 kubectl-1.8.0 kubeadm-1.8.0
systemctl enable kubelet && systemctl start kubelet

4. Enable Overlay FS

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

5. Reboot to reload kernel modules

reboot

6. Verify that OverlayFS is enabled:

lsmod | grep overlay
overlay

7. Edit the docker-storage-setup file

vi /etc/sysconfig/docker-storage-setup

add

STORAGE_DRIVER="overlay"

8. Edit kubelet KUBELET_CGROUP_ARGS to match with Docker

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

modify

Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=cgroupfs"

8. Start Docker and Kubelet Services

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