kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: default-deny-all spec: podSelector: {} policyTypes: - Ingress - Egress --- kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: allow-internet-only spec: podSelector: {} policyTypes: - Egress egress: - to: ports: - protocol: TCP port: 53 - protocol: UDP port: 53 - to: - ipBlock: cidr: 0.0.0.0/0 except: - 10.0.0.0/8 - 192.168.0.0/16 - 172.16.0.0/20