One or more machines running one of:
Ubuntu 16.04+
Debian 9
CentOS 7
RHEL 7
Fedora 25/26 (best-effort)
HypriotOS v1.0.1+
Container Linux (tested with 1800.6.0)
内存:2 GB or more of RAM per machine (any less will leave little room for your apps)
cpu:2 CPUs or more
网络:Full network connectivity between all machines in the cluster (public or private network is fine)
独立:Unique hostname, MAC address, and product_uuid for every node.ip link
orifconfig -a ,cat /sys/class/dmi/id/product_uuid
端口开放:Certain ports are open on your machines. See here for more details.
swap:Swap disabled. You MUST disable swap in order for the kubelet to work properly
一、基础配置
#添加google repo源,要*。
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
exclude=kube*
EOF #关闭selinux
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config systemctl enable --now kubelet
二、安装kubelt kubeadm kubectl
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
三、启动
systemctl enable --now kubelet
其他
#如果防火墙启动的话,可能需要开启下面:
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system