1 3个节点: k8s-master k8s-node1 k8s-node2 2 yum install -y docker 3 所有节点安装kubelet kubeadm kubectl 4 master执行:105为MASTER的IP,网络方案是flannel kubeadm init --apiserver-advertise-address 192.168.56.105 --pod-network-cidr=l0.244.0.0/16 5 master配置kubectl,不要用root用户 su - ubuntu mdkir -p xx/.kube sudo cp -i /etc/kubernetes/admin.conf xx/.kube/config sudo chown ubuntu:root xx/.kube/config echo "source <(kubectl completion bash)" >>~/.bashrc 6 master安装pod网络(使用flannel) kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml 7 查看token: kubeadm token list 8 两台node注册到master kubeadm join --token xxxxxx masterip:6443 9Master上查看node kubectl get nodes
10 查看所有pod的状态 kubectl get pod --all-namespaces
11 查看pod的具体情况 kubectl describe pod podnamexxx