CentOS搭建k8s集群(4)—添加工作节点

1、在node1和node2执行
kubeadm join 192.168.101.1:6443 --token mu949z.xkhkw4tq7t79z4v6 \
--discovery-token-ca-cert-hash sha256:0a381d7f750bda8d639b7132bf4db942710d2042b2cef0c6ffe6aa49a4603f5d \
--ignore-preflight-errors=Swap

2、返回
W0713 04:55:55.810886 12707 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
[WARNING Swap]: running with swap on is not supported. Please disable swap
error execution phase preflight: couldn't validate the identity of the API Server: could not find a JWS signature in the cluster-info ConfigMap for token ID "mu949z"
To see the stack trace of this error execute with --v=5 or higher

继续阅读CentOS搭建k8s集群(4)—添加工作节点

CentOS搭建k8s集群(3)—安装pod网络

1、安装flannel network(主节点)
cd ~
wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl apply -f kube-flannel.yml


podsecuritypolicy.policy/psp.flannel.unprivileged created
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.apps/kube-flannel-ds-amd64 created
daemonset.apps/kube-flannel-ds-arm64 created
daemonset.apps/kube-flannel-ds-arm created
daemonset.apps/kube-flannel-ds-ppc64le created
daemonset.apps/kube-flannel-ds-s390x created

2、pod概念
pod是k8s最小管理单位,它是一个或多个容器的组合

3、flannel network
用于集群中各个pod互相通讯的网络,Kubernetes支持Flannel、Calico、Weave network等多种cni网络Drivers
此时执行docker images,会看到多了一个flannel的镜像:
quay.io/coreos/flannel

4、查看集群节点状态,变为Ready
kubectl get nodes

NAME STATUS ROLES AGE VERSION
k8s-master Ready master 2d21h v1.18.5

继续阅读CentOS搭建k8s集群(3)—安装pod网络