k8s集群维护基本命令
时间: 2023-11-20 16:54:34 浏览: 100
是一些Kubernetes集群维护的基本命令:
1. 获取集群信息:kubectl cluster-info
```shell
kubectl cluster-info
```
2. 获取节点信息:kubectl get nodes
```shell
kubectl get nodes
```
3. 获取Pod信息:kubectl get pods
```shell
kubectl get pods
```
4. 获取服务信息:kubectl get services
```shell
kubectl get services
```
5. 获取命名空间信息:kubectl get namespaces
```shell
kubectl get namespaces
```
6. 获取配置信息:kubectl config view
```shell
kubectl config view
```
7. 获取事件信息:kubectl get events
```shell
kubectl get events
```
8. 获取日志信息:kubectl logs <pod-name>
```shell
kubectl logs <pod-name>
```
9. 获取Pod的详细信息:kubectl describe pod <pod-name>
```shell
kubectl describe pod <pod-name>
```
10. 获取服务的详细信息:kubectl describe service <service-name>
```shell
kubectl describe service <service-name>
```
11. 获取节点的详细信息:kubectl describe node <node-name>
```shell
kubectl describe node <node-name>
```
12. 获取命名空间的详细信息:kubectl describe namespace <namespace-name>
```shell
kubectl describe namespace <namespace-name>
```
13. 获取部署的详细信息:kubectl describe deployment <deployment-name>
```shell
kubectl describe deployment <deployment-name>
```
14. 获取状态集的详细信息:kubectl describe statefulset <statefulset-name>
```shell
kubectl describe statefulset <statefulset-name>
```
15. 获取副本集的详细信息:kubectl describe replicaset <replicaset-name>
```shell
kubectl describe replicaset <replicaset-name>
```
阅读全文