要监控CentOS上的Kubernetes(k8s)安装进度,您可以采用以下几种方法:
kubectl get nodes
命令来检查集群中所有节点的状态。kubectl get pods --all-namespaces
命令来查看所有命名空间中的Pod状态。kubectl get deployments --all-namespaces
命令来查看所有命名空间中的Deployment状态。kubectl get services --all-namespaces
命令来查看所有命名空间中的服务状态。kubectl get events --all-namespaces
命令来查看集群的事件日志。kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
命令来部署Dashboard。kubectl -n kube-system get svc | grep dashboard
命令获取),并使用默认的用户名和密码(通常是 admin/admin
)登录。安装Prometheus:可以使用Helm来简化Prometheus的部署过程。例如,使用以下命令安装 kube-prometheus-stack
:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update helm install prometheus prometheus-community/kube-prometheus-stack
安装Grafana:同样使用Helm来安装Grafana:
helm repo add grafana https://grafana.github.io/helm-charts helm repo update helm install grafana grafana/grafana
配置Grafana:将Prometheus作为数据源,并创建仪表板以可视化监控数据。
kubectl logs
命令查看Pod日志。通过上述方法,您可以全面监控CentOS上的Kubernetes集群的安装进度和运行状态。根据您的需求选择合适的工具和方法。