主机名 | 操作系统版本 | ip | docker version | kubelet version | kubctl version | flannel version |
---|---|---|---|---|---|---|
kmaster | CentOS Linux release 7.4.1708 (Core) | 10.10.130.81 | 18.09.6 | v1.14.0 | v1.14.0 | 0.19.0 |
knode01 | CentOS Linux release 7.4.1708 (Core) | 10.10.130.82 | 18.09.6 | v1.14.0 | v1.14.0 | 0.19.0 |
knode02 | CentOS Linux release 7.4.1708 (Core) | 10.10.130.83 | 18.09.6 | v1.14.0 | v1.14.0 | 0.19.0 |
kubeadm init --apiserver-advertise-address 10.10.130.81 --pod-network-cidr=10.244.0.0/16
cat ~/.bashrc
export KUBECONFIG=/etc/kubernetes/admin.conf
docker pull quay.io/coreos/flannel:v0.11.0-amd64
mkdir -p /etc/cni/net.d/
cat /etc/cni/net.d/10-flannel.conf
{"name":"cbr0","type":"flannel","delegate": {"isDefaultGateway": true}}
mkdir /usr/share/oci-umount/oci-umount.d -p
mkdir /run/flannel/
cat /run/flannel/subnet.env
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubeadm token create --print-join-command
kubeadm join 10.10.130.81:6443 --token o00vfm.pbmf2r0h1jzcd74k --discovery-token-ca-cert-hash sha256:8fce5546e26d95a047b31dcaf5812402b4805da04420cfe1f8ab15ac2ac383e9
mkdir -p /etc/cni/net.d/
cat /etc/cni/net.d/10-flannel.conf
{"name":"cbr0","type":"flannel","delegate": {"isDefaultGateway": true}}
mkdir /usr/share/oci-umount/oci-umount.d -p
mkdir /run/flannel/
cat /run/flannel/subnet.env
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true