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: add basic egress gateway test #1555

Merged
merged 6 commits into from
May 5, 2023
Merged

Conversation

jibi
Copy link
Member

@jibi jibi commented Apr 28, 2023

This PR adds a first basic egress gateway test.
Given the cegp-sample CiliumEgressGatewayPolicy targeting:

  • a couple of client pods (kind=client) as source
  • the 0.0.0.0/0 destination CIDR
  • kind-worker2 as gateway node

the test simply ensures that traffic from both clients reaches the echo-external service with the egress IP of the gateway node

@jibi jibi temporarily deployed to ci April 28, 2023 12:13 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 1, 2023 08:56 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 1, 2023 09:29 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 1, 2023 10:11 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 1, 2023 10:33 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 2, 2023 09:08 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 2, 2023 09:14 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 2, 2023 09:23 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 2, 2023 09:34 — with GitHub Actions Inactive
jibi added 2 commits May 2, 2023 14:06
Signed-off-by: Gilberto Bertin <jibi@cilium.io>
add a new echo-external deployment for a JSON mock pod targeting all
external nodes (i.e. nodes that are not running Cilium)

Signed-off-by: Gilberto Bertin <jibi@cilium.io>
@jibi jibi temporarily deployed to ci May 2, 2023 12:51 — with GitHub Actions Inactive
@jibi jibi changed the title WIP: Add initial egress gateway tests connectivity: add basic egress gateway test May 2, 2023
@jibi jibi added the area/CI Continuous Integration testing issue or flake label May 2, 2023
this commit adds a new method to the check package,
WithCiliumEgressGatewayPolicy(), which can be used to apply one or more
egress gateway policies in the context of a given test.

The helper does not wait for the policies to be enforced so it will be
up the individual tests to ensure that (i.e. BPF entries for the policy
map are set).

Signed-off-by: Gilberto Bertin <jibi@cilium.io>
@jibi jibi temporarily deployed to ci May 2, 2023 12:58 — with GitHub Actions Inactive
@jibi jibi requested a review from a team as a code owner May 4, 2023 07:20
@jibi jibi requested review from aanm and nebril May 4, 2023 07:20
@jibi jibi temporarily deployed to ci May 4, 2023 07:20 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 4, 2023 07:47 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 4, 2023 08:48 — with GitHub Actions Inactive
@jibi jibi temporarily deployed to ci May 4, 2023 09:29 — with GitHub Actions Inactive
@jibi jibi requested review from brb and removed request for a team and rolinh May 4, 2023 09:29
Copy link
Member

@brb brb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍕 🚀

Copy link
Member

@nebril nebril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci-structure bits LGTM

@tklauser tklauser self-requested a review May 5, 2023 09:28
@jibi jibi removed request for youngnick and joamaki May 5, 2023 09:31
jibi added 3 commits May 5, 2023 12:39
This commit adds a first basic egress gateway test.

Given the cegp-sample CiliumEgressGatewayPolicy targeting:
- a couple of client pods (kind=client) as source
- the 0.0.0.0/0 destination CIDR
- kind-worker2 as gateway node

the test simply ensures that traffic from both clients reaches the
echo-external service with the egress IP of the gateway node.

Signed-off-by: Gilberto Bertin <jibi@cilium.io>
Use the node that runs the client pod with the other=client label as
egress gateway rather than hardcoding kind-worker2

Signed-off-by: Gilberto Bertin <jibi@cilium.io>
deploying the connectivity test twice on 2 different namespaces causes
some issue for the echo-external pod, which uses the host network
namespace and exposes a host port, so just reuse the same namespace for
both tests.

Relates: 3939c61
Signed-off-by: Gilberto Bertin <jibi@cilium.io>
@jibi jibi temporarily deployed to ci May 5, 2023 10:43 — with GitHub Actions Inactive
@jibi jibi requested a review from aanm May 5, 2023 10:44
@jibi jibi merged commit a1ad5a3 into main May 5, 2023
14 checks passed
@jibi jibi deleted the pr/jibi/egressgw-tests branch May 5, 2023 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI Continuous Integration testing issue or flake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants