Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 1.03 KB

File metadata and controls

48 lines (33 loc) · 1.03 KB
layout title permalink nav_order
page
Network policies
/netpol
4

Securing Namespaces with Network Policies

Test existing connectivity

kubectl run -i --rm --restart=Never --image=busybox:latest -n ns1 shell -- wget -qO- http://test.ns2.svc.cluster.local

Apply demo network policy

kubectl apply -f exercice-files/lab3.yaml

This demo policy has been built using a GUI available here: https://editor.networkpolicy.io/

Test new connectivity

kubectl run -i --rm --restart=Never --image=busybox:latest -n ns1 shell -- wget -qO- http://test.ns1.svc.cluster.local

kubectl run -i --rm --restart=Never --image=busybox:latest -n ns1 shell -- wget -qO- http://test.ns2.svc.cluster.local

Clean up

kubectl delete -f exercice-files/lab2-1.yaml