搭建教程
https://www.cnblogs.com/xuweiweiwoaini/p/13884112.html
初始化参数
kubeadm init --apiserver-advertise-address=192.168.1.161 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.18.0 --pod-network-cidr=10.244.0.0/16
安装dashboard教程
https://www.cnblogs.com/bigberg/p/13469736.html
生成一个永不过期的token
kubeadm token create --print-join-command
kubeadm token create --ttl 0
卸载dashboard
kubectl get secret,sa,role,rolebinding,services,deployments --namespace=kubernetes-dashboard | grep dashboard
kubectl delete deployment kubernetes-dashboard --namespace=kubernetes-dashboard
kubectl delete service kubernetes-dashboard --namespace=kubernetes-dashboard
kubectl delete role kubernetes-dashboard-minimal --namespace=kubernetes-dashboard
kubectl delete rolebinding kubernetes-dashboard-minimal --namespace=kubernetes-dashboard
kubectl delete sa kubernetes-dashboard --namespace=kubernetes-dashboard
kubectl delete secret kubernetes-dashboard-certs --namespace=kubernetes-dashboard
kubectl delete secret kubernetes-dashboard-key-holder --namespace=kubernetes-dashboard
node加入masterkubeadm join 192.168.1.161:6443 --token kuezr7.kcikphsnhsr7v65d --discovery-token-ca-cert-hash sha256:8a603328953526a436bf8250ef3fb3aa75565f3de18308d0bee15cb7bc2e6c4e
kubectl 常用命令
获取nodekubectl get node
查看pod运行情况
kubectl get pods -A -o wide
获取pod列表kubectl get pod -A
查看命名空间下的podkubectl get pods -n kube-system
获取pod详情kubectl describe pod 'podname' -n 'namespace'
使用yaml创建容器、用户、角色等kubectl apply -f **.yaml