Skip to content

Commit 004e31f

Browse files
authored
Merge pull request #48 from datum-cloud/gateway-api-upgrade
Update Gateway API to v1.3.0, target Envoy Gateway v1.5.0.
2 parents bb29ed3 + 7fb934b commit 004e31f

9 files changed

Lines changed: 694 additions & 129 deletions

File tree

Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ test-e2e: chainsaw
7979
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
8080
exit 1; \
8181
}
82+
$(KIND) get kubeconfig --name nso-standard > $(TMPDIR)/.kind-nso-standard.yaml
83+
$(KIND) get kubeconfig --name nso-infra > $(TMPDIR)/.kind-nso-infra.yaml
8284
$(CHAINSAW) test ./test/e2e \
8385
--cluster nso-standard=$(TMPDIR)/.kind-nso-standard.yaml \
8486
--cluster nso-infra=$(TMPDIR)/.kind-nso-infra.yaml
@@ -142,7 +144,10 @@ set-image-controller: manifests kustomize
142144
prepare-infra-cluster: cert-manager envoy-gateway external-dns
143145

144146
.PHONY: prepare-e2e
145-
prepare-e2e: chainsaw set-image-controller cert-manager envoy-gateway external-dns load-image-all deploy-e2e
147+
prepare-e2e: chainsaw set-image-controller cert-manager load-image-all deploy-e2e
148+
149+
.PHONY: prepare-dev
150+
prepare-dev: chainsaw set-image-controller cert-manager install
146151

147152
.PHONY: load-image-all
148153
load-image-all: load-image-operator
@@ -167,12 +172,10 @@ external-dns:
167172
.PHONY: kind-standard-cluster
168173
kind-standard-cluster: kind
169174
$(KIND) create cluster --config=config/tools/kind/standard-cluster.yaml
170-
$(KIND) get kubeconfig --name nso-standard > $(TMPDIR)/.kind-nso-standard.yaml
171175

172176
.PHONY: kind-infra-cluster
173177
kind-infra-cluster: kind
174178
$(KIND) create cluster --config=config/tools/kind/infra-cluster.yaml
175-
$(KIND) get kubeconfig --name nso-infra > $(TMPDIR)/.kind-nso-infra.yaml
176179

177180
##@ Deployment
178181

@@ -182,23 +185,23 @@ endif
182185

183186
.PHONY: install
184187
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
185-
$(KUSTOMIZE) build config/dev | $(KUBECTL) apply -f -
188+
$(KUSTOMIZE) build --enable-helm config/dev | $(KUBECTL) apply -f -
186189

187190
.PHONY: uninstall
188191
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
189-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
192+
$(KUSTOMIZE) build --enable-helm config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
190193

191194
.PHONY: deploy
192195
deploy: set-image-controller ## Deploy controller to the K8s cluster specified in ~/.kube/config.
193-
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
196+
$(KUSTOMIZE) build --enable-helm config/default | $(KUBECTL) apply -f -
194197

195198
.PHONY: deploy-e2e
196199
deploy-e2e: set-image-controller
197-
$(KUSTOMIZE) build config/e2e | $(KUBECTL) apply -f -
200+
$(KUSTOMIZE) build --enable-helm config/e2e | $(KUBECTL) apply -f -
198201

199202
.PHONY: undeploy
200203
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
201-
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
204+
$(KUSTOMIZE) build --enable-helm config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
202205

203206

204207

@@ -238,7 +241,7 @@ CRDOC_VERSION ?= v0.6.4
238241
KIND_VERSION ?= v0.27.0
239242

240243
# renovate: datasource=go depName=github.com/kyverno/chainsaw
241-
CHAINSAW_VERSION ?= v0.2.12
244+
CHAINSAW_VERSION ?= v0.2.13
242245

243246
# renovate: datasource=go depName=github.com/cert-manager/cmctl/v2
244247
CMCTL_VERSION ?= v2.1.1

config/crd/bases/networking.datumapis.com_httpproxies.yaml

Lines changed: 599 additions & 21 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,59 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
3-
resources:
4-
- github.com/kubernetes-sigs/gateway-api/config/crd/?ref=v1.2.1
3+
4+
helmCharts:
5+
- name: gateway-crds-helm
6+
repo: oci://docker.io/envoyproxy
7+
# IMPORTANT - When upgrading the helm chart, ensure there's no undesired CRDs
8+
# added in the new version. If there are, remove them in the patches below.
9+
version: v1.5.0
10+
releaseName: gateway
11+
namespace: kube-system
12+
valuesInline:
13+
crds:
14+
gatewayAPI:
15+
enabled: true
16+
channel: standard
17+
envoyGateway:
18+
enabled: true
519

620
patches:
7-
# Drop GRPCRoutes for now
21+
# Drop resources that shouldn't be added to upstream control planes yet
22+
# Gateway API resources
823
- patch: |
924
$patch: delete
1025
apiVersion: apiextensions.k8s.io/v1
1126
kind: CustomResourceDefinition
1227
metadata:
1328
name: grpcroutes.gateway.networking.k8s.io
14-
# Drop ReferenceGrants for now
1529
- patch: |
1630
$patch: delete
1731
apiVersion: apiextensions.k8s.io/v1
1832
kind: CustomResourceDefinition
1933
metadata:
2034
name: referencegrants.gateway.networking.k8s.io
35+
# Envoy gateway resources
36+
- patch: |
37+
$patch: delete
38+
apiVersion: apiextensions.k8s.io/v1
39+
kind: CustomResourceDefinition
40+
metadata:
41+
name: envoyextensionpolicies.gateway.envoyproxy.io
42+
- patch: |
43+
$patch: delete
44+
apiVersion: apiextensions.k8s.io/v1
45+
kind: CustomResourceDefinition
46+
metadata:
47+
name: envoypatchpolicies.gateway.envoyproxy.io
48+
- patch: |
49+
$patch: delete
50+
apiVersion: apiextensions.k8s.io/v1
51+
kind: CustomResourceDefinition
52+
metadata:
53+
name: envoyproxies.gateway.envoyproxy.io
54+
- patch: |
55+
$patch: delete
56+
apiVersion: apiextensions.k8s.io/v1
57+
kind: CustomResourceDefinition
58+
metadata:
59+
name: clienttrafficpolicies.gateway.envoyproxy.io

config/dev/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namePrefix: network-services-operator-
33

44
resources:
55
- ../crd
6+
- ../crd/gateway
67
- ../webhook
78
- ../certmanager
89

config/tools/envoy-gateway/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ helmCharts:
55
includeCRDs: true
66
namespace: envoy-gateway-system
77
releaseName: envoy-gateway
8-
version: v1.3.2
8+
version: v1.5.0
99
repo: oci://docker.io/envoyproxy

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ go 1.24.0
55
toolchain go1.24.2
66

77
require (
8+
github.com/go-logr/logr v1.4.3
89
github.com/google/go-cmp v0.7.0
10+
github.com/google/uuid v1.6.0
911
github.com/onsi/ginkgo/v2 v2.23.4
1012
github.com/stretchr/testify v1.10.0
1113
go.miloapis.com/milo v0.1.0
@@ -16,7 +18,7 @@ require (
1618
k8s.io/client-go v0.33.1
1719
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
1820
sigs.k8s.io/controller-runtime v0.21.0
19-
sigs.k8s.io/gateway-api v1.2.1
21+
sigs.k8s.io/gateway-api v1.3.0
2022
sigs.k8s.io/multicluster-runtime v0.21.0-alpha.8
2123
)
2224

@@ -34,7 +36,6 @@ require (
3436
github.com/felixge/httpsnoop v1.0.4 // indirect
3537
github.com/fsnotify/fsnotify v1.9.0 // indirect
3638
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
37-
github.com/go-logr/logr v1.4.3 // indirect
3839
github.com/go-logr/stdr v1.2.2 // indirect
3940
github.com/go-logr/zapr v1.3.0 // indirect
4041
github.com/go-openapi/jsonpointer v0.21.1 // indirect
@@ -46,7 +47,6 @@ require (
4647
github.com/google/cel-go v0.25.0 // indirect
4748
github.com/google/gnostic-models v0.6.9 // indirect
4849
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
49-
github.com/google/uuid v1.6.0 // indirect
5050
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
5151
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5252
github.com/josharian/intern v1.0.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUo
252252
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
253253
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
254254
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
255-
sigs.k8s.io/gateway-api v1.2.1 h1:fZZ/+RyRb+Y5tGkwxFKuYuSRQHu9dZtbjenblleOLHM=
256-
sigs.k8s.io/gateway-api v1.2.1/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0=
255+
sigs.k8s.io/gateway-api v1.3.0 h1:q6okN+/UKDATola4JY7zXzx40WO4VISk7i9DIfOvr9M=
256+
sigs.k8s.io/gateway-api v1.3.0/go.mod h1:d8NV8nJbaRbEKem+5IuxkL8gJGOZ+FJ+NvOIltV8gDk=
257257
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
258258
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
259259
sigs.k8s.io/multicluster-runtime v0.21.0-alpha.8 h1:Pq69tTKfN8ADw8m8A3wUtP8wJ9SPQbbOsgapm3BZEPw=

internal/validation/gateway_validation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func TestValidateGateway(t *testing.T) {
197197
Port: 80,
198198
},
199199
},
200-
Addresses: []gatewayv1.GatewayAddress{
200+
Addresses: []gatewayv1.GatewaySpecAddress{
201201
{
202202
Type: ptr.To(gatewayv1.IPAddressType),
203203
Value: "192.168.1.1",

test/e2e/gateway/chainsaw-test.yaml

Lines changed: 32 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -430,101 +430,45 @@ spec:
430430
status: "True"
431431
type: Programmed
432432
listeners:
433-
- attachedRoutes: 0
434-
conditions:
435-
- reason: Programmed
436-
status: "True"
437-
type: Programmed
438-
- reason: Accepted
439-
status: "True"
440-
type: Accepted
441-
- reason: ResolvedRefs
442-
status: "True"
443-
type: ResolvedRefs
433+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
434+
- status: "True"
435+
- status: "True"
436+
- status: "True"
444437
name: http-test-e2e
445-
- attachedRoutes: 0
446-
conditions:
447-
- reason: Programmed
448-
status: "True"
449-
type: Programmed
450-
- reason: Accepted
451-
status: "True"
452-
type: Accepted
453-
- reason: ResolvedRefs
454-
status: "True"
455-
type: ResolvedRefs
438+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
439+
- status: "True"
440+
- status: "True"
441+
- status: "True"
456442
name: https-test-e2e
457-
- attachedRoutes: 0
458-
conditions:
459-
- reason: Programmed
460-
status: "True"
461-
type: Programmed
462-
- reason: Accepted
463-
status: "True"
464-
type: Accepted
465-
- reason: ResolvedRefs
466-
status: "True"
467-
type: ResolvedRefs
443+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
444+
- status: "True"
445+
- status: "True"
446+
- status: "True"
468447
name: http-0
469-
- attachedRoutes: 0
470-
conditions:
471-
- reason: Programmed
472-
status: "True"
473-
type: Programmed
474-
- reason: Accepted
475-
status: "True"
476-
type: Accepted
477-
- reason: ResolvedRefs
478-
status: "True"
479-
type: ResolvedRefs
448+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
449+
- status: "True"
450+
- status: "True"
451+
- status: "True"
480452
name: https-0
481-
- attachedRoutes: 0
482-
conditions:
483-
- reason: Programmed
484-
status: "True"
485-
type: Programmed
486-
- reason: Accepted
487-
status: "True"
488-
type: Accepted
489-
- reason: ResolvedRefs
490-
status: "True"
491-
type: ResolvedRefs
453+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
454+
- status: "True"
455+
- status: "True"
456+
- status: "True"
492457
name: http-1
493-
- attachedRoutes: 0
494-
conditions:
495-
- reason: Programmed
496-
status: "True"
497-
type: Programmed
498-
- reason: Accepted
499-
status: "True"
500-
type: Accepted
501-
- reason: ResolvedRefs
502-
status: "True"
503-
type: ResolvedRefs
458+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
459+
- status: "True"
460+
- status: "True"
461+
- status: "True"
504462
name: https-1
505-
- attachedRoutes: 0
506-
conditions:
507-
- reason: Programmed
508-
status: "True"
509-
type: Programmed
510-
- reason: Accepted
511-
status: "True"
512-
type: Accepted
513-
- reason: ResolvedRefs
514-
status: "True"
515-
type: ResolvedRefs
463+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
464+
- status: "True"
465+
- status: "True"
466+
- status: "True"
516467
name: http-2
517-
- attachedRoutes: 0
518-
conditions:
519-
- reason: Programmed
520-
status: "True"
521-
type: Programmed
522-
- reason: Accepted
523-
status: "True"
524-
type: Accepted
525-
- reason: ResolvedRefs
526-
status: "True"
527-
type: ResolvedRefs
468+
- (conditions[?contains(['Programmed', 'Accepted', 'ResolvedRefs'], type)]):
469+
- status: "True"
470+
- status: "True"
471+
- status: "True"
528472
name: https-2
529473

530474
# Load the downstream gateway so we can get the IP address info from its

0 commit comments

Comments
 (0)