Skip to content

Commit eff0912

Browse files
committed
Update gateway-api from v1alpha2 to v1beta1
1 parent 747d58e commit eff0912

Some content is hidden

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

45 files changed

+703
-706
lines changed

deploy/manifests/gatewayclass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: GatewayClass
33
metadata:
44
name: nginx

design/archive/gateway-evaluation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The Gateway evaluation will employ each in the following manner:
3333

3434
Gateway evaluation requires supplemental resources; other Core API resources are needed to complete traffic routing between an ingress point and the final backend Pod endpoints. Required supplemental resources are:
3535
* Services: The AppDev controls the resource lifecycle and is responsible for creating, updating, and deleting Service resources. Kubernetes Service resources describe a logical collection of like processes and act as a load balancing primitive. AppDevs create Service resources to describe their product subsystems, Services act as an abstraction for a set of real backend processes that can serve requests.
36-
* Endpoints: Kubernetes controllers manage Endpoint resources, Endpoints provide the association between Service abstractions and real servers. Gateway evaluation will watch Endpoints to discover upstream addresses. When AppDevs create Service and HTTPRoute objects, Gateway evaluation uses references in the HTTPRoute (via a HTTPRouteRules and HTTPBackendRefs (see [HTTP Routing](https://gateway-api.sigs.k8s.io/v1alpha2/guides/http-routing/) for more detail)) to discover the Pod IP endpoints, i.e. Gateway evaluation uses Endpoints resources, referred to by HTTPRoutes, to link routing rules to upstream addresses.
36+
* Endpoints: Kubernetes controllers manage Endpoint resources, Endpoints provide the association between Service abstractions and real servers. Gateway evaluation will watch Endpoints to discover upstream addresses. When AppDevs create Service and HTTPRoute objects, Gateway evaluation uses references in the HTTPRoute (via a HTTPRouteRules and HTTPBackendRefs (see [HTTP Routing](https://gateway-api.sigs.k8s.io/guides/http-routing/) for more detail)) to discover the Pod IP endpoints, i.e. Gateway evaluation uses Endpoints resources, referred to by HTTPRoutes, to link routing rules to upstream addresses.
3737

3838
### Goals
3939
- Vet a minimal feature set of Core resources for their applicability and conformance to NGINX configuration models.

examples/advanced-routing/cafe-routes.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: HTTPRoute
33
metadata:
44
name: coffee
@@ -33,7 +33,7 @@ spec:
3333
- name: coffee-v2-svc
3434
port: 80
3535
---
36-
apiVersion: gateway.networking.k8s.io/v1alpha2
36+
apiVersion: gateway.networking.k8s.io/v1beta1
3737
kind: HTTPRoute
3838
metadata:
3939
name: tea

examples/advanced-routing/gateway.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: Gateway
33
metadata:
44
name: gateway

examples/cafe-example/cafe-routes.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: HTTPRoute
33
metadata:
44
name: cafe
@@ -13,7 +13,7 @@ spec:
1313
- name: main
1414
port: 80
1515
---
16-
apiVersion: gateway.networking.k8s.io/v1alpha2
16+
apiVersion: gateway.networking.k8s.io/v1beta1
1717
kind: HTTPRoute
1818
metadata:
1919
name: coffee
@@ -32,7 +32,7 @@ spec:
3232
- name: coffee
3333
port: 80
3434
---
35-
apiVersion: gateway.networking.k8s.io/v1alpha2
35+
apiVersion: gateway.networking.k8s.io/v1beta1
3636
kind: HTTPRoute
3737
metadata:
3838
name: tea

examples/cafe-example/gateway.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: Gateway
33
metadata:
44
name: gateway

examples/https-termination/cafe-routes.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: HTTPRoute
33
metadata:
44
name: coffee
@@ -17,7 +17,7 @@ spec:
1717
- name: coffee
1818
port: 80
1919
---
20-
apiVersion: gateway.networking.k8s.io/v1alpha2
20+
apiVersion: gateway.networking.k8s.io/v1beta1
2121
kind: HTTPRoute
2222
metadata:
2323
name: tea

examples/https-termination/gateway.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: Gateway
33
metadata:
44
name: gateway

internal/events/event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ type UpsertEvent struct {
1515
type DeleteEvent struct {
1616
// NamespacedName is the namespace & name of the deleted resource.
1717
NamespacedName types.NamespacedName
18-
// Type is the resource type. For example, if the event is for *v1alpha2.HTTPRoute, pass &v1alpha2.HTTPRoute{} as Type.
18+
// Type is the resource type. For example, if the event is for *v1beta1.HTTPRoute, pass &v1beta1.HTTPRoute{} as Type.
1919
Type client.Object
2020
}

internal/events/loop.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/go-logr/logr"
88
apiv1 "k8s.io/api/core/v1"
9-
"sigs.k8s.io/gateway-api/apis/v1alpha2"
9+
"sigs.k8s.io/gateway-api/apis/v1beta1"
1010

1111
"github.com/nginxinc/nginx-kubernetes-gateway/internal/nginx/config"
1212
"github.com/nginxinc/nginx-kubernetes-gateway/internal/nginx/file"
@@ -125,11 +125,11 @@ func (el *EventLoop) updateNginx(ctx context.Context, conf state.Configuration)
125125

126126
func (el *EventLoop) propagateUpsert(e *UpsertEvent) {
127127
switch r := e.Resource.(type) {
128-
case *v1alpha2.GatewayClass:
128+
case *v1beta1.GatewayClass:
129129
el.cfg.Processor.CaptureUpsertChange(r)
130-
case *v1alpha2.Gateway:
130+
case *v1beta1.Gateway:
131131
el.cfg.Processor.CaptureUpsertChange(r)
132-
case *v1alpha2.HTTPRoute:
132+
case *v1beta1.HTTPRoute:
133133
el.cfg.Processor.CaptureUpsertChange(r)
134134
case *apiv1.Service:
135135
// FIXME(pleshakov): make sure the affected hosts are updated
@@ -144,11 +144,11 @@ func (el *EventLoop) propagateUpsert(e *UpsertEvent) {
144144

145145
func (el *EventLoop) propagateDelete(e *DeleteEvent) {
146146
switch e.Type.(type) {
147-
case *v1alpha2.GatewayClass:
147+
case *v1beta1.GatewayClass:
148148
el.cfg.Processor.CaptureDeleteChange(e.Type, e.NamespacedName)
149-
case *v1alpha2.Gateway:
149+
case *v1beta1.Gateway:
150150
el.cfg.Processor.CaptureDeleteChange(e.Type, e.NamespacedName)
151-
case *v1alpha2.HTTPRoute:
151+
case *v1beta1.HTTPRoute:
152152
el.cfg.Processor.CaptureDeleteChange(e.Type, e.NamespacedName)
153153
case *apiv1.Service:
154154
// FIXME(pleshakov): make sure the affected hosts are updated

0 commit comments

Comments
 (0)