Skip to content

Add IPv6 support for Kourier#1455

Merged
knative-prow[bot] merged 1 commit into
knative-extensions:mainfrom
linkvt:ipv6-support
May 12, 2026
Merged

Add IPv6 support for Kourier#1455
knative-prow[bot] merged 1 commit into
knative-extensions:mainfrom
linkvt:ipv6-support

Conversation

@linkvt
Copy link
Copy Markdown
Member

@linkvt linkvt commented May 8, 2026

Kourier failed on IPv6-only clusters: the EndpointSlice watcher filtered out IPv6 addresses so the controller couldn't discover gateway pods, the bootstrap stats listener bound to IPv4 only, and the extauthz URI construction didn't bracket IPv6 addresses.

Using an IPv6 address with ipv4_compat works in IPv4 only environments as I tested locally, CI should confirm that.

Related to knative/serving#16591

Changes

  • Accept IPv6 EndpointSlices in ReadyAddressesFromSlice
  • Bind bootstrap stats listener to :: with ipv4_compat for dual-stack
  • Use net.JoinHostPort in extauthz URI for correct IPv6 bracketing

/kind enhancement

Release Note

Add IPv6-only cluster support for Kourier. EndpointSlice discovery now includes IPv6 addresses, the stats listener binds dual-stack, and extauthz URIs correctly bracket IPv6 hosts. Configure with listen-ip-addresses: "::" in config-kourier.

@linkvt linkvt requested a review from Copilot May 8, 2026 11:16
@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2026
@knative-prow knative-prow Bot requested review from dprotaso, dsimansk and skonto May 8, 2026 11:16
@knative-prow knative-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 8, 2026
Copy link
Copy Markdown

Copilot AI left a comment

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 adds IPv6-only (and improved dual-stack) support to Kourier by ensuring gateway discovery and connectivity logic correctly handles IPv6 EndpointSlices, IPv6 listener binding, and IPv6 host formatting in ext_authz URIs.

Changes:

  • Expand ReadyAddressesFromSlice to accept IPv6 EndpointSlices (in addition to IPv4) and update downstream aggregations/tests accordingly.
  • Construct ext_authz ServerUri.Uri using net.JoinHostPort to correctly bracket IPv6 hosts.
  • Update Envoy bootstrap stats listener to bind to :: with ipv4_compat: true for dual-stack compatibility.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/reconciler/ingress/lister.go Aggregates ready addresses from EndpointSlices (now including IPv6 via shared helper).
pkg/reconciler/ingress/config/ext_authz.go Uses net.JoinHostPort to format host:port correctly for IPv6 in ext_authz URIs.
pkg/reconciler/ingress/config/ext_authz_test.go Adds coverage for IPv6 host URI bracketing in ext_authz filter config.
pkg/generator/endpointslice.go Updates documentation/comments to reflect IP (v4/v6) support.
pkg/generator/endpointslice_test.go Updates expectations to include both IPv4 and IPv6 addresses.
pkg/endpointslice/endpointslice.go Accepts both IPv4 and IPv6 EndpointSlice.AddressType when extracting ready addresses.
pkg/endpointslice/endpointslice_test.go Updates tests to verify IPv6 ready endpoints are returned.
config/200-bootstrap.yaml Binds the stats listener to :: and enables ipv4_compat for dual-stack binding behavior.
Comments suppressed due to low confidence (1)

pkg/reconciler/ingress/lister.go:65

  • ListProbeTargets now aggregates ready addresses from EndpointSlices, which includes IPv6 slices via ReadyAddressesFromSlice, but lister_test.go only covers IPv4 slices. Please add a test case with an IPv6 EndpointSlice (and optionally mixed IPv4+IPv6) to prevent regressions in IPv6-only and dual-stack clusters.
	// Aggregate ready addresses from all slices
	allAddresses := sets.New[string]()
	for _, slice := range slices {
		addresses := endpointslice.ReadyAddressesFromSlice(slice)
		if addresses != nil {
			allAddresses = allAddresses.Union(addresses)
		}
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/generator/endpointslice_test.go Outdated
Kourier failed on IPv6-only clusters: the EndpointSlice watcher
filtered out IPv6 addresses so the controller couldn't discover
gateway pods, the bootstrap stats listener bound to IPv4 only, and
the extauthz URI construction didn't bracket IPv6 addresses.

Changes:
- Accept IPv6 EndpointSlices in ReadyAddressesFromSlice
- Bind bootstrap stats listener to :: with ipv4_compat for dual-stack
- Use net.JoinHostPort in extauthz URI for correct IPv6 bracketing

Signed-off-by: Vincent Link <vlink@redhat.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.52%. Comparing base (f3e4e0c) to head (db20e61).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1455   +/-   ##
=======================================
  Coverage   77.52%   77.52%           
=======================================
  Files          28       28           
  Lines        1882     1882           
=======================================
  Hits         1459     1459           
  Misses        334      334           
  Partials       89       89           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dprotaso
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label May 12, 2026
@dprotaso
Copy link
Copy Markdown
Contributor

Curious - how are you testing this in kind etc?

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 12, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, linkvt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot merged commit 4df21ed into knative-extensions:main May 12, 2026
42 checks passed
@linkvt linkvt deleted the ipv6-support branch May 13, 2026 09:25
@linkvt
Copy link
Copy Markdown
Member Author

linkvt commented May 13, 2026

Curious - how are you testing this in kind etc?

I created a kind cluster with the following config:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
  ipFamily: ipv6
nodes:
  - role: control-plane

Create the cluster and that's it:

kind create cluster --name ipv6test --config tmp/kind-ipv6-config.yaml
enabling experimental podman provider
Creating cluster "ipv6test" ...
 ✓ Ensuring node image (kindest/node:v1.35.0) 🖼
 ✓ Preparing nodes 📦
 ✓ Writing configuration 📜
 ✓ Starting control-plane 🕹️
 ✓ Installing CNI 🔌
 ✓ Installing StorageClass 💾
Set kubectl context to "kind-ipv6test"
You can now use your cluster with:

kubectl cluster-info --context kind-ipv6test

Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂
…/repos/knative/serving on  main [$?] via 🐹 v1.26.3k get po -A -o wide
NAMESPACE            NAME                                             READY   STATUS    RESTARTS   AGE   IP                      NODE                     NOMINATED NODE   READINESS GATES
kube-system          coredns-7d764666f9-tn2gz                         1/1     Running   0          20s   fd00:10:244::2          ipv6test-control-plane   <none>           <none>
kube-system          coredns-7d764666f9-zr44q                         1/1     Running   0          20s   fd00:10:244::3          ipv6test-control-plane   <none>           <none>
kube-system          etcd-ipv6test-control-plane                      1/1     Running   0          27s   fc00:f853:ccd:e793::d   ipv6test-control-plane   <none>           <none>
kube-system          kindnet-rpjlf                                    1/1     Running   0          20s   fc00:f853:ccd:e793::d   ipv6test-control-plane   <none>           <none>
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants