Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connectivity: test accessing NodePort from outside with L7 policy #1547

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions connectivity/manifests/echo-ingress-l7-http-from-anywhere.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "echo-ingress-l7-http-from-anywhere"
spec:
description: "Allow all to GET / on echo"
endpointSelector:
matchLabels:
kind: echo
ingress:
- toPorts:
- ports:
- port: "8080"
protocol: TCP
rules:
http:
- method: "GET"
path: "/$"
9 changes: 9 additions & 0 deletions connectivity/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ var (
//go:embed manifests/echo-ingress-l7-http.yaml
echoIngressL7HTTPPolicyYAML string

//go:embed manifests/echo-ingress-l7-http-from-anywhere.yaml
echoIngressL7HTTPFromAnywherePolicyYAML string

//go:embed manifests/echo-ingress-l7-http-named-port.yaml
echoIngressL7HTTPNamedPortPolicyYAML string

Expand Down Expand Up @@ -192,6 +195,12 @@ func Run(ctx context.Context, ct *check.ConnectivityTest) error {
WithScenarios(
tests.OutsideToNodePort(),
)
ct.NewTest("north-south-loadbalancing-with-l7-policy").
WithFeatureRequirements(check.RequireFeatureEnabled(check.FeatureNodeWithoutCilium)).
WithCiliumPolicy(echoIngressL7HTTPFromAnywherePolicyYAML).
WithScenarios(
tests.OutsideToNodePort(),
)
ct.NewTest("pod-to-pod-encryption").
WithFeatureRequirements(check.RequireFeatureEnabled(check.FeatureEncryptionPod)).
WithScenarios(
Expand Down