可以,通过externalIP
,例如下面service的yaml文件所示:
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
loadBalancerIP: 78.11.24.19
type: LoadBalancer
使用--field-selector
kubectl get pods --all-namespaces --field-selector metadata.namespace!=kube-system