Skip to content

Commit 745d735

Browse files
committed
GRPCRoute Support
1 parent 1157c45 commit 745d735

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+4707
-2217
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ TELEMETRY_ENDPOINT_INSECURE = false
1717

1818
GW_API_VERSION = 1.0.0
1919
INSTALL_WEBHOOK = false
20+
ENABLE_EXPERIMENTAL = false
2021
NODE_VERSION = $(shell cat .nvmrc)
2122

2223
# go build flags - should not be overridden by the user
@@ -193,13 +194,13 @@ install-ngf-local-build-with-plus: build-images-with-plus load-images-with-plus
193194

194195
.PHONY: helm-install-local
195196
helm-install-local: ## Helm install NGF on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build.
196-
./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(INSTALL_WEBHOOK)
197-
helm install dev ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never -n nginx-gateway
197+
./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(INSTALL_WEBHOOK) $(ENABLE_EXPERIMENTAL)
198+
helm install dev ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway
198199

199200
.PHONY: helm-install-local-with-plus
200201
helm-install-local-with-plus: ## Helm install NGF with NGINX Plus on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build-with-plus.
201-
./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(INSTALL_WEBHOOK)
202-
helm install dev ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginx.plus=true -n nginx-gateway
202+
./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(INSTALL_WEBHOOK) $(ENABLE_EXPERIMENTAL)
203+
helm install dev ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginx.plus=true --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) -n nginx-gateway
203204

204205
# Debug Targets
205206
.PHONY: debug-build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
NGINX Gateway Fabric is an open-source project that provides an implementation of
1313
the [Gateway API](https://gateway-api.sigs.k8s.io/) using [NGINX](https://nginx.org/) as the data plane. The goal of
14-
this project is to implement the core Gateway APIs -- `Gateway`, `GatewayClass`, `HTTPRoute`, `TCPRoute`, `TLSRoute`,
14+
this project is to implement the core Gateway APIs -- `Gateway`, `GatewayClass`, `HTTPRoute`, `GRPCRoute`, `TCPRoute`, `TLSRoute`,
1515
and `UDPRoute` -- to configure an HTTP or TCP/UDP load balancer, reverse-proxy, or API gateway for applications running
1616
on Kubernetes. NGINX Gateway Fabric supports a subset of the Gateway API.
1717

conformance/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ INSTALL_WEBHOOK ?= false
1818
ENABLE_EXPERIMENTAL ?= false
1919
.DEFAULT_GOAL := help
2020

21+
ifeq ($(ENABLE_EXPERIMENTAL),true)
22+
SUPPORTED_FEATURES +=,GRPCExactMethodMatching,GRPCRouteListenerHostnameMatching
23+
endif
24+
2125
.PHONY: help
2226
help: Makefile ## Display this help
2327
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n\n make \033[36m<target>\033[0m\n\nTargets:\n\n"}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'

deploy/helm-chart/templates/rbac.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ rules:
9292
- referencegrants
9393
{{- if .Values.nginxGateway.gwAPIExperimentalFeatures.enable }}
9494
- backendtlspolicies
95+
- grpcroutes
9596
{{- end }}
9697
verbs:
9798
- list
@@ -104,6 +105,7 @@ rules:
104105
- gatewayclasses/status
105106
{{- if .Values.nginxGateway.gwAPIExperimentalFeatures.enable }}
106107
- backendtlspolicies/status
108+
- grpcroutes/status
107109
{{- end }}
108110
verbs:
109111
- update

deploy/manifests/nginx-gateway-experimental.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ rules:
7777
- httproutes
7878
- referencegrants
7979
- backendtlspolicies
80+
- grpcroutes
8081
verbs:
8182
- list
8283
- watch
@@ -87,6 +88,7 @@ rules:
8788
- gateways/status
8889
- gatewayclasses/status
8990
- backendtlspolicies/status
91+
- grpcroutes/status
9092
verbs:
9193
- update
9294
- apiGroups:

deploy/manifests/nginx-plus-gateway-experimental.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ rules:
8383
- httproutes
8484
- referencegrants
8585
- backendtlspolicies
86+
- grpcroutes
8687
verbs:
8788
- list
8889
- watch
@@ -93,6 +94,7 @@ rules:
9394
- gateways/status
9495
- gatewayclasses/status
9596
- backendtlspolicies/status
97+
- grpcroutes/status
9698
verbs:
9799
- update
98100
- apiGroups:

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ require (
3838
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
3939
github.com/cespare/xxhash/v2 v2.2.0 // indirect
4040
github.com/davecgh/go-spew v1.1.1 // indirect
41-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
41+
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
4242
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
4343
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
4444
github.com/fatih/color v1.16.0 // indirect
4545
github.com/fsnotify/fsnotify v1.7.0 // indirect
4646
github.com/go-logfmt/logfmt v0.5.1 // indirect
4747
github.com/go-logr/stdr v1.2.2 // indirect
4848
github.com/go-logr/zapr v1.3.0 // indirect
49-
github.com/go-openapi/jsonpointer v0.20.0 // indirect
50-
github.com/go-openapi/jsonreference v0.20.2 // indirect
51-
github.com/go-openapi/swag v0.22.4 // indirect
49+
github.com/go-openapi/jsonpointer v0.20.2 // indirect
50+
github.com/go-openapi/jsonreference v0.20.4 // indirect
51+
github.com/go-openapi/swag v0.22.7 // indirect
5252
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
5353
github.com/gobuffalo/flect v1.0.2 // indirect
5454
github.com/gogo/protobuf v1.3.2 // indirect
@@ -58,7 +58,7 @@ require (
5858
github.com/google/gofuzz v1.2.0 // indirect
5959
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
6060
github.com/google/uuid v1.6.0 // indirect
61-
github.com/gorilla/websocket v1.5.0 // indirect
61+
github.com/gorilla/websocket v1.5.1 // indirect
6262
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
6363
github.com/imdario/mergo v0.3.16 // indirect
6464
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -93,7 +93,7 @@ require (
9393
golang.org/x/sys v0.18.0 // indirect
9494
golang.org/x/term v0.18.0 // indirect
9595
golang.org/x/text v0.14.0 // indirect
96-
golang.org/x/time v0.3.0 // indirect
96+
golang.org/x/time v0.5.0 // indirect
9797
golang.org/x/tools v0.19.0 // indirect
9898
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
9999
google.golang.org/appengine v1.6.8 // indirect

go.sum

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4M
1212
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
1313
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
1414
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
15-
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1615
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1716
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1817
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1918
github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654 h1:XOPLOMn/zT4jIgxfxSsoXPxkrzz0FaCHwp33x5POJ+Q=
2019
github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654/go.mod h1:qm+vckxRlDt0aOla0RYJJVeqHZlWfOm2UIxHaqPB46E=
21-
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
22-
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
20+
github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU=
21+
github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
2322
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
2423
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
2524
github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro=
@@ -33,21 +32,18 @@ github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBj
3332
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
3433
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
3534
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
36-
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
3735
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
3836
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
3937
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
4038
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
4139
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
4240
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
43-
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
44-
github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ=
45-
github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA=
46-
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
47-
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
48-
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
49-
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
50-
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
41+
github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
42+
github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
43+
github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU=
44+
github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4=
45+
github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8=
46+
github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0=
5147
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
5248
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
5349
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
@@ -75,8 +71,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe
7571
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
7672
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
7773
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
78-
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
79-
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
74+
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
75+
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
8076
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
8177
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
8278
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -92,11 +88,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
9288
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
9389
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
9490
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
95-
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
9691
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
9792
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
98-
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
99-
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
10093
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
10194
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
10295
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
@@ -145,8 +138,8 @@ github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+a
145138
github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U=
146139
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
147140
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
148-
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
149-
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
141+
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
142+
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
150143
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 h1:Lt9DzQALzHoDwMBGJ6v8ObDPR0dzr2a6sXTB1Fq7IHs=
151144
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA=
152145
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -243,8 +236,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
243236
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
244237
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
245238
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
246-
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
247-
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
239+
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
240+
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
248241
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
249242
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
250243
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=

internal/framework/gatewayclass/validate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var gatewayCRDs = map[string]apiVersion{
2222
"httproutes.gateway.networking.k8s.io": {},
2323
"referencegrants.gateway.networking.k8s.io": {},
2424
"backendtlspolicies.gateway.networking.k8s.io": {},
25+
"grpcroutes.gateway.networking.k8s.io": {},
2526
}
2627

2728
type apiVersion struct {

internal/mode/static/handler.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,23 @@ func (h *eventHandlerImpl) updateStatuses(ctx context.Context, logger logr.Logge
245245
if h.cfg.updateGatewayClassStatus {
246246
gcReqs = status.PrepareGatewayClassRequests(graph.GatewayClass, graph.IgnoredGatewayClasses, transitionTime)
247247
}
248-
routeReqs := status.PrepareRouteRequests(graph.Routes, transitionTime, h.latestReloadResult, h.cfg.gatewayCtlrName)
248+
hrReqs := status.PrepareHTTPRouteRequests(
249+
graph.HTTPRoutes,
250+
transitionTime,
251+
h.latestReloadResult,
252+
h.cfg.gatewayCtlrName,
253+
)
254+
grReqs := status.PrepareGRPCRouteRequests(
255+
graph.GRPCRoutes, transitionTime,
256+
h.latestReloadResult,
257+
h.cfg.gatewayCtlrName,
258+
)
249259
polReqs := status.PrepareBackendTLSPolicyRequests(graph.BackendTLSPolicies, transitionTime, h.cfg.gatewayCtlrName)
250260

251-
reqs := make([]frameworkStatus.UpdateRequest, 0, len(gcReqs)+len(routeReqs)+len(polReqs))
261+
reqs := make([]frameworkStatus.UpdateRequest, 0, len(gcReqs)+len(hrReqs)+len(grReqs)+len(polReqs))
252262
reqs = append(reqs, gcReqs...)
253-
reqs = append(reqs, routeReqs...)
263+
reqs = append(reqs, hrReqs...)
264+
reqs = append(reqs, grReqs...)
254265
reqs = append(reqs, polReqs...)
255266

256267
h.cfg.statusUpdater.UpdateGroup(ctx, groupAllExceptGateways, reqs...)

internal/mode/static/manager.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func registerControllers(
417417
}
418418

419419
if cfg.ExperimentalFeatures {
420-
backendTLSObjs := []ctlrCfg{
420+
gwExpFeatures := []ctlrCfg{
421421
{
422422
objectType: &gatewayv1alpha2.BackendTLSPolicy{},
423423
options: []controller.Option{
@@ -429,8 +429,14 @@ func registerControllers(
429429
// https://github.com/nginxinc/nginx-gateway-fabric/issues/1545
430430
objectType: &apiv1.ConfigMap{},
431431
},
432+
{
433+
objectType: &gatewayv1alpha2.GRPCRoute{},
434+
options: []controller.Option{
435+
controller.WithK8sPredicate(k8spredicate.GenerationChangedPredicate{}),
436+
},
437+
},
432438
}
433-
controllerRegCfgs = append(controllerRegCfgs, backendTLSObjs...)
439+
controllerRegCfgs = append(controllerRegCfgs, gwExpFeatures...)
434440
}
435441

436442
if cfg.ConfigName != "" {
@@ -596,7 +602,12 @@ func prepareFirstEventBatchPreparerArgs(
596602
}
597603

598604
if enableExperimentalFeatures {
599-
objectLists = append(objectLists, &gatewayv1alpha2.BackendTLSPolicyList{}, &apiv1.ConfigMapList{})
605+
objectLists = append(
606+
objectLists,
607+
&gatewayv1alpha2.BackendTLSPolicyList{},
608+
&apiv1.ConfigMapList{},
609+
&gatewayv1alpha2.GRPCRouteList{},
610+
)
600611
}
601612

602613
if gwNsName == nil {

internal/mode/static/manager_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func TestPrepareFirstEventBatchPreparerArgs(t *testing.T) {
9595
&gatewayv1beta1.ReferenceGrantList{},
9696
partialObjectMetadataList,
9797
&gatewayv1alpha2.BackendTLSPolicyList{},
98+
&gatewayv1alpha2.GRPCRouteList{},
9899
},
99100
experimentalEnabled: true,
100101
},

internal/mode/static/nginx/conf/nginx-plus.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ http {
2626
sendfile on;
2727
tcp_nopush on;
2828

29+
http2 on;
30+
2931
server {
3032
listen 127.0.0.1:8765;
3133
root /usr/share/nginx/html;

internal/mode/static/nginx/conf/nginx.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ http {
2626
sendfile on;
2727
tcp_nopush on;
2828

29+
http2 on;
30+
2931
server {
3032
listen unix:/var/run/nginx/nginx-status.sock;
3133
access_log off;

internal/mode/static/nginx/config/http/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type Server struct {
77
Locations []Location
88
IsDefaultHTTP bool
99
IsDefaultSSL bool
10+
HTTP2 bool
1011
Port int32
1112
}
1213

@@ -19,9 +20,10 @@ type Location struct {
1920
HTTPMatchVar string
2021
Rewrites []string
2122
ProxySetHeaders []Header
23+
IsGRPC bool
2224
}
2325

24-
// Header defines a HTTP header to be passed to the proxied server.
26+
// Header defines an HTTP header to be passed to the proxied server.
2527
type Header struct {
2628
Name string
2729
Value string

0 commit comments

Comments
 (0)