Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ayourtch/789125004514464e1b4345f07d33cb99 to your computer and use it in GitHub Desktop.
Save ayourtch/789125004514464e1b4345f07d33cb99 to your computer and use it in GitHub Desktop.
install kubernetes 1.6 on centos 7.3

install kubernetes 1.7 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-unstable
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

Configure SELINUX=disabled in the /etc/selinux/config file

sed -i.bak s/enforcing/disabled/g /etc/selinux/config

2a. update sysctl settings

Edit /etc/sysctl.conf

cat <<EOF >> /etc/sysctl.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF

2b. Open the port on the firewall

firewall-cmd --zone=public --add-port=6443/tcp --permanent
firewall-cmd --zone=public --add-port=10250/tcp --permanent

firewall-cmd --reload

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

run kubeadm-init

kubeadm init --pod-network-cidr=10.244.0.0/16

untaint the master for running the pods

kubectl taint nodes --all node-role.kubernetes.io/master-

configure the RBAC (?)

curl -sSL https://rawgit.com/coreos/flannel/master/Documentation/kube-flannel-rbac.yml |  kubectl create -f -
curl -sSL https://rawgit.com/coreos/flannel/master/Documentation/kube-flannel.yml |  kubectl create -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment