Skip to content

Commit c420eaa

Browse files
authored
Upgrade Gateway API to v1.1.0 (#1975)
* Upgrade Gateway API to v1.1.0
1 parent aa16231 commit c420eaa

File tree

68 files changed

+613
-713
lines changed

Some content is hidden

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

68 files changed

+613
-713
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ jobs:
303303
make create-kind-cluster KIND_KUBE_CONFIG=${kube_config}
304304
echo "KUBECONFIG=${kube_config}" >> "$GITHUB_ENV"
305305
kind load docker-image ghcr.io/nginxinc/nginx-gateway-fabric:${{ steps.ngf-meta.outputs.version }} ghcr.io/nginxinc/nginx-gateway-fabric/nginx:${{ steps.nginx-meta.outputs.version }}
306-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
306+
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
307307
308308
- name: Install Chart
309309
run: >

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ TELEMETRY_REPORT_PERIOD = 24h
1515
TELEMETRY_ENDPOINT=# if empty, NGF will report telemetry in its logs at debug level.
1616
TELEMETRY_ENDPOINT_INSECURE = false
1717

18-
GW_API_VERSION = 1.0.0
18+
GW_API_VERSION = 1.1.0
1919
ENABLE_EXPERIMENTAL = false
2020
NODE_VERSION = $(shell cat .nvmrc)
2121

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The following table lists the software versions NGINX Gateway Fabric supports.
6666

6767
| NGINX Gateway Fabric | Gateway API | Kubernetes | NGINX OSS | NGINX Plus |
6868
| -------------------- | ----------- | ---------- | --------- | ---------- |
69-
| Edge | 1.0.0 | 1.25+ | 1.25.5 | R31 |
69+
| Edge | 1.1.0 | 1.25+ | 1.25.5 | R31 |
7070
| 1.2.0 | 1.0.0 | 1.23+ | 1.25.4 | R31 |
7171
| 1.1.0 | 1.0.0 | 1.23+ | 1.25.3 | n/a |
7272
| 1.0.0 | 0.8.1 | 1.23+ | 1.25.2 | n/a |

apis/v1alpha1/clientsettingspolicy_types.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ type ClientSettingsPolicyList struct {
3636

3737
// ClientSettingsPolicySpec defines the desired state of ClientSettingsPolicy.
3838
type ClientSettingsPolicySpec struct {
39-
// TargetRef identifies an API object to apply the policy to.
40-
// Object must be in the same namespace as the policy.
41-
//
42-
// Support: Gateway, HTTPRoute
43-
TargetRef gatewayv1alpha2.PolicyTargetReference `json:"targetRef"`
44-
4539
// Body defines the client request body settings.
4640
//
4741
// +optional
@@ -51,6 +45,12 @@ type ClientSettingsPolicySpec struct {
5145
//
5246
// +optional
5347
KeepAlive *ClientKeepAlive `json:"keepAlive,omitempty"`
48+
49+
// TargetRef identifies an API object to apply the policy to.
50+
// Object must be in the same namespace as the policy.
51+
//
52+
// Support: Gateway, HTTPRoute
53+
TargetRef gatewayv1alpha2.LocalPolicyTargetReference `json:"targetRef"`
5454
}
5555

5656
// ClientBody contains the settings for the client request body.

apis/v1alpha1/observabilitypolicy_types.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ type ObservabilityPolicyList struct {
3737

3838
// ObservabilityPolicySpec defines the desired state of the ObservabilityPolicy.
3939
type ObservabilityPolicySpec struct {
40-
// TargetRef identifies an API object to apply the policy to.
41-
// Object must be in the same namespace as the policy.
42-
//
43-
// Support: HTTPRoute
44-
TargetRef gatewayv1alpha2.PolicyTargetReference `json:"targetRef"`
45-
4640
// Tracing allows for enabling and configuring tracing.
4741
//
4842
// +optional
4943
Tracing *Tracing `json:"tracing,omitempty"`
44+
45+
// TargetRef identifies an API object to apply the policy to.
46+
// Object must be in the same namespace as the policy.
47+
//
48+
// Support: HTTPRoute
49+
TargetRef gatewayv1alpha2.LocalPolicyTargetReference `json:"targetRef"`
5050
}
5151

5252
// Tracing allows for enabling and configuring OpenTelemetry tracing.

apis/v1alpha1/zz_generated.deepcopy.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/nginx-gateway-fabric/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This chart deploys the NGINX Gateway Fabric in your Kubernetes cluster.
4040
> [see the Technical Specifications](https://github.com/nginxinc/nginx-gateway-fabric/blob/main/README.md#technical-specifications).
4141
4242
```shell
43-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
43+
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
4444
```
4545

4646
## Installing the Chart
@@ -128,7 +128,7 @@ Gateway Fabric - [see the Technical Specifications](../../README.md#technical-sp
128128
To upgrade the Gateway CRDs from [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:
129129

130130
```shell
131-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
131+
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
132132
```
133133

134134
### Upgrading the CRDs
@@ -238,7 +238,7 @@ These commands remove all the Kubernetes components associated with the release
238238
To delete the Gateway API CRDs from [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:
239239

240240
```shell
241-
kubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
241+
kubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
242242
```
243243

244244
## Configuration

charts/nginx-gateway-fabric/templates/rbac.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ rules:
9090
- gateways
9191
- httproutes
9292
- referencegrants
93+
- grpcroutes
9394
{{- if .Values.nginxGateway.gwAPIExperimentalFeatures.enable }}
9495
- backendtlspolicies
95-
- grpcroutes
9696
{{- end }}
9797
verbs:
9898
- list
@@ -103,9 +103,9 @@ rules:
103103
- httproutes/status
104104
- gateways/status
105105
- gatewayclasses/status
106+
- grpcroutes/status
106107
{{- if .Values.nginxGateway.gwAPIExperimentalFeatures.enable }}
107108
- backendtlspolicies/status
108-
- grpcroutes/status
109109
{{- end }}
110110
verbs:
111111
- update

cmd/gateway/validation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
const (
1717
// nolint:lll
18-
// Regex from: https://github.com/kubernetes-sigs/gateway-api/blob/v1.0.0/apis/v1/shared_types.go#L640
18+
// Regex from: https://github.com/kubernetes-sigs/gateway-api/blob/v1.1.0/apis/v1/shared_types.go#L647
1919
controllerNameRegex = `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` //nolint:lll
2020
)
2121

config/crd/bases/gateway.nginx.org_clientsettingspolicies.yaml

+4-19
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,6 @@ spec:
133133
maxLength: 253
134134
minLength: 1
135135
type: string
136-
namespace:
137-
description: |-
138-
Namespace is the namespace of the referent. When unspecified, the local
139-
namespace is inferred. Even when policy targets a resource in a different
140-
namespace, it MUST only apply to traffic originating from the same
141-
namespace as the policy.
142-
maxLength: 63
143-
minLength: 1
144-
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
145-
type: string
146136
required:
147137
- group
148138
- kind
@@ -257,7 +247,7 @@ spec:
257247
258248
259249
* Gateway (Gateway conformance profile)
260-
* Service (Mesh conformance profile, experimental, ClusterIP Services only)
250+
* Service (Mesh conformance profile, ClusterIP Services only)
261251
262252
263253
Support for other resources is Implementation-Specific.
@@ -343,9 +333,6 @@ spec:
343333
344334
345335
Support: Extended
346-
347-
348-
<gateway:experimental>
349336
format: int32
350337
maximum: 65535
351338
minimum: 1
@@ -356,14 +343,12 @@ spec:
356343
following resources, SectionName is interpreted as the following:
357344
358345
359-
* Gateway: Listener Name. When both Port (experimental) and SectionName
346+
* Gateway: Listener name. When both Port (experimental) and SectionName
360347
are specified, the name and port of the selected listener must match
361348
both specified values.
362-
* Service: Port Name. When both Port (experimental) and SectionName
349+
* Service: Port name. When both Port (experimental) and SectionName
363350
are specified, the name and port of the selected listener must match
364-
both specified values. Note that attaching Routes to Services as Parents
365-
is part of experimental Mesh support and is not supported for any other
366-
purpose.
351+
both specified values.
367352
368353
369354
Implementations MAY choose to support attaching Routes to other resources.

config/crd/bases/gateway.nginx.org_observabilitypolicies.yaml

+4-19
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ spec:
7474
maxLength: 253
7575
minLength: 1
7676
type: string
77-
namespace:
78-
description: |-
79-
Namespace is the namespace of the referent. When unspecified, the local
80-
namespace is inferred. Even when policy targets a resource in a different
81-
namespace, it MUST only apply to traffic originating from the same
82-
namespace as the policy.
83-
maxLength: 63
84-
minLength: 1
85-
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
86-
type: string
8777
required:
8878
- group
8979
- kind
@@ -273,7 +263,7 @@ spec:
273263
274264
275265
* Gateway (Gateway conformance profile)
276-
* Service (Mesh conformance profile, experimental, ClusterIP Services only)
266+
* Service (Mesh conformance profile, ClusterIP Services only)
277267
278268
279269
Support for other resources is Implementation-Specific.
@@ -359,9 +349,6 @@ spec:
359349
360350
361351
Support: Extended
362-
363-
364-
<gateway:experimental>
365352
format: int32
366353
maximum: 65535
367354
minimum: 1
@@ -372,14 +359,12 @@ spec:
372359
following resources, SectionName is interpreted as the following:
373360
374361
375-
* Gateway: Listener Name. When both Port (experimental) and SectionName
362+
* Gateway: Listener name. When both Port (experimental) and SectionName
376363
are specified, the name and port of the selected listener must match
377364
both specified values.
378-
* Service: Port Name. When both Port (experimental) and SectionName
365+
* Service: Port name. When both Port (experimental) and SectionName
379366
are specified, the name and port of the selected listener must match
380-
both specified values. Note that attaching Routes to Services as Parents
381-
is part of experimental Mesh support and is not supported for any other
382-
purpose.
367+
both specified values.
383368
384369
385370
Implementations MAY choose to support attaching Routes to other resources.

conformance/Makefile

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ VERSION = 1.2.0 # NGF version
33
PREFIX = nginx-gateway-fabric
44
NGINX_PREFIX = $(PREFIX)/nginx
55
NGINX_PLUS_PREFIX ?= $(PREFIX)/nginx-plus
6-
GW_API_VERSION ?= 1.0.0
6+
GW_API_VERSION ?= 1.1.0
77
GATEWAY_CLASS = nginx
8-
SUPPORTED_FEATURES = HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteSchemeRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,GatewayPort8080,HTTPRouteResponseHeaderModification
8+
SUPPORTED_FEATURES = HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteSchemeRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,GatewayPort8080,HTTPRouteResponseHeaderModification,GRPCExactMethodMatching,GRPCRouteListenerHostnameMatching,GRPCRouteHeaderMatching
99
KIND_IMAGE ?= $(shell grep -m1 'FROM kindest/node' <tests/Dockerfile | awk -F'[ ]' '{print $$2}')
1010
KIND_KUBE_CONFIG=$${HOME}/.kube/kind/config
1111
CONFORMANCE_TAG = latest
@@ -16,10 +16,6 @@ PROVISIONER_MANIFEST=provisioner/provisioner.yaml
1616
ENABLE_EXPERIMENTAL ?= false
1717
.DEFAULT_GOAL := help
1818

19-
ifeq ($(ENABLE_EXPERIMENTAL),true)
20-
SUPPORTED_FEATURES +=,GRPCExactMethodMatching,GRPCRouteListenerHostnameMatching,GRPCRouteHeaderMatching
21-
endif
22-
2319
.PHONY: help
2420
help: Makefile ## Display this help
2521
@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}'
@@ -108,8 +104,14 @@ run-conformance-tests: ## Run conformance tests
108104
bash scripts/check-pod-exit-code.sh
109105
sed -e '1,/CONFORMANCE PROFILE/d' output.txt > conformance-profile.yaml
110106
rm output.txt
111-
[ $(shell cat conformance-profile.yaml | yq '.profiles[0].core.result') != "failure" ] \
112-
&& [ $(shell cat conformance-profile.yaml | yq '.profiles[0].extended.result') != "failure" ] || exit 2
107+
grpc_core_result=`yq '.profiles[0].core.result' conformance-profile.yaml`; \
108+
http_core_result=`yq '.profiles[1].core.result' conformance-profile.yaml`; \
109+
http_extended_result=`yq '.profiles[1].extended.result' conformance-profile.yaml`; \
110+
if [ "$$grpc_core_result" != "failure" ] && [ "$$http_core_result" != "failure" ] && [ "$$http_extended_result" != "failure" ] ; then \
111+
exit 0; \
112+
else \
113+
exit 2; \
114+
fi
113115

114116
.PHONY: cleanup-conformance-tests
115117
cleanup-conformance-tests: ## Clean up conformance tests fixtures

conformance/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ update-ngf-manifest Update the NGF deployment manifest image na
5050
| CONFORMANCE_PREFIX | conformance-test-runner | The prefix for the conformance test image |
5151
| TAG | edge | The tag for the locally built NGF image |
5252
| PREFIX | nginx-gateway-fabric | The prefix for the locally built NGF image |
53-
| GW_API_VERSION | 1.0.0 | Tag for the Gateway API version to check out. Set to `main` to get the latest version |
53+
| GW_API_VERSION | 1.1.0 | Tag for the Gateway API version to check out. Set to `main` to get the latest version |
5454
| KIND_IMAGE | Latest kind image, as defined in the tests/Dockerfile | The kind image to use |
5555
| KIND_KUBE_CONFIG | ~/.kube/kind/config | The location of the kubeconfig |
5656
| GATEWAY_CLASS | nginx | The gateway class that should be used for the tests |

conformance/tests/conformance-rbac.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ rules:
1111
- apiGroups:
1212
- ""
1313
resources:
14+
- configmaps
1415
- namespaces
1516
- pods
1617
- secrets
@@ -35,6 +36,7 @@ rules:
3536
resources:
3637
- gateways
3738
- httproutes
39+
- grpcroutes
3840
- referencegrants
3941
- gatewayclasses
4042
verbs:
@@ -43,6 +45,22 @@ rules:
4345
- get
4446
- list
4547
- patch
48+
- apiGroups:
49+
- apiextensions.k8s.io
50+
resources:
51+
- customresourcedefinitions
52+
verbs:
53+
- list
54+
- apiGroups:
55+
- discovery.k8s.io
56+
resources:
57+
- endpointslices
58+
verbs:
59+
- create
60+
- delete
61+
- get
62+
- list
63+
- patch
4664
---
4765
kind: ClusterRoleBinding
4866
apiVersion: rbac.authorization.k8s.io/v1

0 commit comments

Comments
 (0)