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