NetworkPolicy
Create NetworkPolicy to Deny All Traffic
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: deny-by-default
spec:
podSelector: {}
ingress: []To make vmis accept connections from other vmis in the same namespace,
but reject all other connections from vmis in other namespaces:
....
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-same-namespace
spec:
podSelector: {}
ingress:
- from:
- podSelector: {}
....
Create NetworkPolicy to only allow HTTP and HTTPS trafficCreate NetworkPolicy to deny traffic by labels
Last updated