https://www.kubernetes.org.cn/5551.html
安装指定版本docker:
# yum list docker-ce --showduplicates | sort -r
yum install docker-ce-18.06.1.ce-3.el7vim
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 kubelet kubeadm kubectl kubernetes-cni
systemctl enable kubelet
sed -i "s/cgroup-driver=systemd/cgroup-driver=cgroupfs/g" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
cat > /etc/sysctl.d/k8s.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
vm.swappiness = 0
EOF
sysctl -p /etc/sysctl.d/k8s.
yum install -y ebtables socat
关闭sawp分区
https://github.com/containernetworking/plugins
swapoff -a
vi /etc/fstab
注释掉swap分区
#/dev/mapper/cl-swap swap swap defaults 0 0
下载cni 插件
wget https://github.com/containernetworking/plugins/releases/download/v0.7.4/cni-plugins-amd64-v0.7.4.tgz mkdir -p /etc/cni/net.d /opt/cni/bin
tar xf cni-plugins-amd64-v0.7.4.tgz -C /opt/cni/bin
# ls /opt/cni/bin
bridge dhcp flannel host-device host-local ipvlan loopback macvlan portmap ptp sample tuning vlan
cat > /etc/cni/net.d/10-flannel.conflist<<EOF
{
"name": "cbr0",
"cniVersion": "0.3.1",
"plugins": [
{
"type": "flannel",
"delegate": {
"isDefaultGateway": true
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
}
]
}
EOF
kubeadm config images pull --kubernetes-version=1.13.1
# kubeadm init