Skip to content

e2e: add dual-stack (IPv4+IPv6) backend test matrix - #2536

Merged
thomasferrandiz merged 1 commit into
masterfrom
thomasferrandiz-e2e-dual-stack-tests
Aug 13, 2026
Merged

thomasferrandiz merged 1 commit into
masterfrom
thomasferrandiz-e2e-dual-stack-tests

Conversation

@thomasferrandiz

Copy link
Copy Markdown
Contributor

What

Extends the kind-based e2e suite (e2e/) with a dual-stack (IPv4+IPv6) test matrix, increasing coverage of flannel's IPv6 path which was previously untested end-to-end.

The dual-stack matrix runs the IPv6-capable backends — vxlan, vxlan-nftables, wireguard, host-gw — and asserts both IPv4 and IPv6 pod-to-pod connectivity plus the golden masquerade/forward rules for both families.

How

  • kind config generated in code (kindConfigYAML in cluster.go, via CreateWithRawConfig): IP_FAMILY=dual produces ipFamily: dual + a dual podSubnet. The static kind-config.yaml is kept as an IPv4 reference for running kind manually.
  • net-conf.json: installFlannel/renderFlannelManifest inject IPv6Network + EnableIPv6 when dual-stack.
  • New specs (connectivity_test.go): a flannel dual-stack backends Describe that pings over v4 and v6 and checks v4+v6 rules. The IPv4-only matrix is skipped when IP_FAMILY=dual (its IPv4 assertions are covered by the dual-stack specs) to keep runtime bounded.
  • Golden IPv6 rules (rules.go): ip6tables and nft ip6 flannel-ipv6 postrouting/forward assertions mirrored from the trafficmngr source (ff00::/8 multicast, ip6 saddr/daddr).
  • Helpers (kube.go): podCIDRv6, podIPv6, waitForPing6.

CI

kind-e2eTests.yml now uses an ip-family: [ipv4, dual] matrix. The dual leg enables IPv6 in the Docker daemon (ipv6 + fixed-cidr-v6 + ip6tables in daemon.json, plus ip6table_nat/ip6table_filter) before creating the cluster.

Why this works on GitHub-hosted runners: all flannel IPv6 traffic stays inside the kind Docker network (node containers on a Docker bridge), so the runner does not need routable/internet IPv6 connectivity — only the Docker daemon's internal IPv6 enabled. This is dual-stack (not v6-only), since the control plane and image pulls still use IPv4.

Validation

  • gofmt clean; go vet -tags e2e ./... passes.
  • Generated kind YAML validated to parse for both the ipv4 and dual variants.

Notes / risk

I could not run the full kind suite locally (needs Docker + kind + IPv6), so the golden IPv6 rule strings are derived from flannel's source rather than observed output. The IPv6 FORWARD-chain assertion assumes kube-proxy programs ip6tables identically to IPv4 — the same assumption the existing IPv4 test already makes. The first CI run on the dual leg is the real validation and may surface a minor rule-text tweak.

Extend the kind-based e2e suite with a dual-stack matrix that exercises
flannel IPv6 alongside IPv4 for the IPv6-capable backends (vxlan,
vxlan-nftables, wireguard, host-gw).

- Generate the kind config in code so IP_FAMILY=dual toggles a dual-stack
  cluster (ipFamily: dual + dual podSubnet).
- Inject IPv6Network/EnableIPv6 into net-conf.json when dual-stack.
- Add IPv6 pod-to-pod ping and golden ip6tables / nft ip6 flannel-ipv6
  rule assertions mirroring the trafficmngr source.
- Skip the IPv4-only matrix when IP_FAMILY=dual (its v4 checks are covered
  by the dual-stack specs) to keep runtime bounded.
- CI: add an ip-family [ipv4, dual] matrix; the dual leg enables IPv6 in
  the Docker daemon before creating the cluster. All flannel IPv6 traffic
  stays inside the kind Docker network, so the runner needs no routable
  IPv6 connectivity.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends flannel’s kind-based end-to-end test suite (e2e/) to exercise dual-stack (IPv4+IPv6) behavior across the IPv6-capable backends, and wires that dual-stack leg into GitHub Actions so the IPv6 datapath is covered in CI.

Changes:

  • Add an IP_FAMILY=dual dual-stack matrix that validates both IPv4 and IPv6 pod-to-pod connectivity for selected backends.
  • Generate kind cluster config in code to toggle ipFamily: dual and dual pod subnets, and inject IPv6 settings into net-conf.json when dual-stack is enabled.
  • Add IPv6 rule assertions for both ip6tables and nftables, plus helper functions to discover/ping IPv6 pod/node CIDRs.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Makefile Passes IP_FAMILY into the kind e2e test invocation so the suite can toggle dual-stack mode.
e2e/rules.go Adds IPv6 golden-rule builders and checks for ip6tables/nftables, and factors common rule construction helpers.
e2e/kube.go Adds helpers to retrieve IPv6 PodCIDR/PodIP and an IPv6 ping poll helper.
e2e/kind-config.yaml Documents that kind config is now generated in code and keeps the YAML as an IPv4 reference for manual runs.
e2e/flannel.go Extends manifest rendering/installation to inject IPv6Network and EnableIPv6 into net-conf.json when dual-stack.
e2e/e2e_suite_test.go Plumbs FLANNEL_IPV6_NET and IP_FAMILY into suite-wide configuration and logs dual-stack mode.
e2e/connectivity_test.go Adds a dual-stack backend matrix and skips the IPv4-only matrix when running in dual-stack mode.
e2e/cluster.go Generates kind cluster YAML in code (including dual-stack toggling) and uses CreateWithRawConfig.
.github/workflows/kind-e2eTests.yml Adds an ip-family: [ipv4, dual] matrix and enables Docker IPv6 for the dual-stack leg.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thomasferrandiz
thomasferrandiz merged commit 7bda42f into master Aug 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants