Skip to content

Commit 1ebc0bd

Browse files
authored
doc updates for v2.4.0 (#2506)
* doc updates for v2.4.0 * update external dns example
1 parent 00e1946 commit 1ebc0bd

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

docs/deploy/configurations.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Currently, you can set only 1 namespace to watch in this flag. See [this Kuberne
9393
|kubeconfig | string | in-cluster config | Path to the kubeconfig file containing authorization and API server information |
9494
|leader-election-id | string | aws-load-balancer-controller-leader | Name of the leader election ID to use for this controller |
9595
|leader-election-namespace | string | | Name of the leader election ID to use for this controller |
96+
|load-balancer-class | string | service.k8s.aws/nlb| Name of the load balancer class specified in service `spec.loadBalancerClass` reconciled by this controller |
9697
|log-level | string | info | Set the controller log level - info, debug |
9798
|metrics-bind-addr | string | :8080 | The address the metric endpoint binds to |
9899
|service-max-concurrent-reconciles | int | 3 | Maximum number of concurrently running reconcile loops for service |
@@ -140,5 +141,6 @@ They are a set of kye=value pairs that describe AWS load balance controller feat
140141
141142
|Features-gate Supported Key | Type | Default Value | Description |
142143
|---------------------------------------|---------------------------------|-----------------|-------------|
143-
|ListenerRulesTagging | string | true | Enable or disable tagging AWS load balancer listeners and rules |
144-
|WeightedTargetGroups | string | true | Enable or disable weighted target groups |
144+
| ListenerRulesTagging | string | true | Enable or disable tagging AWS load balancer listeners and rules |
145+
| WeightedTargetGroups | string | true | Enable or disable weighted target groups |
146+
| ServiceTypeLoadBalancerOnly | string | false | If enabled, controller will be limited to reconciling service of type `LoadBalancer`|

docs/deploy/installation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
- Ensure subnets are tagged appropriately for auto-discovery to work
2020
- For IP targets, pods must have IPs from the VPC subnets. You can configure `amazon-vpc-cni-k8s` plugin for this purpose.
2121

22+
!!!note "security group configuration"
23+
If you do not use `eksctl`, you need to ensure worker nodes security group permit access to TCP port 9443 from the kubernetes control plane for the webhook access.
24+
2225
## Using metadata server version 2 (IMDSv2)
2326
If you are using the IMDSv2 you must set the hop limit to 2 or higher in order to allow the AWS Load Balancer Controller to perform the metadata introspection. Otherwise you have to manually specify the AWS region and the VPC via the controller flags `--aws-region` and `--aws-vpc-id`.
2427

docs/examples/echo_server.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ In this walkthrough, you'll
8686
1. Deploy all the echoserver resources (namespace, service, deployment)
8787

8888
```bash
89-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.0.0/docs/examples/echoservice/echoserver-namespace.yaml &&\
90-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.0.0/docs/examples/echoservice/echoserver-service.yaml &&\
91-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.0.0/docs/examples/echoservice/echoserver-deployment.yaml
89+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-namespace.yaml &&\
90+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-service.yaml &&\
91+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-deployment.yaml
9292
```
9393

9494
1. List all the resources to ensure they were created.
@@ -112,7 +112,7 @@ In this walkthrough, you'll
112112
1. Download the echoserver ingress manifest locally.
113113

114114
```bash
115-
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.0.0/docs/examples/echoservice/echoserver-ingress.yaml
115+
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/echoservice/echoserver-ingress.yaml
116116
```
117117

118118
1. Configure the subnets, either by add annotation to the ingress or add tags to subnets. This step is optional in lieu of auto-discovery.
@@ -223,7 +223,7 @@ In this walkthrough, you'll
223223
1. Download external-dns to manage Route 53.
224224

225225
```bash
226-
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.0.0/docs/examples/external-dns.yaml
226+
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/examples/external-dns.yaml
227227
```
228228

229229
1. Edit the `--domain-filter` flag to include your hosted zone(s)
@@ -294,7 +294,7 @@ In this walkthrough, you'll
294294
follow below steps if you want to use kube2iam to provide the AWS credentials
295295

296296
1. configure the proper policy
297-
The policy to be used can be fetched from https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.0.0/docs/install/iam_policy.json
297+
The policy to be used can be fetched from https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.0/docs/install/iam_policy.json
298298

299299
1. configure the proper role and create the trust relationship
300300
You have to find which role is associated with your K8S nodes. Once you found take note of the full arn:

docs/examples/external-dns.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: ServiceAccount
33
metadata:
44
name: external-dns
55
---
6-
apiVersion: rbac.authorization.k8s.io/v1beta1
6+
apiVersion: rbac.authorization.k8s.io/v1
77
kind: ClusterRole
88
metadata:
99
name: external-dns
@@ -24,7 +24,7 @@ rules:
2424
resources: ["endpoints"]
2525
verbs: ["get","watch","list"]
2626
---
27-
apiVersion: rbac.authorization.k8s.io/v1beta1
27+
apiVersion: rbac.authorization.k8s.io/v1
2828
kind: ClusterRoleBinding
2929
metadata:
3030
name: external-dns-viewer

docs/guide/service/annotations.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
|--------------------------------------------------------------------------------------------------|-------------------------|---------------------------|--------------------------------------------------------|
1818
| [service.beta.kubernetes.io/load-balancer-source-ranges](#lb-source-ranges) | stringList | | |
1919
| [service.beta.kubernetes.io/aws-load-balancer-type](#lb-type) | string | | |
20-
| [service.beta.kubernetes.io/aws-load-balancer-nlb-target-type](#nlb-target-type) | string | | |
20+
| [service.beta.kubernetes.io/aws-load-balancer-nlb-target-type](#nlb-target-type) | string | | default `instance` in case of LoadBalancerClass |
2121
| [service.beta.kubernetes.io/aws-load-balancer-name](#load-balancer-name) | string | | |
2222
| [service.beta.kubernetes.io/aws-load-balancer-internal](#lb-internal) | boolean | false | deprecated, in favor of [aws-load-balancer-scheme](#lb-scheme)|
2323
| [service.beta.kubernetes.io/aws-load-balancer-scheme](#lb-scheme) | string | internal | |
@@ -83,9 +83,13 @@ Traffic Routing can be controlled with following annotations:
8383
- `instance` mode will route traffic to all EC2 instances within cluster on the [NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) opened for your service.
8484

8585
!!!note ""
86-
service must be of type `NodePort` or `LoadBalancer` for `instance` targets
86+
- service must be of type `NodePort` or `LoadBalancer` for `instance` targets
87+
- for k8s 1.22 and later if `spec.allocateLoadBalancerNodePorts` is set to `false`, `NodePort` must be allocated manually
8788

88-
- `ip` mode will route traffic directly to the pod IP.
89+
!!!note "default value"
90+
If you configure `spec.loadBalancerClass`, the controller defaults to `instance` target type
91+
92+
- `ip` mode will route traffic directly to the pod IP.
8993

9094
!!!note ""
9195
network plugin must use native AWS VPC networking configuration for pod IP, for example [Amazon VPC CNI plugin](https://github.com/aws/amazon-vpc-cni-k8s).

docs/guide/service/nlb.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ NLB IP mode is determined based on the `service.beta.kubernetes.io/aws-load-bala
5959

6060
### Instance mode
6161
Similar to the IP mode, the instance mode is based on the annotation `service.beta.kubernetes.io/aws-load-balancer-nlb-target-type` value `instance`. Here is a sample manifest snippet:
62+
!!!warning "NodePort allocation"
63+
k8s version 1.22 and later support disabling NodePort allocation by setting the service field `spec.allocateLoadBalancerNodePorts` to `false`. If the NodePort is not allocated for a service port, the controller will fail to reconcile instance mode NLB.
6264

6365
```yaml
6466
metadata:
@@ -95,3 +97,10 @@ security groups, the controller expects only one security group tagged with the
9597
| `kubernetes.io/cluster/${cluster-name}` | `owned` or `shared` |
9698

9799
`${cluster-name}` is the name of the kubernetes cluster
100+
101+
## Load Balancer Class
102+
The AWS Load Balancer Controller supports `LoadBalancerClass` starting v2.4.0 release on k8s 1.22 or later clusters. The LoadBalancerClass provides a cloudprovider agnostic way of offloading the load balancer reconciliation to an external controller. This controller uses the `service.k8s.aws/nlb` as the default class,
103+
you can configure it to a different value via the controller flag `--load-balancer-class`.
104+
105+
When you specify the `spec.loadBalancerClass` on a service of type `LoadBalancer` during service creation, this controller creates an internal NLB with instance targets by default. If the LoadBalancerClass is not the configured for this controller, this controller ignores the service resource completely regardless of the annotation
106+
`service.beta.kubernetes.io/aws-load-balancer-type`. If you modify the service, with `spec.loadBalancerClass`, type from `LoadBalancer` to anything else, the controller will cleanup the NLB.

0 commit comments

Comments
 (0)