apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: hub
  namespace: hub
  labels:
    app.kubernetes.io/name: hub
    app.kubernetes.io/part-of: hub
spec:
  egress:
  - {}
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          app.kubernetes.io/name: ingress-nginx
    ports:
    - port: 8080
      protocol: TCP
  podSelector:
    matchLabels:
      app.kubernetes.io/name: hub
      app.kubernetes.io/part-of: hub
  policyTypes:
  - Ingress
  - Egress
