generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BANP: Add conformance for gress rules
This commit adds conformance tests for mix of ingress and egress rules in same CRD, which mixes up protocols and ports in same rules. They should behave in an idempotent manner with regards to each other. Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
- Loading branch information
Showing
3 changed files
with
444 additions
and
1 deletion.
There are no files selected for viewing
121 changes: 121 additions & 0 deletions
121
conformance/base/baseline_admin_network_policy/core-gress-rules-combined.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
apiVersion: policy.networking.k8s.io/v1alpha1 | ||
kind: BaselineAdminNetworkPolicy | ||
metadata: | ||
name: default | ||
spec: | ||
subject: | ||
namespaces: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-gryffindor | ||
egress: | ||
- name: "allow-to-ravenclaw-everything" | ||
action: "Allow" | ||
to: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-ravenclaw | ||
- name: "deny-to-ravenclaw-everything" | ||
action: "Deny" | ||
to: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-ravenclaw | ||
- name: "deny-to-slytherin-at-ports-80-53-9003" | ||
action: "Deny" | ||
to: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-slytherin | ||
ports: | ||
- portNumber: | ||
protocol: TCP | ||
port: 80 | ||
- portNumber: | ||
protocol: UDP | ||
port: 53 | ||
- portNumber: | ||
protocol: SCTP | ||
port: 9003 | ||
- name: "allow-to-hufflepuff-at-ports-8080-5353" | ||
action: "Allow" | ||
to: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-hufflepuff | ||
ports: | ||
- portNumber: | ||
protocol: TCP | ||
port: 8080 | ||
- portNumber: | ||
protocol: UDP | ||
port: 5353 | ||
- portNumber: | ||
protocol: SCTP | ||
port: 9003 | ||
- name: "deny-to-hufflepuff-everything-else" | ||
action: "Deny" | ||
to: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-hufflepuff | ||
ingress: | ||
- name: "allow-from-ravenclaw-everything" | ||
action: "Allow" | ||
from: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-ravenclaw | ||
- name: "deny-from-ravenclaw-everything" | ||
action: "Deny" | ||
from: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-ravenclaw | ||
- name: "deny-from-slytherin-at-port-80-53-9003" | ||
action: "Deny" | ||
from: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-slytherin | ||
ports: | ||
- portNumber: | ||
protocol: TCP | ||
port: 80 | ||
- portNumber: | ||
protocol: UDP | ||
port: 53 | ||
- portNumber: | ||
protocol: SCTP | ||
port: 9003 | ||
- name: "allow-from-hufflepuff-at-port-80-5353-9003" | ||
action: "Allow" | ||
from: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-hufflepuff | ||
ports: | ||
- portNumber: | ||
protocol: TCP | ||
port: 80 | ||
- portNumber: | ||
protocol: UDP | ||
port: 5353 | ||
- portNumber: | ||
protocol: SCTP | ||
port: 9003 | ||
- name: "deny-from-hufflepuff-everything-else" | ||
action: "Deny" | ||
from: | ||
- namespaces: | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: network-policy-conformance-hufflepuff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.