apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: openfaas
  namespace: openfaas
spec:
  policyTypes:
    - Ingress
  podSelector: {}
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          role: openfaas-system
    - namespaceSelector:
        matchLabels:
          role: openfaas-fn
      podSelector:
        matchLabels:
          role: openfaas-system
    - namespaceSelector: {}
      podSelector:
        matchLabels:
          app.kubernetes.io/name: ingress-nginx
    - namespaceSelector: {}
      podSelector:
        matchLabels:
          app: nginx-ingress
