💻 Tech
To deny all incoming and outgoing connections in a namespace, just declare a network policy with following specs:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: default
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress