Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
7a6c74d
Add TCPRoute and UDPRoute Support for L4 Load Balancing
Skcey Aug 5, 2025
728139f
Merge branch 'main' into feature/tcproute-udproute
Skcey Aug 5, 2025
0f411fa
Update dependency goreleaser/goreleaser to v2.11.2 (#3678)
renovate[bot] Aug 5, 2025
2135545
Update google-github-actions/auth action to v2.1.12 (#3683)
renovate[bot] Aug 5, 2025
48793ae
Update dependency golangci/golangci-lint to v2.3.1 (#3684)
renovate[bot] Aug 5, 2025
4bd5a13
Update docker/metadata-action action to v5.8.0 (#3679)
renovate[bot] Aug 5, 2025
cf5260e
Update module github.com/prometheus/client_golang to v1.23.0 (#3680)
renovate[bot] Aug 5, 2025
0651c28
Adjust logging when resolving endpoints (#3690)
bjee19 Aug 5, 2025
966d874
Add CEL validation test for `targetRef` in ClientSettingsPolicy (#3623)
shaun-nx Aug 6, 2025
8defcb7
Lock file maintenance (#3681)
renovate[bot] Aug 6, 2025
fdedbe8
Update docker/login-action action to v3.5.0 (#3692)
renovate[bot] Aug 6, 2025
316db99
Update reviewdog/action-actionlint action to v1.66.0 (#3693)
renovate[bot] Aug 6, 2025
f058043
Add connection to NGINX One Console (#3676)
bjee19 Aug 6, 2025
3bd6c6f
Update anchore/scan-action action to v6.5.1 (#3691)
renovate[bot] Aug 6, 2025
c94688c
Update actions/download-artifact action to v5 (#3694)
renovate[bot] Aug 6, 2025
1dd7381
Validate agent token for duplicate IP addresses (#3673)
sjberman Aug 6, 2025
206b84e
Add CEL validation test for `timeout` in ClientSettingsPolicy (#3695)
shaun-nx Aug 7, 2025
6c410e5
Update Helm release opentelemetry-collector to v0.130.1 (#3700)
renovate[bot] Aug 7, 2025
bec23b0
Update github/codeql-action action to v3.29.8 (#3704)
renovate[bot] Aug 8, 2025
14878f4
Update actions/cache action to v4.2.4 (#3703)
renovate[bot] Aug 8, 2025
01c27c7
Update module google.golang.org/protobuf to v1.36.7 (#3705)
renovate[bot] Aug 8, 2025
da30c8e
Update module golang.org/x/text to v0.28.0 (#3706)
renovate[bot] Aug 8, 2025
2987d81
Update module gopkg.in/evanphx/json-patch.v4 to v4.13.0 (#3707)
renovate[bot] Aug 8, 2025
385d5be
Add control/data plane HPA (#3702)
sjberman Aug 8, 2025
e8083f7
Add mirroring fraction edge case test (#3708)
tataruty Aug 8, 2025
924252b
Add OverlappingTLSConfig condition (#3709)
ciarams87 Aug 8, 2025
00112a4
Update remaining server side apply for crds (#3711)
bjee19 Aug 8, 2025
11be55b
Update module github.com/nginxinc/nginx-go-crossplane to v0.4.79 (#3712)
renovate[bot] Aug 11, 2025
52529d3
Update pre-commit hook pre-commit/pre-commit-hooks to v6 (#3714)
renovate[bot] Aug 11, 2025
90137ca
Update google-github-actions/setup-gcloud action to v2.2.0 (#3713)
renovate[bot] Aug 11, 2025
1354b1d
Update actions/checkout action to v5 (#3720)
renovate[bot] Aug 12, 2025
2a82c8e
Fix NFR tests (#3722)
bjee19 Aug 12, 2025
0cd7d7f
Add CEL validation tests for NginxProxy (#3701)
shaun-nx Aug 13, 2025
fdf340f
add test for missing numerator case (#3715)
tataruty Aug 13, 2025
4381ffc
Update github/codeql-action action to v3.29.9 (#3724)
renovate[bot] Aug 13, 2025
26ba310
Update Helm release opentelemetry-collector to v0.130.2 (#3725)
renovate[bot] Aug 13, 2025
ca42cd7
Update NGINX Plus version to R35 (#3726)
salonichf5 Aug 13, 2025
b280a93
Add nginx one console connection telemetry field (#3717)
salonichf5 Aug 13, 2025
003eccc
Fix events block crash (#3730)
sarthyparty Aug 14, 2025
a82c2ba
Update NGINX and NGINX Agent (#3737)
sjberman Aug 14, 2025
046091a
(Cherry-pick) NFR Test Results for NGF version 2.1.0 (#3727) (#3739)
bjee19 Aug 14, 2025
7760ccf
Release 2.1.0 docs (#3741)
bjee19 Aug 14, 2025
b4a6629
Update golang Docker tag to v1.25 (#3747)
renovate[bot] Aug 15, 2025
9da888b
Update anchore/sbom-action action to v0.20.5 (#3743)
renovate[bot] Aug 15, 2025
a71ac1f
Fix policy attachment when ancestors slice is full (#3698)
sarthyparty Aug 15, 2025
2eaffeb
Update kubernetes packages to v0.33.4 (#3744)
renovate[bot] Aug 15, 2025
3dec05f
Update module github.com/nginx/nginx-gateway-fabric/v2 to v2.1.0 (#3749)
renovate[bot] Aug 15, 2025
f544664
Update dependency golangci/golangci-lint to v2.4.0 (#3746)
renovate[bot] Aug 16, 2025
aa1bc06
Update module github.com/nginxinc/nginx-go-crossplane to v0.4.80 (#3745)
renovate[bot] Aug 16, 2025
94a2edc
Update goreleaser/goreleaser-action action to v6.4.0 (#3748)
renovate[bot] Aug 18, 2025
235a4b2
Add readiness probes to deployments in functional tests (#3740)
sarthyparty Aug 18, 2025
e09b173
fix: remove patch label/ annotation cross contamination (#3754)
ciarams87 Aug 19, 2025
e0607ee
Update module github.com/onsi/ginkgo/v2 to v2.24.0 (#3758)
renovate[bot] Aug 19, 2025
af41450
Add cel tests for upstreamsettingspolicy (#3742)
sarthyparty Aug 19, 2025
0a3cb1a
Update actions/dependency-review-action action to v4.7.2 (#3755)
renovate[bot] Aug 20, 2025
1dac314
Add CEL validation tests for `ObservabilityPolicy` CRD (#3735)
shaun-nx Aug 20, 2025
22f6954
Update github/codeql-action action to v3.29.10 (#3756)
renovate[bot] Aug 20, 2025
782fbff
Add CEL tests for snippetsFilter API (#3750)
salonichf5 Aug 20, 2025
50597ae
Update reviewdog/action-actionlint action to v1.66.1 (#3757)
renovate[bot] Aug 20, 2025
4e366e8
Add local nginx dev env (#3752)
sarthyparty Aug 20, 2025
9d7d164
fix: host readiness probe on ipv6 in addition to ipv4 (#3765)
lucasl0st Aug 20, 2025
5688ba8
Update codecov/codecov-action action to v5.5.0 (#3769)
renovate[bot] Aug 21, 2025
fc6aa9a
feat: Support ExternalName Services (#3759)
ciarams87 Aug 21, 2025
8f6d24b
Fix SnippetsFilter Functional test (#3751)
bjee19 Aug 21, 2025
4690674
Add patches to helm chart spec (#3773)
salonichf5 Aug 21, 2025
566d91e
Update Helm release opentelemetry-collector to v0.131.0 (#3770)
renovate[bot] Aug 21, 2025
8fe3e6d
Update module github.com/onsi/ginkgo/v2 to v2.25.0 (#3771)
renovate[bot] Aug 21, 2025
1dc6797
Update module google.golang.org/grpc to v1.75.0 (#3764)
renovate[bot] Aug 22, 2025
585d51c
Update module github.com/onsi/ginkgo/v2 to v2.25.1 (#3780)
renovate[bot] Aug 22, 2025
59dea57
Update github/codeql-action action to v3.29.11 (#3779)
renovate[bot] Aug 22, 2025
5741ece
Update google-github-actions/setup-gcloud action to v3 (#3787)
renovate[bot] Aug 25, 2025
2cd485b
Update READMEs (#3788)
sjberman Aug 25, 2025
ab9c023
Update module github.com/onsi/gomega to v1.38.1 (#3785)
renovate[bot] Aug 25, 2025
7d184bb
Provisional: Proposal for Inference Extension (#3789)
sjberman Aug 26, 2025
8449668
Use GITHUB_TOKEN for opening automated PRs (#3783)
ciarams87 Aug 27, 2025
e50493c
Update actions/dependency-review-action action to v4.7.3 (#3793)
renovate[bot] Aug 27, 2025
d9d1181
Update module github.com/onsi/gomega to v1.38.2 (#3794)
renovate[bot] Aug 27, 2025
c3d544b
Update kindest/node Docker tag to v1.34.0 (#3804)
renovate[bot] Aug 28, 2025
7e3e6fc
Prevent policy `includes` duplication in advanced routing configurati…
shaun-nx Aug 28, 2025
01746d1
Update Helm release opentelemetry-collector to v0.132.0 (#3803)
renovate[bot] Aug 28, 2025
6d87eeb
Update module sigs.k8s.io/controller-tools to v0.19.0 (#3807)
renovate[bot] Aug 28, 2025
359326b
Update module google.golang.org/protobuf to v1.36.8 (#3768)
renovate[bot] Aug 28, 2025
ac2cfc6
Update google-github-actions/auth action to v3 (#3818)
renovate[bot] Aug 29, 2025
2685ad0
Update tests instructions for common troubleshooting (#3802)
salonichf5 Aug 29, 2025
a2a0c94
Handle duplicate kinds in listener allowed kinds (#3810)
fabian4 Aug 30, 2025
55d1d63
Update module github.com/onsi/ginkgo/v2 to v2.25.2 (#3816)
renovate[bot] Aug 30, 2025
d7e6178
Update google-github-actions/setup-gcloud action to v3.0.1 (#3815)
renovate[bot] Aug 30, 2025
2649f89
Update NGINX Agent to v3.3.0 (#3817)
renovate[bot] Aug 31, 2025
d36f1c0
Update kubernetes packages to v0.34.0 (#3805)
renovate[bot] Sep 2, 2025
867fe9c
Update module github.com/spf13/cobra to v1.10.1 (#3825)
renovate[bot] Sep 2, 2025
7f5af3c
Update deprecated goreleaser field (#3826)
sjberman Sep 2, 2025
13d2288
Update github/codeql-action action to v3.30.0 (#3824)
renovate[bot] Sep 2, 2025
918b9d4
Adjust nginx agent backoff settings and revert request timeout (#3820)
bjee19 Sep 2, 2025
86841e2
Add support for Port in ParentReference (#3778)
sarthyparty Sep 2, 2025
d85b34e
Update module sigs.k8s.io/controller-runtime to v0.22.0 (#3806)
renovate[bot] Sep 3, 2025
ac5c43d
Update opentelemetry-go monorepo to v1.38.0 (#3821)
renovate[bot] Sep 3, 2025
82c857d
Update module github.com/prometheus/common to v0.66.0 (#3831)
renovate[bot] Sep 3, 2025
1c4a353
Update module github.com/nginxinc/nginx-go-crossplane to v0.4.81 (#3829)
renovate[bot] Sep 3, 2025
542f3af
Update dependency goreleaser/goreleaser to v2.12.0 (#3830)
renovate[bot] Sep 3, 2025
81d3c43
Release 2.1.1 docs (#3833) (#3834)
ciarams87 Sep 3, 2025
9406f12
Chore: Use F5 artifactory GOPROXY and self-hosted runners (#3718)
ciarams87 Sep 4, 2025
8b013dd
Update actions/labeler action to v6 (#3849)
renovate[bot] Sep 4, 2025
f169217
Update module github.com/spf13/pflag to v1.0.10 (#3823)
renovate[bot] Sep 4, 2025
f98f6ec
Update module github.com/nginx/nginx-gateway-fabric/v2 to v2.1.1 (#3846)
renovate[bot] Sep 4, 2025
6d1c328
Fix GOPROXY for forks (#3854)
ciarams87 Sep 4, 2025
f8a9e3d
Update actions/stale action to v10 (#3853)
renovate[bot] Sep 4, 2025
2c44c7b
Proposal: Gateway API Inference Extension (#3800)
sjberman Sep 4, 2025
e0b4328
Update reviewdog/action-actionlint action to v1.67.0 (#3848)
renovate[bot] Sep 4, 2025
bca34ea
Update actions/setup-python action to v6 (#3852)
renovate[bot] Sep 4, 2025
b803305
Update docker/dockerfile Docker tag to v1.18 (#3847)
renovate[bot] Sep 4, 2025
7d98920
Update actions/setup-node action to v5 (#3851)
renovate[bot] Sep 4, 2025
c973f2a
Update actions/setup-go action to v6 (#3850)
renovate[bot] Sep 4, 2025
e112f37
Update actions/checkout digest version (#3858)
renovate[bot] Sep 5, 2025
98ba5bb
Update actions/labeler action to v6.0.1 (#3859)
renovate[bot] Sep 5, 2025
c14ce94
Update module github.com/prometheus/client_golang to v1.23.2 (#3862)
renovate[bot] Sep 5, 2025
2fa32f5
Update codecov/codecov-action action to v5.5.1 (#3860)
renovate[bot] Sep 5, 2025
65b2bd2
Update module github.com/onsi/ginkgo/v2 to v2.25.3 (#3861)
renovate[bot] Sep 5, 2025
2993d57
Update actions/github-script action to v8 (#3864)
renovate[bot] Sep 5, 2025
c330d5e
Align with BackendTLSPolicy validation (#3871)
ciarams87 Sep 8, 2025
61ac1fc
Update module golang.org/x/text to v0.29.0 (#3869)
renovate[bot] Sep 8, 2025
826319f
Update github/codeql-action action to v3.30.1 (#3868)
renovate[bot] Sep 8, 2025
67127be
Update module github.com/maxbrunsfeld/counterfeiter/v6 to v6.12.0 (#3…
renovate[bot] Sep 9, 2025
936f162
Update module sigs.k8s.io/controller-runtime to v0.22.1 (#3878)
renovate[bot] Sep 9, 2025
b52a208
Update Helm release opentelemetry-collector to v0.133.0 (#3879)
renovate[bot] Sep 9, 2025
ad69665
Fix some of the NFR tests to reduce error logs and pipeline failures …
salonichf5 Sep 9, 2025
00257fe
Update github/codeql-action action to v3.30.2 (#3883)
renovate[bot] Sep 10, 2025
9d69c44
Bump vite (#3882)
dependabot[bot] Sep 10, 2025
92099b2
Update module google.golang.org/grpc to v1.75.1 (#3885)
renovate[bot] Sep 11, 2025
3668019
Update kubernetes packages to v0.34.1 (#3884)
renovate[bot] Sep 11, 2025
9037710
Update module google.golang.org/protobuf to v1.36.9 (#3886)
renovate[bot] Sep 11, 2025
e033d56
Adding logging to functional tests (#3781)
tataruty Sep 11, 2025
54135b5
Update github/codeql-action action to v3.30.3 (#3891)
renovate[bot] Sep 11, 2025
92d2220
fix race detection in tests (#3901)
salonichf5 Sep 12, 2025
dd99515
Update inference design (#3902)
sjberman Sep 15, 2025
01cfcba
Update curlimages/curl Docker tag to v8.16.0 (#3897)
renovate[bot] Sep 15, 2025
c96694b
Tests/improve nfr logging (#3872)
tataruty Sep 15, 2025
4e3dc46
Update sigstore/cosign-installer action to v3.10.0 (#3903)
renovate[bot] Sep 15, 2025
635b3fc
Set NGINX Plus default image (#3919)
sjberman Sep 15, 2025
e179aac
Update anchore/scan-action action to v7 (#3925)
renovate[bot] Sep 16, 2025
abec621
Update Helm release opentelemetry-collector to v0.134.0 (#3924)
renovate[bot] Sep 16, 2025
cd96a13
Update dependency goreleaser/goreleaser to v2.12.1 (#3923)
renovate[bot] Sep 16, 2025
84a517f
Update anchore/sbom-action action to v0.20.6 (#3922)
renovate[bot] Sep 16, 2025
8bd27a3
NGINX Plus: support `enforce_initial_report` field (#3899)
tataruty Sep 17, 2025
5c3fc1b
Update lucacome/draft-release action to v2 (#3927)
renovate[bot] Sep 17, 2025
24e0cb6
Improve connection reset handling during ServiceAccountToken rotation…
ciarams87 Sep 17, 2025
36788a1
Add support for gateway addresses field (#3896)
bjee19 Sep 17, 2025
cbf7936
Update dependency nginx/agent to v3.3.1 (#3934)
renovate[bot] Sep 18, 2025
46ad0f3
Update dependency goreleaser/goreleaser to v2.12.2 (#3933)
renovate[bot] Sep 18, 2025
8f774c1
NFR Test Results for NGF version edge (#3921)
github-actions[bot] Sep 18, 2025
698a369
Remove error condition on httproute when nginx reload fails (#3936)
salonichf5 Sep 18, 2025
5188240
Revert agent reload backoff settings (#3937)
bjee19 Sep 19, 2025
24dee2b
Update dependency golangci/golangci-lint to v2.5.0 (#3940)
renovate[bot] Sep 22, 2025
4ac413b
Update diagram in inference doc (#3945)
sjberman Sep 23, 2025
3e21104
Update Helm release opentelemetry-collector to v0.134.1 (#3948)
renovate[bot] Sep 24, 2025
76184a9
Add nginx image version validation during agent connections (#3928)
ciarams87 Sep 24, 2025
8241478
Move certs job service account token (#3951)
sjberman Sep 24, 2025
1e7854c
Add IPv6 testing script for use in release process (#3931)
shaun-nx Sep 25, 2025
82b7839
Update dependency goreleaser/goreleaser to v2.12.3 (#3954)
renovate[bot] Sep 25, 2025
6a89752
Update actions/cache action to v4.3.0 (#3956)
renovate[bot] Sep 25, 2025
6fc5c11
Update docs for Release 2.1.2 (#3965)
salonichf5 Sep 25, 2025
b5925fa
Fix table spacing (#3966)
bjee19 Sep 25, 2025
4fb351e
Update NGINX Agent to v3.3.2 (#3955)
renovate[bot] Sep 26, 2025
cfb11b3
Update provision nginx log statement to be more clear (#3968)
bjee19 Sep 26, 2025
2f19ba8
Update github/codeql-action action to v3.30.5 (#3957)
renovate[bot] Sep 26, 2025
e6a52c7
Update actions/dependency-review-action action to v4.8.0 (#3974)
renovate[bot] Sep 29, 2025
a2ee4c4
Update Helm release opentelemetry-collector to v0.136.1 (#3967)
renovate[bot] Sep 29, 2025
cf38a6f
Add assertion doc job (#3929)
ciarams87 Sep 30, 2025
f0b6a3d
Update docker/login-action action to v3.6.0 (#3979)
renovate[bot] Sep 30, 2025
5add16d
Update Dockerfile alpine packages for cve fixes (#3973)
bjee19 Sep 30, 2025
de67647
Update actions/cache action to v4.3.0 (#3978)
renovate[bot] Sep 30, 2025
11a9015
Update dependency goreleaser/goreleaser to v2.12.4 (#3984)
renovate[bot] Oct 1, 2025
3ab9095
Update ossf/scorecard-action action to v2.4.3 (#3985)
renovate[bot] Oct 1, 2025
9010072
Lock file maintenance (#3986)
renovate[bot] Oct 1, 2025
ff17b7f
Update main docs for release 2.1.3 (#3990)
bjee19 Oct 1, 2025
d32ef5a
NFR Test Results for NGF version edge (#3991)
github-actions[bot] Oct 1, 2025
8f7b093
Fix cves for libcrpyto3 and libssl3 (#3993)
bjee19 Oct 1, 2025
9e6c265
Update main docs for release 2.1.4 (#3997)
bjee19 Oct 1, 2025
e5d7d7c
Update docker/dockerfile Docker tag to v1.19 (#4000)
renovate[bot] Oct 2, 2025
ea42305
Update module github.com/nginx/nginx-gateway-fabric/v2 to v2.1.4 (#3999)
renovate[bot] Oct 2, 2025
6fc41cb
Update dependency goreleaser/goreleaser to v2.12.5 (#3998)
renovate[bot] Oct 2, 2025
e3595a3
Add First Class OpenShift support (#4001)
ciarams87 Oct 6, 2025
8f5cd73
Update ghcr.io/nginx/dependencies/nginx-ubi:ubi9 Docker digest to 073…
renovate[bot] Oct 6, 2025
9fe55a0
Update dependency nginx/agent to v3.3.2 (#4014)
renovate[bot] Oct 6, 2025
d2080bd
Update actions/stale action to v10.1.0 (#4010)
renovate[bot] Oct 6, 2025
9a68574
Update github/codeql-action action to v3.30.6 (#4009)
renovate[bot] Oct 6, 2025
a3e9a4d
Update docker/dockerfile Docker tag to v1.19 (#4016)
renovate[bot] Oct 6, 2025
20d3910
Update module github.com/onsi/ginkgo/v2 to v2.26.0 (#4011)
renovate[bot] Oct 6, 2025
6e22e50
Add plus secrets for image building in tests (#4020)
ciarams87 Oct 6, 2025
7af7901
Add labels and license file to NGF UBI Dockerfile (#4021)
shaun-nx Oct 6, 2025
cb31ea4
[pre-commit.ci] pre-commit autoupdate (#4023)
pre-commit-ci[bot] Oct 6, 2025
f133cfb
Update operator controller name & add annotation (#4026)
ciarams87 Oct 7, 2025
36f83d7
Update module sigs.k8s.io/controller-runtime to v0.22.2 (#4027)
renovate[bot] Oct 7, 2025
b9969f9
Merge branch 'feature/tcproute-udproute'
Skcey Oct 7, 2025
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
14 changes: 14 additions & 0 deletions internal/controller/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,18 @@ func registerControllers(
controller.WithK8sPredicate(k8spredicate.GenerationChangedPredicate{}),
},
},
{
objectType: &gatewayv1alpha2.TCPRoute{},
options: []controller.Option{
controller.WithK8sPredicate(k8spredicate.GenerationChangedPredicate{}),
},
},
{
objectType: &gatewayv1alpha2.UDPRoute{},
options: []controller.Option{
controller.WithK8sPredicate(k8spredicate.GenerationChangedPredicate{}),
},
},
}
controllerRegCfgs = append(controllerRegCfgs, gwExpFeatures...)
}
Expand Down Expand Up @@ -754,6 +766,8 @@ func prepareFirstEventBatchPreparerArgs(cfg config.Config) ([]client.Object, []c
&gatewayv1alpha3.BackendTLSPolicyList{},
&apiv1.ConfigMapList{},
&gatewayv1alpha2.TLSRouteList{},
&gatewayv1alpha2.TCPRouteList{},
&gatewayv1alpha2.UDPRouteList{},
)
}

Expand Down
6 changes: 6 additions & 0 deletions internal/controller/nginx/config/stream/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ type Server struct {
RewriteClientIP shared.RewriteClientIPSettings
SSLPreread bool
IsSocket bool
Protocol string
UDPConfig *UDPConfig
}

type UDPConfig struct {
ProxyTimeout string
}

// Upstream holds all configuration for a stream upstream.
Expand Down
52 changes: 50 additions & 2 deletions internal/controller/nginx/config/stream_servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,24 @@ func (g GeneratorImpl) executeStreamServers(conf dataplane.Configuration) []exec
}

func createStreamServers(conf dataplane.Configuration) []stream.Server {
if len(conf.TLSPassthroughServers) == 0 {
totalServers := len(conf.TLSPassthroughServers) + len(conf.TCPServers) + len(conf.UDPServers)
if totalServers == 0 {
return nil
}

streamServers := make([]stream.Server, 0, len(conf.TLSPassthroughServers)*2)
streamServers := make([]stream.Server, 0, totalServers*2)
portSet := make(map[int32]struct{})
upstreams := make(map[string]dataplane.Upstream)

for _, u := range conf.StreamUpstreams {
upstreams[u.Name] = u
}
for _, u := range conf.TCPUpstreams {
upstreams[u.Name] = u
}
for _, u := range conf.UDPUpstreams {
upstreams[u.Name] = u
}

for _, server := range conf.TLSPassthroughServers {
if u, ok := upstreams[server.UpstreamName]; ok && server.UpstreamName != "" {
Expand Down Expand Up @@ -76,6 +83,47 @@ func createStreamServers(conf dataplane.Configuration) []stream.Server {
}
streamServers = append(streamServers, streamServer)
}

// Process TCP servers
for i, server := range conf.TCPServers {
if _, inPortSet := portSet[server.Port]; inPortSet {
continue // Skip if port already in use
}

if u, ok := upstreams[server.UpstreamName]; ok && server.UpstreamName != "" && len(u.Endpoints) > 0 {
streamServer := stream.Server{
Listen: fmt.Sprint(server.Port),
StatusZone: fmt.Sprintf("tcp_%d", server.Port),
ProxyPass: server.UpstreamName,
}
streamServers = append(streamServers, streamServer)
portSet[server.Port] = struct{}{}
} else {
fmt.Printf("DEBUG: createStreamServers - TCP Server %d: Skipped - upstream not found or no endpoints\n", i)
}
}

// Process UDP servers
for _, server := range conf.UDPServers {
if _, inPortSet := portSet[server.Port]; inPortSet {
continue // Skip if port already in use
}

if u, ok := upstreams[server.UpstreamName]; ok && server.UpstreamName != "" && len(u.Endpoints) > 0 {
streamServer := stream.Server{
Listen: fmt.Sprintf("%d udp", server.Port),
StatusZone: fmt.Sprintf("udp_%d", server.Port),
ProxyPass: server.UpstreamName,
Protocol: "udp",
UDPConfig: &stream.UDPConfig{
ProxyTimeout: "1s",
},
}
streamServers = append(streamServers, streamServer)
portSet[server.Port] = struct{}{}
}
}

return streamServers
}

Expand Down
4 changes: 4 additions & 0 deletions internal/controller/nginx/config/stream_servers_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ server {
{{- if $s.SSLPreread }}
ssl_preread on;
{{- end }}

{{- if and (eq $s.Protocol "udp") $s.UDPConfig }}
proxy_timeout {{ $s.UDPConfig.ProxyTimeout }};
{{- end }}
}
{{- end }}

Expand Down
8 changes: 7 additions & 1 deletion internal/controller/nginx/config/upstreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ func executeUpstreams(upstreams []http.Upstream) []executeResult {
}

func (g GeneratorImpl) executeStreamUpstreams(conf dataplane.Configuration) []executeResult {
upstreams := g.createStreamUpstreams(conf.StreamUpstreams)
// Combine all stream upstreams: TLS, TCP, and UDP
allUpstreams := make([]dataplane.Upstream, 0, len(conf.StreamUpstreams)+len(conf.TCPUpstreams)+len(conf.UDPUpstreams))
allUpstreams = append(allUpstreams, conf.StreamUpstreams...)
allUpstreams = append(allUpstreams, conf.TCPUpstreams...)
allUpstreams = append(allUpstreams, conf.UDPUpstreams...)

upstreams := g.createStreamUpstreams(allUpstreams)

result := executeResult{
dest: streamConfigFile,
Expand Down
42 changes: 29 additions & 13 deletions internal/controller/provisioner/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ const (
defaultInitialDelaySeconds = int32(3)
)

type PortInfo struct {
Port int32
Protocol corev1.Protocol
}

Comment on lines +47 to +51
Copy link
Contributor

@shaun-nx shaun-nx Aug 13, 2025

Choose a reason for hiding this comment

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

Just curious, why did you make this struct?
From the way this is being used, it feels like you can reference Protocol on its own.

For example, on line 144, we can define ports := make(map[int32]corev1.Protocol)
Line 155 then becomes ports[int32(listener.Port)] = protocol

Then the loop on line 473 becomes this

for port, protocol := range ports {
  servicePort := corev1.ServicePort{
	  Name:       fmt.Sprintf("port-%d", port),
	  Port:       port,
	  TargetPort: intstr.FromInt32(port),
	  Protocol:   protocol,

Would love to know what you think though. Do please tell me if I'm overlooking anything.

var emptyDirVolumeSource = corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}

func (p *NginxProvisioner) buildNginxResourceObjects(
Expand Down Expand Up @@ -136,9 +141,18 @@ func (p *NginxProvisioner) buildNginxResourceObjects(
openshiftObjs = p.buildOpenshiftObjects(objectMeta)
}

ports := make(map[int32]struct{})
ports := make(map[int32]PortInfo)
for _, listener := range gateway.Spec.Listeners {
ports[int32(listener.Port)] = struct{}{}
var protocol corev1.Protocol
switch listener.Protocol {
case gatewayv1.TCPProtocolType:
protocol = corev1.ProtocolTCP
case gatewayv1.UDPProtocolType:
protocol = corev1.ProtocolUDP
default:
protocol = corev1.ProtocolTCP
}
ports[int32(listener.Port)] = PortInfo{Port: int32(listener.Port), Protocol: protocol}
}

service, err := buildNginxService(objectMeta, nProxyCfg, ports, selectorLabels)
Expand Down Expand Up @@ -434,7 +448,7 @@ func (p *NginxProvisioner) buildOpenshiftObjects(objectMeta metav1.ObjectMeta) [
func buildNginxService(
objectMeta metav1.ObjectMeta,
nProxyCfg *graph.EffectiveNginxProxy,
ports map[int32]struct{},
ports map[int32]PortInfo,
selectorLabels map[string]string,
) (*corev1.Service, error) {
var serviceCfg ngfAPIv1alpha2.ServiceSpec
Expand All @@ -456,16 +470,17 @@ func buildNginxService(
}

servicePorts := make([]corev1.ServicePort, 0, len(ports))
for port := range ports {
for _, portInfo := range ports {
servicePort := corev1.ServicePort{
Name: fmt.Sprintf("port-%d", port),
Port: port,
TargetPort: intstr.FromInt32(port),
Name: fmt.Sprintf("port-%d", portInfo.Port),
Port: portInfo.Port,
TargetPort: intstr.FromInt32(portInfo.Port),
Protocol: portInfo.Protocol,
}

if serviceType != corev1.ServiceTypeClusterIP {
for _, nodePort := range serviceCfg.NodePorts {
if nodePort.ListenerPort == port {
if nodePort.ListenerPort == portInfo.Port {
servicePort.NodePort = nodePort.Port
}
}
Expand Down Expand Up @@ -533,7 +548,7 @@ func (p *NginxProvisioner) buildNginxDeployment(
nProxyCfg *graph.EffectiveNginxProxy,
ngxIncludesConfigMapName string,
ngxAgentConfigMapName string,
ports map[int32]struct{},
ports map[int32]PortInfo,
selectorLabels map[string]string,
agentTLSSecretName string,
dockerSecretNames map[string]string,
Expand Down Expand Up @@ -665,18 +680,19 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
nProxyCfg *graph.EffectiveNginxProxy,
ngxIncludesConfigMapName string,
ngxAgentConfigMapName string,
ports map[int32]struct{},
ports map[int32]PortInfo,
agentTLSSecretName string,
dockerSecretNames map[string]string,
jwtSecretName string,
caSecretName string,
clientSSLSecretName string,
) corev1.PodTemplateSpec {
containerPorts := make([]corev1.ContainerPort, 0, len(ports))
for port := range ports {
for _, portInfo := range ports {
containerPort := corev1.ContainerPort{
Name: fmt.Sprintf("port-%d", port),
ContainerPort: port,
Name: fmt.Sprintf("port-%d", portInfo.Port),
ContainerPort: portInfo.Port,
Protocol: portInfo.Protocol,
}
containerPorts = append(containerPorts, containerPort)
}
Expand Down
12 changes: 12 additions & 0 deletions internal/controller/state/change_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ func NewChangeProcessorImpl(cfg ChangeProcessorConfig) *ChangeProcessorImpl {
NginxProxies: make(map[types.NamespacedName]*ngfAPIv1alpha2.NginxProxy),
GRPCRoutes: make(map[types.NamespacedName]*v1.GRPCRoute),
TLSRoutes: make(map[types.NamespacedName]*v1alpha2.TLSRoute),
TCPRoutes: make(map[types.NamespacedName]*v1alpha2.TCPRoute),
UDPRoutes: make(map[types.NamespacedName]*v1alpha2.UDPRoute),
NGFPolicies: make(map[graph.PolicyKey]policies.Policy),
SnippetsFilters: make(map[types.NamespacedName]*ngfAPIv1alpha1.SnippetsFilter),
}
Expand Down Expand Up @@ -211,6 +213,16 @@ func NewChangeProcessorImpl(cfg ChangeProcessorConfig) *ChangeProcessorImpl {
store: newObjectStoreMapAdapter(clusterStore.TLSRoutes),
predicate: nil,
},
{
gvk: cfg.MustExtractGVK(&v1alpha2.TCPRoute{}),
store: newObjectStoreMapAdapter(clusterStore.TCPRoutes),
predicate: nil,
},
{
gvk: cfg.MustExtractGVK(&v1alpha2.UDPRoute{}),
store: newObjectStoreMapAdapter(clusterStore.UDPRoutes),
predicate: nil,
},
{
gvk: cfg.MustExtractGVK(&ngfAPIv1alpha1.SnippetsFilter{}),
store: newObjectStoreMapAdapter(clusterStore.SnippetsFilters),
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/state/change_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3776,7 +3776,7 @@ var _ = Describe("ChangeProcessor", func() {
},
Entry(
"an unsupported resource",
&v1alpha2.TCPRoute{ObjectMeta: metav1.ObjectMeta{Namespace: "test", Name: "tcp"}},
&apiv1.Pod{ObjectMeta: metav1.ObjectMeta{Namespace: "test", Name: "pod"}},
),
Entry(
"nil resource",
Expand All @@ -3794,8 +3794,8 @@ var _ = Describe("ChangeProcessor", func() {
},
Entry(
"an unsupported resource",
&v1alpha2.TCPRoute{},
types.NamespacedName{Namespace: "test", Name: "tcp"},
&apiv1.Pod{},
types.NamespacedName{Namespace: "test", Name: "pod"},
),
Entry(
"nil resource type",
Expand Down
Loading