How to install kubernetes in centos
This article mainly introduces how to install kubernetes in centos, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
Centos7 kernel version is too low, some kubernetes components have high kernel requirements (such as rook-ceph), so recommend ubuntu20.04 https://my.oschina.net/u/160697/blog/4416873
Refer to https://kubernetes.io/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/
Environmental centos7 and above
Use AliSource:
cat /etc/yum.repos.d/kubernetes.repo[kubernetes]name=Kubernetesbaseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/enabled=1gpgcheck=1repo_gpgcheck=1gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpghttps://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpgEOF# update system yum update -y#prohibit firewall systemctl stop firewalldsystemctl disable firewalld#will SELinux is set to permissive mode setenforce 0sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/'/etc/selecux/configurum install -y kubelet kubeadm kubectl --disableexclusive udes =kubernetes#install specified version #yum install -y kubelet-1.20.5 - 0 kubeadm-1.20.5 - 0 kubectl-1.20.5-0 --disableexcludes=kubernetessystemctl enable --now kubelet
Some RHEL/CentOS 7 users have experienced problems with traffic not being routed properly because iptables were bypassed. You should ensure that net.bridge.bridge-nf-call-iptables is set to 1 in the sysctl configuration.
cat /etc/docker/daemon.json