Skip to content

Commit 46668f1

Browse files
authored
Update Ingress APIVersion to networking.k8s.io/v1 (#2433)
1 parent 316f6c0 commit 46668f1

File tree

61 files changed

+797
-409
lines changed

Some content is hidden

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

61 files changed

+797
-409
lines changed

apis/elbv2/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/elbv2/v1beta1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/webhook/manifests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ webhooks:
7676
service:
7777
name: webhook-service
7878
namespace: system
79-
path: /validate-networking-v1beta1-ingress
79+
path: /validate-networking-v1-ingress
8080
failurePolicy: Fail
8181
matchPolicy: Equivalent
8282
name: vingress.elbv2.k8s.aws
8383
rules:
8484
- apiGroups:
8585
- networking.k8s.io
8686
apiVersions:
87-
- v1beta1
87+
- v1
8888
operations:
8989
- CREATE
9090
- UPDATE

controllers/ingress/eventhandlers/ingress_class_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package eventhandlers
33
import (
44
"context"
55
"github.com/go-logr/logr"
6-
networking "k8s.io/api/networking/v1beta1"
6+
networking "k8s.io/api/networking/v1"
77
"k8s.io/apimachinery/pkg/api/equality"
88
"k8s.io/client-go/tools/record"
99
"k8s.io/client-go/util/workqueue"

controllers/ingress/eventhandlers/ingress_class_params_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package eventhandlers
33
import (
44
"context"
55
"github.com/go-logr/logr"
6-
networking "k8s.io/api/networking/v1beta1"
6+
networking "k8s.io/api/networking/v1"
77
"k8s.io/apimachinery/pkg/api/equality"
88
"k8s.io/client-go/tools/record"
99
"k8s.io/client-go/util/workqueue"

controllers/ingress/eventhandlers/ingress_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"github.com/go-logr/logr"
77
corev1 "k8s.io/api/core/v1"
8-
networking "k8s.io/api/networking/v1beta1"
8+
networking "k8s.io/api/networking/v1"
99
"k8s.io/apimachinery/pkg/api/equality"
1010
"k8s.io/client-go/tools/record"
1111
"k8s.io/client-go/util/workqueue"

controllers/ingress/eventhandlers/secret_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"github.com/go-logr/logr"
66
corev1 "k8s.io/api/core/v1"
7-
networking "k8s.io/api/networking/v1beta1"
7+
networking "k8s.io/api/networking/v1"
88
"k8s.io/apimachinery/pkg/api/equality"
99
"k8s.io/client-go/tools/record"
1010
"k8s.io/client-go/util/workqueue"

controllers/ingress/eventhandlers/service_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"github.com/go-logr/logr"
66
corev1 "k8s.io/api/core/v1"
7-
networking "k8s.io/api/networking/v1beta1"
7+
networking "k8s.io/api/networking/v1"
88
"k8s.io/apimachinery/pkg/api/equality"
99
"k8s.io/client-go/tools/record"
1010
"k8s.io/client-go/util/workqueue"

controllers/ingress/group_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/go-logr/logr"
77
"github.com/pkg/errors"
88
corev1 "k8s.io/api/core/v1"
9-
networking "k8s.io/api/networking/v1beta1"
9+
networking "k8s.io/api/networking/v1"
1010
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1111
"k8s.io/client-go/kubernetes"
1212
"k8s.io/client-go/tools/record"
@@ -36,7 +36,7 @@ const (
3636
controllerName = "ingress"
3737

3838
// the groupVersion of used Ingress & IngressClass resource.
39-
ingressResourcesGroupVersion = "networking.k8s.io/v1beta1"
39+
ingressResourcesGroupVersion = "networking.k8s.io/v1"
4040
ingressClassKind = "IngressClass"
4141
)
4242

docs/deploy/configurations.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Refer to the [installation guide](installation.md) for installing the controller
1818
You can limit the ingresses ALB ingress controller controls by combining following two approaches:
1919

2020
### Limiting ingress class
21-
Setting the `--ingress-class` argument constrains the controller's scope to ingresses with matching `kubernetes.io/ingress.class` annotation.
21+
Setting the `--ingress-class` argument constrains the controller's scope to ingresses with matching `ingressClassName` field.
2222

2323
An example of the container spec portion of the controller, only listening for resources with the class "alb", would be as follows.
2424

@@ -29,18 +29,17 @@ spec:
2929
- --ingress-class=alb
3030
```
3131
32-
Now, only ingress resources with the appropriate annotation are picked up, as seen below.
32+
Now, only ingress resources with the appropriate class are picked up, as seen below.
3333
3434
```yaml
35-
apiVersion: extensions/v1beta1
35+
apiVersion: networking.k8s.io/v1
3636
kind: Ingress
3737
metadata:
3838
name: echoserver
3939
namespace: echoserver
40-
annotations:
41-
kubernetes.io/ingress.class: "alb"
4240
spec:
43-
...
41+
ingressClassName: alb
42+
...
4443
```
4544

4645
If the ingress class is not specified, the controller will reconcile Ingress objects without the ingress class specified or ingress class `alb`.

docs/deploy/installation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Kubernetes version requirements
44
* AWS Load Balancer Controller v2.0.0~v2.1.3 requires Kubernetes 1.15+
5-
* AWS Load Balancer Controller v2.2.0+ requires Kubernetes 1.16+
5+
* AWS Load Balancer Controller v2.2.0~v2.3.1 requires Kubernetes 1.16-1.21
6+
* AWS Load Balancer Controller v2.4.0+ requires Kubernetes 1.19+
67

78
!!!warning "Existing AWS ALB Ingress Controller users"
89
AWS ALB Ingress controller must be uninstalled before installing AWS Load Balancer controller.

docs/examples/2048/2048_full.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
app.kubernetes.io/name: app-2048
2121
spec:
2222
containers:
23-
- image: alexwhen/docker-2048
23+
- image: public.ecr.aws/l6m2t8p7/docker-2048:latest
2424
imagePullPolicy: Always
2525
name: app-2048
2626
ports:
@@ -40,20 +40,23 @@ spec:
4040
selector:
4141
app.kubernetes.io/name: app-2048
4242
---
43-
apiVersion: networking.k8s.io/v1beta1
43+
apiVersion: networking.k8s.io/v1
4444
kind: Ingress
4545
metadata:
4646
namespace: game-2048
4747
name: ingress-2048
4848
annotations:
49-
kubernetes.io/ingress.class: alb
5049
alb.ingress.kubernetes.io/scheme: internet-facing
5150
alb.ingress.kubernetes.io/target-type: ip
5251
spec:
52+
ingressClassName: alb
5353
rules:
5454
- http:
5555
paths:
56-
- path: /*
57-
backend:
58-
serviceName: service-2048
59-
servicePort: 80
56+
- path: /
57+
pathType: Prefix
58+
backend:
59+
service:
60+
name: service-2048
61+
port:
62+
number: 80

docs/examples/2048/2048_full_latest.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

docs/examples/cognito-ingress-template.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
# - Related Kubernetes service/application
1818
#
1919

20-
apiVersion: extensions/v1beta1
20+
apiVersion: networking.k8s.io/v1
2121
kind: Ingress
2222
metadata:
2323
name: <ingress-name> # app.example.com
2424
namespace: <placement-namespace> # default
2525
annotations:
26-
kubernetes.io/ingress.class: alb
2726
alb.ingress.kubernetes.io/scheme: internet-facing
2827
alb.ingress.kubernetes.io/tags: Environment=<environment-name>,Owner=<your-name>
2928
# For each `listen-ports` object defined an ALB lister is created
@@ -50,18 +49,25 @@ metadata:
5049
# ACM certificate ARN for your SSL domain
5150
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:<region>:<account-id>:certificate/<certificate-id>
5251
spec:
52+
ingressClassName: alb
5353
rules:
5454
# If you are using ExternalDNS, this will become your applications FQDN
5555
- host: <FQDN>
5656
http:
5757
paths:
5858
# This first path should perform an ssl-redirect as below
59-
- path: /*
59+
- path: /
60+
pathType: Prefix
6061
backend:
61-
serviceName: ssl-redirect
62-
# Configured via the redirect settings in the annotations
63-
servicePort: use-annotation
62+
service:
63+
name: ssl-redirect
64+
# Configured via the redirect settings in the annotations
65+
port:
66+
name: use-annotation
6467
- path: <html-path>
68+
pathType: Prefix
6569
backend:
66-
serviceName: <service-name>
67-
servicePort: <service-port>
70+
service:
71+
name: <service-name>
72+
port:
73+
number: <service-port>

docs/examples/echo_server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ In this walkthrough, you'll
131131
```
132132
133133
```yaml
134-
apiVersion: extensions/v1beta1
134+
apiVersion: networking.k8s.io/v1
135135
kind: Ingress
136136
metadata:
137137
name: echoserver
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
apiVersion: networking.k8s.io/v1beta1
1+
apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
44
name: echoserver
55
namespace: echoserver
66
annotations:
7-
kubernetes.io/ingress.class: alb
87
alb.ingress.kubernetes.io/scheme: internet-facing
98
alb.ingress.kubernetes.io/tags: Environment=dev,Team=test
109
spec:
10+
ingressClassName: alb
1111
rules:
1212
- host: echoserver.example.com
1313
http:
1414
paths:
1515
- path: /
16+
pathType: Exact
1617
backend:
17-
serviceName: echoserver
18-
servicePort: 80
18+
service:
19+
name: echoserver
20+
port:
21+
number: 80
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: networking.k8s.io/v1beta1
1+
apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
44
annotations:
@@ -8,22 +8,28 @@ metadata:
88
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
99
alb.ingress.kubernetes.io/scheme: internet-facing
1010
alb.ingress.kubernetes.io/target-type: ip
11-
kubernetes.io/ingress.class: alb
1211
labels:
1312
app: grpcserver
1413
environment: dev
1514
name: grpcserver
1615
namespace: grpcserver
1716
spec:
17+
ingressClassName: alb
1818
rules:
1919
- host: grpcserver.example.com
2020
http:
2121
paths:
2222
- backend:
23-
serviceName: ssl-redirect
24-
servicePort: use-annotation
25-
path: /*
23+
service:
24+
name: ssl-redirect
25+
port:
26+
name: use-annotation
27+
path: /
28+
pathType: Prefix
2629
- backend:
27-
serviceName: grpcserver
28-
servicePort: 50051
29-
path: /helloworld.Greeter/*
30+
service:
31+
name: grpcserver
32+
port:
33+
number: 50051
34+
path: /helloworld.Greeter
35+
pathType: Prefix

0 commit comments

Comments
 (0)