1、查看节点
[root@master69 kubernetes]# kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
master69 Ready master 3d14h v1.18.5 172.28.18.69 <none> CentOS Linux 7 (Core) 3.10.0-1062.9.1.el7.x86_64 docker://19.3.5
redis-01.hlqxt Ready <none> 39h v1.18.5 172.28.5.120 <none> CentOS Linux 7 (Core) 3.10.0-862.el7.x86_64 docker://19.3.12
redis-02.hlqxt Ready <none> 39h v1.18.5 172.28.5.124 <none> CentOS Linux 7 (Core) 3.10.0-862.el7.x86_64 docker://19.3.12
redis-03.hlqxt Ready <none> 38h v1.18.5 172.28.5.125 <none> CentOS Linux 7 (Core) 3.10.0-957.el7.x86_64 docker://19.3.12
2、查看某个pod
[root@master69 kubernetes]# kubectl get pod nginx-demo-deployment-59fbc48594-4nsx8 -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-demo-deployment-59fbc48594-4nsx8 1/1 Running 0 38h 10.244.8.165 redis-02.hlqxt <none> <none>
3、查看某个pod详细信息
[root@master69 kubernetes]# kubectl describe pod nginx-demo-deployment-59fbc48594-4nsx8
4、查看deployment
[root@master69 kubernetes]# kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-demo-deployment 3/3 3 3 39h
5、查看详细deployment
[root@master69 kubernetes]# kubectl describe deployment nginx-demo-deployment
6、查看service
[root@master69 kubernetes]# kubectl get svc -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3d15h <none>
nginx-demo-service NodePort 10.100.213.139 <none> 81:30001/TCP 16m app=nginx-k8s-demo
7、查看某个service详细信息
[root@master69 kubernetes]# kubectl describe svc nginx-demo-service
Name: nginx-demo-service
Namespace: default
Labels: <none>
Annotations: <none>
Selector: app=nginx-k8s-demo
Type: NodePort
IP: 10.100.213.139
Port: http 81/TCP
TargetPort: 80/TCP
NodePort: http 30001/TCP
Endpoints: 10.244.7.202:80,10.244.8.165:80,10.244.9.79:80
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>