---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny-all
  namespace: ifconfig
spec:
  podSelector:
    matchLabels:
      app: ifconfig.me
  policyTypes:
  - Ingress
  - Egress
  ingress:
  # Allow connections from the ingress only
  - from:
    - podSelector:
        matchLabels:
          # app.kubernetes.io/name: ingress-nginx
          app.kubernetes.io/component: controller
      namespaceSelector:
        matchLabels:
          app.kubernetes.io/name: ingress-nginx
    ports:
    - protocol: TCP
      port: 80
  egress: []
