k8s组件批量启动、查看状态
查看所有master节点kube-apiserver ansible k8s -m shell -a 'systemctl status kube-apiserver' 重启所有master节点kube-apiserver subprocess.call(["ansible k8s -m shell -a 'systemctl daemon-reload && systemctl restart kube-apiserver'"],shell=True) 查看所有master节点所有组件状态 ansible k8s -m shell -a 'systemctl status haproxy && systemctl status keepalived && systemctl restart etcd && systemctl daemon-reload && systemctl status kube-apiserver && systemctl status kube-controller-manager && systemctl status kube-scheduler' 重启所有master节点所有组件 subprocess.call(["ansible k8s -m shell -a 'systemctl daemon-reload && systemctl restart etcd && systemctl daemon-reload && systemctl restart kube-apiserver && systemctl restart kube-controller-manager && systemctl restart kube-scheduler'"],shell=True) 查看worker节点所有组件状态 ansible test4 -m shell -a 'systemctl status docker && systemctl status kubelet && systemctl status kube-proxy' 重启worker节点所有组件 ansible test4 -m shell -a 'systemctl daemon-reload && systemctl restart docker && systemctl daemon-reload && systemctl restart kubelet && systemctl daemon-reload && systemctl restart kube-proxy'