hjaltiatla

Installing kubeadm Centos7

Nov 8th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.24 KB | None | 0 0
  1. ##### Documentation Link: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
  2.  
  3. ##### Step 1: Configure Docker
  4.  
  5. yum -y install docker
  6. systemctl start docker
  7. systemctl enable docker
  8.  
  9. ##### Step 2: Configure repo
  10. cat <<EOF > /etc/yum.repos.d/kubernetes.repo
  11. [kubernetes]
  12. name=Kubernetes
  13. baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
  14. enabled=1
  15. gpgcheck=1
  16. repo_gpgcheck=1
  17. gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
  18. EOF
  19.  
  20. ##### Step 3: Basic Configurations
  21. setenforce 0
  22. sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
  23. yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
  24. systemctl enable --now kubelet
  25.  
  26. cat <<EOF >  /etc/sysctl.d/k8s.conf
  27. net.bridge.bridge-nf-call-ip6tables = 1
  28. net.bridge.bridge-nf-call-iptables = 1
  29. EOF
  30.  
  31. sysctl --system
  32.  
  33. ##### Step 4: Initialize Cluster with kubeadm
  34.  
  35. kubeadm init --pod-network-cidr=10.244.0.0/16
  36.  
  37. ##### Step 5:
  38.  
  39. Will be available after cluster is initialized.
  40.  
  41. ##### Step 6: Install Network Addon (flannel)
  42.  
  43. kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Advertisement
Add Comment
Please, Sign In to add comment