Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.01 KB

File metadata and controls

51 lines (36 loc) · 1.01 KB

NetworkPolicies

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.

Create the resources for Bob and Susan

kubectl create -f bob.yaml
kubectl create -f susan.yaml

Verify that Susan can reach Bob

Curl bob from the susan

kubectl exec -it susan -- curl bob

Deny all ingress traffic

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.

Create a specific rule to allow Susan access to Bob again

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.

Cleanup

kubectl delete -f .

Jump to Home | Previous Training | Next Training