在Debian上安装Kubernetes后,可通过以下命令验证安装是否成功:
检查kubectl版本
kubectl version --client  
显示客户端版本即表示安装正确。
查看集群节点状态
kubectl get nodes  
所有节点应显示为Ready状态。
检查核心组件运行状态
kubectl get pods -n kube-system  
确保kube-apiserver、kube-controller-manager等核心组件Pod状态为Running。
验证网络连通性
kubectl get pods -n kube-system | grep coredns  
确保CoreDNS Pod处于Running状态。kubectl run test-pod --image=busybox --rm -it -- /bin/sh  
ping <其他Pod的Service域名或IP>  
例如:ping nginx-service.default.svc.cluster.local。部署测试应用
kubectl apply -f nginx-deployment.yaml  
kubectl get deployments  
确保副本数达到预期。kubectl port-forward svc/nginx-deployment 8080:80  
curl http://localhost:8080  
应返回Nginx默认页面。查看集群资源使用情况(需安装Metrics Server)
kubectl top nodes  
kubectl top pods --all-namespaces  
确保资源使用在合理范围内。
注:若需更全面检查,可使用kubectl cluster-info dump导出诊断信息,或通过kubectl describe查看异常资源的详细日志。