Closed neubi4 closed 6 years ago
Thanks for the issue.
Indeed, the default size of an ipset of the list:set type is 8. We can change it by passing "size N" when creating the ipset.
I tried this on a 4.13 kernel, and the set size doesn't seem so fixed:
Name: weave-!KbcPP7#:Z;q|kV;:5)S@i1Yb
Type: list:set
Revision: 3
Header: size 8 comment
Size in memory: 1302
References: 1
Number of entries: 13
Members:
weave-N)8V}/RNBk}Hbq6iU7s^%D(4B comment "namespace: namespace1"
weave-zSTsK3R(n!XSc0to@fOZqySyo comment "namespace: namespace3"
weave-O.^I?XH/+TR*#ChsvaNf}0IM2 comment "namespace: namespace5"
weave-aRm4{a[@0CNQauQyb!yH.ZF)7 comment "namespace: namespace6"
weave-3[yUxF6(WCeM;/38{TEz^0goM comment "namespace: namespace7"
weave-nQg#GCV@k/*}hIE%67X9K6QJt comment "namespace: namespace8"
weave-iuZcey(5DeXbzgRFs8Szo]+@p comment "namespace: kube-system"
weave-k?Z;25^M}|1s7P3|H9i;*;MhG comment "namespace: default"
weave-CLJ9y.p0@5^Qv.m=.A4UUhG/o comment "namespace: namespace10"
weave-c;1_zMt}g|7Hn%!|sEo^5xSBv comment "namespace: namespace4"
weave-?}8a?)Oi$epp:oB@JKrB0;:)b comment "namespace: namespace9"
weave-4vtqMI+kx/2]jD%_c0S%thO%V comment "namespace: kube-public"
weave-6uV3q:VWP##e_D(zA6WcoNKN6 comment "namespace: namespace2"
the set size doesn't seem so fixed
From man 8 ipset
:
size value
The size of the list, the default is 8. The parameter is ignored since ipset
version 6.24.
So, we can assume that a set of the list:set type can grow dynamically since 6.24 (released 4 years ago).
OK, so do we have any theories about the problem the OP reported?
I wondered if it is different in Red Hat (inferred from OP reporting kernel 3.10.0
)
I've just checked with CentOS 7 (kernel 3.10), and the problem exists as reported.
Thanks for your help.
In our case its CentOS Linux release 7.4.1708 (Core) with kernel 3.10.0.
ipset version is
# ipset --version
ipset v6.29, protocol version: 6
but man 8 ipset
only says
size value
The size of the list, the default is 8.
Fixed by #3305
What you expected to happen?
I have the following kubernetes network policy:
I also have 10 (and more in the future) namespaces wich will match in this policy. I expected this to work.
It worked as i reduced the number of namespaces to under 8. 8 is the default size of a ipset list, and the ipset here has
Header: size 8
setipset list
.I think weave does not set a size for the ipset list, and therfor it is created with the default of 8, and the npc dies when trying to add a ninth entry to the set.
What happened?
weave-npc dies with the following log entrys:
How to reproduce it?
Create more than 10 namespaces and use the networkpolicy above.
Versions:
$ weave version 2.3.0 $ docker version
$ uname -a
Linux zed-lmon-node1 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ kubectl version