Closed andrewmyhre closed 7 years ago
I thought when we were working through this on slack that you determined that the 2.0 selector was different and that was the problem.
okay the difference between the 2.0 and 2.4 tutorials are is:selector: has(calico/k8s_ns) vs selector: calico/k8s_ns == 'advanced-policy-demo' the 2.4 one works for me
It is true that the 2.0 tutorial does not work with Calico 2.4 but we would not want to update the 2.0 tutorial for the 2.4 release. Am I misunderstanding something?
@andrewmyhre I'm going to close this issue as I believe we resolved the issue in slack, it was due to using an old version of the tutorial with a newer version of Calico. If I am incorrect here please comment and I will reopen the issue.
If you follow the advanced network policy tutorial for kubernetes you are asked to create a
default-deny
policy which isolates all pods. You are then asked to create an nginx deployment and open a network policy to it which you test with the commandwget -q --timeout nginx -O -
. The example won't work because it also needs a network policy allowing traffic to kube-system so that the dns lookup onnginx
can succeed.Expected Behavior
After creating the
access-nginx
network policy the commandnslookup nginx
should succeed from a pod launched in theadvanced-policy-demo
namespace.Current Behavior
When a busybox pod is launched in the
advanced-policy-demo
namespace annslookup nginx
command times out trying to reach the cluster dns.Possible Solution
User needs to add the following policy in addition to the
default-deny
policy to allow access tokube-system
pods:Steps to Reproduce (for bugs)
access-nginx
network policy. Thewget -q --timeout=5 nginx -O -
command will fail. The commandnslookup nginx
will also fail.nslookup nginx1 and
wget -q --timeout=5 nginx -O -` now succeed.Context
This is a problem for people following the advanced network policy tutorial.
Your Environment