Skip to content

Commit

Permalink
Update Ingress APIVersion to networking.k8s.io/v1 (kubernetes-sigs#2433)
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers authored Jan 5, 2022
1 parent 316f6c0 commit 46668f1
Show file tree
Hide file tree
Showing 61 changed files with 797 additions and 409 deletions.
1 change: 1 addition & 0 deletions apis/elbv2/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/elbv2/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /validate-networking-v1beta1-ingress
path: /validate-networking-v1-ingress
failurePolicy: Fail
matchPolicy: Equivalent
name: vingress.elbv2.k8s.aws
rules:
- apiGroups:
- networking.k8s.io
apiVersions:
- v1beta1
- v1
operations:
- CREATE
- UPDATE
Expand Down
2 changes: 1 addition & 1 deletion controllers/ingress/eventhandlers/ingress_class_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package eventhandlers
import (
"context"
"github.com/go-logr/logr"
networking "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package eventhandlers
import (
"context"
"github.com/go-logr/logr"
networking "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
2 changes: 1 addition & 1 deletion controllers/ingress/eventhandlers/ingress_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
networking "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
2 changes: 1 addition & 1 deletion controllers/ingress/eventhandlers/secret_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
networking "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
2 changes: 1 addition & 1 deletion controllers/ingress/eventhandlers/service_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
networking "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
Expand Down
4 changes: 2 additions & 2 deletions controllers/ingress/group_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/go-logr/logr"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
networking "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/record"
Expand Down Expand Up @@ -36,7 +36,7 @@ const (
controllerName = "ingress"

// the groupVersion of used Ingress & IngressClass resource.
ingressResourcesGroupVersion = "networking.k8s.io/v1beta1"
ingressResourcesGroupVersion = "networking.k8s.io/v1"
ingressClassKind = "IngressClass"
)

Expand Down
11 changes: 5 additions & 6 deletions docs/deploy/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Refer to the [installation guide](installation.md) for installing the controller
You can limit the ingresses ALB ingress controller controls by combining following two approaches:

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

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

Expand All @@ -29,18 +29,17 @@ spec:
- --ingress-class=alb
```
Now, only ingress resources with the appropriate annotation are picked up, as seen below.
Now, only ingress resources with the appropriate class are picked up, as seen below.
```yaml
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: echoserver
namespace: echoserver
annotations:
kubernetes.io/ingress.class: "alb"
spec:
...
ingressClassName: alb
...
```

If the ingress class is not specified, the controller will reconcile Ingress objects without the ingress class specified or ingress class `alb`.
Expand Down
3 changes: 2 additions & 1 deletion docs/deploy/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

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

!!!warning "Existing AWS ALB Ingress Controller users"
AWS ALB Ingress controller must be uninstalled before installing AWS Load Balancer controller.
Expand Down
17 changes: 10 additions & 7 deletions docs/examples/2048/2048_full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
app.kubernetes.io/name: app-2048
spec:
containers:
- image: alexwhen/docker-2048
- image: public.ecr.aws/l6m2t8p7/docker-2048:latest
imagePullPolicy: Always
name: app-2048
ports:
Expand All @@ -40,20 +40,23 @@ spec:
selector:
app.kubernetes.io/name: app-2048
---
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: game-2048
name: ingress-2048
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
spec:
ingressClassName: alb
rules:
- http:
paths:
- path: /*
backend:
serviceName: service-2048
servicePort: 80
- path: /
pathType: Prefix
backend:
service:
name: service-2048
port:
number: 80
62 changes: 0 additions & 62 deletions docs/examples/2048/2048_full_latest.yaml

This file was deleted.

22 changes: 14 additions & 8 deletions docs/examples/cognito-ingress-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
# - Related Kubernetes service/application
#

apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: <ingress-name> # app.example.com
namespace: <placement-namespace> # default
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=<environment-name>,Owner=<your-name>
# For each `listen-ports` object defined an ALB lister is created
Expand All @@ -50,18 +49,25 @@ metadata:
# ACM certificate ARN for your SSL domain
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:<region>:<account-id>:certificate/<certificate-id>
spec:
ingressClassName: alb
rules:
# If you are using ExternalDNS, this will become your applications FQDN
- host: <FQDN>
http:
paths:
# This first path should perform an ssl-redirect as below
- path: /*
- path: /
pathType: Prefix
backend:
serviceName: ssl-redirect
# Configured via the redirect settings in the annotations
servicePort: use-annotation
service:
name: ssl-redirect
# Configured via the redirect settings in the annotations
port:
name: use-annotation
- path: <html-path>
pathType: Prefix
backend:
serviceName: <service-name>
servicePort: <service-port>
service:
name: <service-name>
port:
number: <service-port>
2 changes: 1 addition & 1 deletion docs/examples/echo_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ In this walkthrough, you'll
```
```yaml
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: echoserver
Expand Down
11 changes: 7 additions & 4 deletions docs/examples/echoservice/echoserver-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: echoserver
namespace: echoserver
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/tags: Environment=dev,Team=test
spec:
ingressClassName: alb
rules:
- host: echoserver.example.com
http:
paths:
- path: /
pathType: Exact
backend:
serviceName: echoserver
servicePort: 80
service:
name: echoserver
port:
number: 80
22 changes: 14 additions & 8 deletions docs/examples/grpc/grpcserver-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
Expand All @@ -8,22 +8,28 @@ metadata:
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
kubernetes.io/ingress.class: alb
labels:
app: grpcserver
environment: dev
name: grpcserver
namespace: grpcserver
spec:
ingressClassName: alb
rules:
- host: grpcserver.example.com
http:
paths:
- backend:
serviceName: ssl-redirect
servicePort: use-annotation
path: /*
service:
name: ssl-redirect
port:
name: use-annotation
path: /
pathType: Prefix
- backend:
serviceName: grpcserver
servicePort: 50051
path: /helloworld.Greeter/*
service:
name: grpcserver
port:
number: 50051
path: /helloworld.Greeter
pathType: Prefix
Loading

0 comments on commit 46668f1

Please sign in to comment.