Skip to content

Commit 3e94d6e

Browse files
authored
update install doc and migration iam policy (#1548)
1 parent 3c58eca commit 3e94d6e

File tree

3 files changed

+61
-66
lines changed

3 files changed

+61
-66
lines changed

docs/guide/controller/installation.md

Lines changed: 58 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,62 @@
11
# AWS Load Balancer Controller Installation guide
22

3-
## Via Helm
4-
Follow the instructions in [aws-load-balancer-controller](https://github.com/aws/eks-charts/tree/master/stable/aws-load-balancer-controller) helm chart.
5-
6-
## Via Yaml manifests
7-
8-
### Migrating from AWS ALB Ingress controller
9-
If AWS ALB Ingress controller is installed, refer to [migrating from v1 to v2](../upgrade/migrate_v1_v2.md)
10-
11-
!!!warning ""
3+
!!!warning "Existing AWS ALB Ingress Controller users"
124
AWS ALB Ingress controller must be uninstalled before installing AWS Load Balancer controller.
13-
14-
!!! Note
15-
Existing Ingress resources do not need to be deleted for migration.
16-
17-
### IAM permissions
18-
The controller runs on the worker nodes, so it needs access to the AWS ALB/NLB resources via IAM permissions. The
19-
IAM permissions can either be setup via IAM roles for ServiceAccount or can be attached directly to the worker node IAM roles.
20-
21-
#### Setup IAM for ServiceAccount
22-
1. Create IAM OIDC provider
23-
```
24-
eksctl utils associate-iam-oidc-provider \
25-
--region <region-code> \
26-
--cluster <your-cluster-name> \
5+
Please follow our [migration guide](../upgrade/migrate_v1_v2.md) to do migration.
6+
7+
=== "Via Helm"
8+
Follow the instructions in [aws-load-balancer-controller](https://github.com/aws/eks-charts/tree/master/stable/aws-load-balancer-controller) helm chart.
9+
10+
=== "Via YAML manifests"
11+
### IAM Permissions
12+
The controller runs on the worker nodes, so it needs access to the AWS ALB/NLB resources via IAM permissions.
13+
The IAM permissions can either be setup via IAM roles for ServiceAccount or can be attached directly to the worker node IAM roles.
14+
15+
#### Setup IAM role for service accounts
16+
1. Create IAM OIDC provider
17+
```
18+
eksctl utils associate-iam-oidc-provider \
19+
--region <region-code> \
20+
--cluster <your-cluster-name> \
21+
--approve
22+
```
23+
24+
1. Download IAM policy for the AWS Load Balancer Controller
25+
```
26+
curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/main/docs/install/iam_policy.json
27+
```
28+
29+
1. Create an IAM policy called AWSLoadBalancerControllerIAMPolicy
30+
```
31+
aws iam create-policy \
32+
--policy-name AWSLoadBalancerControllerIAMPolicy \
33+
--policy-document file://iam-policy.json
34+
```
35+
Take note of the policy ARN that is returned
36+
37+
1. Create a IAM role and ServiceAccount for the AWS Load Balancer controller, use the ARN from the step above
38+
```
39+
eksctl create iamserviceaccount \
40+
--cluster=<cluster-name> \
41+
--namespace=kube-system \
42+
--name=aws-load-balancer-controller \
43+
--attach-policy-arn=arn:aws:iam::<AWS_ACCOUNT_ID>:policy/AWSLoadBalancerControllerIAMPolicy \
2744
--approve
28-
```
29-
1. Download IAM policy for the AWS Load Balancer Controller
30-
```
31-
curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v2_ga/docs/install/iam_policy.json
32-
```
33-
1. Create an IAM policy called AWSLoadBalancerControllerIAMPolicy
34-
```
35-
aws iam create-policy \
36-
--policy-name AWSLoadBalancerControllerIAMPolicy \
37-
--policy-document file://iam-policy.json
38-
```
39-
Take note of the policy ARN that is returned
40-
41-
1. Create a IAM role and ServiceAccount for the Load Balancer controller, use the ARN from the step above
42-
```
43-
eksctl create iamserviceaccount \
44-
--cluster=<cluster-name> \
45-
--namespace=kube-system \
46-
--name=aws-load-balancer-controller \
47-
--attach-policy-arn=arn:aws:iam::<AWS_ACCOUNT_ID>:policy/AWSLoadBalancerControllerIAMPolicy \
48-
--approve
49-
```
50-
#### Setup IAM manually
51-
If not setting up IAM for ServiceAccount, apply the IAM policies from the following URL at minimum.
52-
```
53-
https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v2_ga/docs/install/iam_policy.json
54-
```
55-
56-
#### Upgrading from ALB ingress controller
57-
If migrating from ALB ingress controller, grant [additional IAM permissions](../../install/iam_policy_v1_to_v2_additional.json).
58-
59-
### Install cert-manager
60-
- For Kubernetes 1.16+: `kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.2/cert-manager.yaml`
61-
- For Kubernetes <1.16: `kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.2/cert-manager-legacy.yaml`
62-
63-
### Download and apply the yaml spec
64-
- curl -o https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v2_ga/config/samples/install_v2_0_0.yaml
65-
- Edit the saved yaml file, go to the Deployment spec, and set the controller --cluster-name arg value to your EKS cluster name
66-
- Apply the yaml file kubectl apply -f install_v2_0_0.yaml
67-
68-
!!!note ""
69-
If you use iamserviceaccount, it is recommended that you delete the ServiceAccount from the yaml spec. Doing so will preserve the eksctl created iamserviceaccount if you delete the installation.
45+
```
46+
#### Setup IAM manually
47+
If not setting up IAM for ServiceAccount, apply the IAM policies from the following URL at minimum.
48+
```
49+
curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/main/docs/install/iam_policy.json
50+
```
51+
52+
### Install cert-manager
53+
- For Kubernetes 1.16+: `kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.2/cert-manager.yaml`
54+
- For Kubernetes <1.16: `kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.2/cert-manager-legacy.yaml`
55+
56+
### Download and apply the yaml spec
57+
- https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/main/docs/install/v2_0_0_full.yaml
58+
- Edit the saved yaml file, go to the Deployment spec, and set the controller --cluster-name arg value to your EKS cluster name
59+
- Apply the yaml file kubectl apply -f install_v2_0_0.yaml
60+
61+
!!!note ""
62+
If you use IAM roles for service accounts, we recommend that you delete the ServiceAccount from the yaml spec. Doing so will preserve the eksctl created iamserviceaccount if you delete the installation.

docs/install/iam_policy_v1_to_v2_additional.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"Effect": "Allow",
1919
"Action": [
2020
"elasticloadbalancing:AddTags",
21-
"elasticloadbalancing:RemoveTags"
21+
"elasticloadbalancing:RemoveTags",
22+
"elasticloadbalancing:DeleteTargetGroup"
2223
],
2324
"Resource": [
2425
"arn:aws:elasticloadbalancing:*:*:loadbalancer/*",

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ markdown_extensions:
4949
- pymdownx.tasklist:
5050
custom_checkbox: true
5151
- pymdownx.superfences
52+
- pymdownx.tabbed
5253
- toc:
5354
permalink: true

0 commit comments

Comments
 (0)