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