|
1 |
| -TODO: describes the controller configurations, i.e. the controller flags |
| 1 | +# AWS Load Balancer controller configuration options |
| 2 | +This document covers configuration of the AWS Load Balancer controller |
| 3 | + |
| 4 | +## AWS API Access |
| 5 | +To perform operations, the controller must have required IAM role capabilities for accessing and |
| 6 | +provisioning ALB resources. There are many ways to achieve this, such as loading `AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY` as environment variables or using [kube2iam](https://github.com/jtblin/kube2iam). |
| 7 | + |
| 8 | +Refer to the [installation guide](installation.md) for installing the controller in your kubernetes cluster and for the minimum required IAM permissions. |
| 9 | + |
| 10 | +## Setting Ingress Resource Scope |
| 11 | +You can limit the ingresses ALB ingress controller controls by combining following two approaches: |
| 12 | + |
| 13 | +### Limiting ingress class |
| 14 | +Setting the `--ingress-class` argument constrains the controller's scope to ingresses with matching `kubernetes.io/ingress.class` annotation. |
| 15 | +This is especially helpful when running multiple ingress controllers in the same cluster. See [Using Multiple Ingress Controllers](https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/multiple-ingress-controllers#using-multiple-ingress-controllers) for more details. |
| 16 | + |
| 17 | +An example of the container spec portion of the controller, only listening for resources with the class "alb", would be as follows. |
| 18 | + |
| 19 | +```yaml |
| 20 | +spec: |
| 21 | + containers: |
| 22 | + - args: |
| 23 | + - --ingress-class=alb |
| 24 | +``` |
| 25 | +
|
| 26 | +Now, only ingress resources with the appropriate annotation are picked up, as seen below. |
| 27 | +
|
| 28 | +```yaml |
| 29 | +apiVersion: extensions/v1beta1 |
| 30 | +kind: Ingress |
| 31 | +metadata: |
| 32 | + name: echoserver |
| 33 | + namespace: echoserver |
| 34 | + annotations: |
| 35 | + kubernetes.io/ingress.class: "alb" |
| 36 | +spec: |
| 37 | + ... |
| 38 | +``` |
| 39 | +
|
| 40 | +If the ingress class is not specified, the controller will reconcile Ingress objects without the ingress class specified or ingress class `alb`. |
| 41 | + |
| 42 | +### Limiting Namespaces |
| 43 | +Setting the `--watch-namespace` argument constrains the controller's scope to a single namespace. Ingress events outside of the namespace specified are not be seen by the controller. |
| 44 | + |
| 45 | +An example of the container spec, for a controller watching only the `default` namespace, is as follows. |
| 46 | + |
| 47 | +```yaml |
| 48 | +spec: |
| 49 | + containers: |
| 50 | + - args: |
| 51 | + - --watch-namespace=default |
| 52 | +``` |
| 53 | + |
| 54 | +> Currently, you can set only 1 namespace to watch in this flag. See [this Kubernetes issue](https://github.com/kubernetes/contrib/issues/847) for more details. |
| 55 | + |
| 56 | +## Controller command line flags |
| 57 | + |
| 58 | +!!!warning "" |
| 59 | + The --cluster-name flag is mandatory and the value must match the name of the kubernetes cluster. If you specify an incorrect name, the subnet auto-discovery will not work. |
| 60 | + |
| 61 | +|Flag | Type | Default | Description | |
| 62 | +|---------------------------------------|---------------------------------|-----------------|-------------| |
| 63 | +|aws-api-throttle | AWS Throttle Config | [default value](#Default throttle config ) | throttle settings for AWS APIs, format: serviceID1:operationRegex1=rate:burst,serviceID2:operationRegex2=rate:burst | |
| 64 | +|aws-max-retries | int | 10 | Maximum retries for AWS APIs | |
| 65 | +|aws-region | string | [instance metadata](#Instance metadata) | AWS Region for the kubernetes cluster | |
| 66 | +|aws-vpc-id | string | [instance metadata](#Instance metadata) | AWS VPC ID for the Kubernetes cluster | |
| 67 | +|cluster-name | string | | Kubernetes cluster name| |
| 68 | +|enable-leader-election | boolean | true | Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager. | |
| 69 | +|enable-pod-readiness-gate-inject | boolean | true | If enabled, targetHealth readiness gate will get injected to the pod spec for the matching endpoint pods. | |
| 70 | +|enable-shield | boolean | true | Enable Shield addon for ALB | |
| 71 | +|enable-waf | boolean | true | Enable WAF addon for ALB | |
| 72 | +|enable-wafv2 | boolean | true | Enable WAF V2 addon for ALB | |
| 73 | +|ingress-class | string | | Name of the ingress class this controller satisfies | |
| 74 | +|ingress-max-concurrent-reconciles | int | 3 | Maximum number of concurrently running reconcile loops for ingress | |
| 75 | +|kubeconfig | string | in-cluster config | Path to the kubeconfig file containing authorization and API server information | |
| 76 | +|leader-election-id | string | aws-load-balancer-controller-leader | Name of the leader election ID to use for this controller | |
| 77 | +|leader-election-namespace | string | | Name of the leader election ID to use for this controller | |
| 78 | +|log-level | string | info | Set the controller log level - info, debug | |
| 79 | +|metrics-bind-addr | string | :8080 | The address the metric endpoint binds to | |
| 80 | +|service-max-concurrent-reconciles | int | 3 | Maximum number of concurrently running reconcile loops for service | |
| 81 | +|sync-period | duration | 1h0m0s | Period at which the controller forces the repopulation of its local object stores| |
| 82 | +|targetgroupbinding-max-concurrent-reconciles | int | 3 | Maximum number of concurrently running reconcile loops for targetGroupBinding | |
| 83 | +|watch-namespace | string | | Namespace the controller watches for updates to Kubernetes objects, If empty, all namespaces are watched. | |
| 84 | +|webhook-bind-port | int | 9443 | The TCP port the Webhook server binds to | |
| 85 | + |
| 86 | + |
| 87 | +### Default throttle config |
| 88 | +``` |
| 89 | +WAF Regional:^AssociateWebACL|DisassociateWebACL=0.5:1,WAF Regional:^GetWebACLForResource|ListResourcesForWebACL=1:1,WAFV2:^AssociateWebACL|DisassociateWebACL=0.5:1,WAFV2:^GetWebACLForResource|ListResourcesForWebACL=1:1 |
| 90 | +``` |
| 91 | +
|
| 92 | +### Instance metadata |
| 93 | +If running on EC2, the default values are obtained from the instance metadata service. |
0 commit comments