apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: test-nginx-policy
  namespace: default
spec:
  podSelector:
    matchLabels:
      app: nginx
  policyTypes:
  - Ingress
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          project: default
    - podSelector:
        matchLabels:
          access: granted
    ports:
    - protocol: TCP
      port: 80
