# Deny by default: every pod in the namespace has no ingress or egress except DNS. # Workloads add narrow allowances with their own policies (for example the region # host's egress to exactly the database VM address and port, and ingress to its # operations port from the metrics scraper) in M8.4. Enforced by Canal/Calico. apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: aevolution-default-deny spec: podSelector: {} policyTypes: [Ingress, Egress] --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: aevolution-allow-dns spec: podSelector: {} policyTypes: [Egress] egress: - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: kube-system podSelector: matchLabels: k8s-app: kube-dns ports: - {protocol: UDP, port: 53} - {protocol: TCP, port: 53}