Skip to content

Commit 87800ee

Browse files
authored
Update 20200204-NetworkPolicy-verification-rearchitecture.md
1 parent 7313378 commit 87800ee

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

keps/sig-network/20200204-NetworkPolicy-verification-rearchitecture.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ The consequences of this problem is that
148148

149149
## A high level outline of Pod Traffic Pathways
150150

151-
Before diving into test details, we outline different types of pod traffic. Each one of these types of traffic may pose different bugs to a CNI provider.
151+
One of the key reasons for better NetworkPolicy tests is to make CNI's more reliable across the board. Different types of traffic may pose different bugs to a CNI provider, under different load or security use-cases. In the future, we'd like NetworkPolicy tests to comprehensively address all of these scenarios. The work in this KEP is the first step in this direction.
152152

153153
Intranode
154154
- pod -> pod
@@ -196,8 +196,8 @@ This is from the test "should enforce policy to allow traffic only from a differ
196196

197197
```
198198
+-------------------------------------------------------------------+
199-
| +------+ +-------+ Figure 1a: The NetworkPolicy Tests | TODO: maybe include YAML examples side-by-side
200-
| | | | | current logical structure only verifies | visual nomenclature (i.e., cA -> podA)
199+
| +------+ +-------+ Figure 1a: The NetworkPolicy Tests |
200+
| | | | | current logical structure only verifies |
201201
| | a | | b | one of many possible network connectivity |
202202
| | | | | requirements. Pods and servers are both |
203203
| +--+---+ +--X----+ in the same node and namespace. |
@@ -228,10 +228,10 @@ namespaces created in the entire network policy test suite.
228228
| | +---------------+ X of other test scenarios which |
229229
| | | server | X guarantee that (1) There is no |
230230
| +---> 80,81 XXXXX namespace that whitelists traffic |
231-
| | | and that (2) there is no "pod" | TODO: test "default" namespace
232-
| +----X--X-------+ which whitelists traffic. | check for dropped namespaces
233-
| +------------X--X---------------+ | make test instances bidirectional
234-
| | X X | We limit the amount of namespaces | (client/servers)
231+
| | | and that (2) there is no "pod" |
232+
| +----X--X-------+ which whitelists traffic. |
233+
| +------------X--X---------------+ |
234+
| | X X | We limit the amount of namespaces |
235235
| | +------XXX XXX-------+ nsB| to test to 3 because 3 is the union |
236236
| | | | X X | | | of all namespaces. |
237237
| | | b | X X | c | | |
@@ -262,13 +262,15 @@ Note that we also don't explicitly test a few other scenarios that involve chang
262262
- New pods obeying old policies
263263
- Extensive changing of pod labels is keeping up with policies
264264

265+
We don't propose that this specific KEP implements complex temporal patterns, but, we note this here so it can be potentially addressed in a potential future KEP around performance and scalability testing of NetworkPolicies.
266+
265267
#### Other concrete examples of incompleteness
266268

267269
The above diagrams show that completeness is virtually impossible, the way the tests are written, because of the fact that each test is manually verifying bespoke cases. More concretely, however, a look at `should enforce policy to allow traffic only from a different namespace, based on NamespaceSelector [Feature:NetworkPolicy]` reveals that some tests don't do positive controls (validation of preexisting connectivity), whereas others *do* do such controls.
268270

269271
#### List of missing functional test cases
270272

271-
TODO: use multiple pods in contiguous CIDR to validate CIDR traffic matching
273+
- Multiple pods in contiguous CIDR to validate CIDR traffic matching: Currently we do very limited CIDR policy testing.
272274

273275
- Stacked IPBlock case: Need to add a test case to verify the traffic when a
274276
CIDR (say 10.0.1.0/24) is used in an ``except`` clause in one NetworkPolicy,
@@ -369,7 +371,6 @@ differentiating the stacked peers in network policy (an *or* selector) vs. a com
369371
Ingress: []networkingv1.NetworkPolicyIngressRule{{
370372
From: []networkingv1.NetworkPolicyPeer{
371373
{
372-
// TODO add these composably, so that can be disambiguated from combo networkpolicypeer
373374
PodSelector: &metav1.LabelSelector{
374375
MatchLabels: map[string]string{
375376
"pod-name": "client-b",
@@ -553,7 +554,6 @@ Now, this underlying API has (essentially) been implemented in full, and the fol
553554
```
554555
// NOTE: This builder implementation will be replaced based on community feedback as of 4/23, with
555556
// a struct implementation similar to what is in current tests.
556-
// TODO, consider a SpecBuilder.New(...) style of invocation
557557
builder := &utils.NetworkPolicySpecBuilder{}
558558
builder = builder.SetName("allow-x-via-pod-and-ns-selector").SetPodSelector(map[string]string{"pod": "a"})
559559
builder.SetTypeIngress()

0 commit comments

Comments
 (0)