常见命令
# 进入pod
kubectl exec -it nginx-deployment-775f57cb68-p6cql -- sh
# 列出所有 Service 及其 Cluster IP
kubectl get svc
# 查看特定 Service 的详细信息
[root@yudianxx ~]# kubectl describe svc nginx
Name: nginx-service
Namespace: default
Labels: <none>
Annotations: <none>
Selector: app=my-nginx
Type: NodePort
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.100.253.82
IPs: 10.100.253.82
Port: <unset> 80/TCP
TargetPort: 80/TCP
NodePort: <unset> 30080/TCP
Endpoints: 10.244.1.3:80,10.244.2.3:80
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
上次更新: 2026-06-13 17:29:54