In this training course, we will firewall pod to pod Communication. Note that your cluster has to support Network Policies.
Navigate to the folder
25_networkpolicies
from CLI, before you get started.
kubectl create -f bob.yaml
kubectl create -f susan.yaml
Curl bob from the susan
kubectl exec -it susan -- curl bob
kubectl create -f networkpolicy-deny-all.yaml
Curl bob from the susan
kubectl exec -it susan -- curl bob
Now Bob is not reachable from Susan.
kubectl create -f networkpolicy-allow-susan.yaml
Curl bob from the susan
kubectl exec -it susan -- curl bob
Now Bob is not reachable from Susan.
kubectl delete -f .