k8s 常用命令
启动相关
kubeadm reset
kubeadm token create --print-join-command
kubectl get pod <podname> -n <namespace> -o yaml | kubectl replace --force -f -
kubectl apply -f xxx.yaml
kubectl delete -f xxx.yaml
kubectl drain node1
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl taint nodes master.k8s node-role.kubernetes.io/master=:NoSchedule
编辑相关
kubectl edit cm <cmname> -n <namespace>
kubectl edit srv <cmname> -n <namespace>
kubectl exec -it <podname> -n <namespace> -- /bin/bash
展示相关
kubectl get all -A
kubectl describe pod <podname> -n <namespace>
kubectl log -f pod <podname> -n <namespace>
kubectl get cm <cmname> -n <namespace> -o <yaml/json>
kubectl get node
kubectl get all --all-namespaces
kubectl get cs
网友评论