Kubernetes weave network adapter and network policy #3433
Description
Based on https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy/ I've tried to test network policy on Kubernetes.
I've testes it with script:
while true
do
wget --spider --timeout=2 nginx
sleep 3
done
What you expected to happen?
When execuring my test script I was expected to see:
....
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
...
What happened?
Whene executing test script I see many timeouts
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
wget: download timed out
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
wget: download timed out
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
wget: download timed out
Connecting to nginx (10.100.122.58:80)
Connecting to nginx (10.100.122.58:80)
wget: download timed out
Connecting to nginx (10.100.122.58:80)
wget: download timed out
Connecting to nginx (10.100.122.58:80)
How to reproduce it?
Prepare nginx , busybox pods, service and network policy based on url I provided.
Then just use my script on busybox labeled pod
Anything else we need to know?
On busybox POD I get
1: lo inet 127.0.0.1/8 scope host lo\ valid_lft forever preferred_lft forever
39: eth0 inet 10.32.0.15/12 brd 10.47.255.255 scope global eth0\ valid_lft forever preferred_lft forever
ip route
default via 10.32.0.1 dev eth0
10.32.0.0/12 dev eth0 scope link src 10.32.0.15
In my Kubernetes I have 4 Weave pods.
On one of them when timeout exists I get error:
WARN: 2018/10/19 19:15:32.338824 TCP connection from 10.32.0.1:55588 to 10.42.0.2:80 blocked by Weave NPC.
On other Weave pods there are no errors.
Versions:
kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:46:06Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:36:14Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
uname -a
Linux k8smaster 4.4.0-137-generic #163-Ubuntu SMP Mon Sep 24 13:14:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Activity