Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eks): alb controller include versions 2.4.2 - 2.5.1 #25330

Merged
merged 26 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1325770
added alb controller versions 2.4.2 - 2.5.1
Apr 26, 2023
f5564c9
added policies for v2.4.2-v2.5.1
Apr 26, 2023
c831b58
added unit tests for alb controller versions 2.4.2-2.5.1
Apr 26, 2023
c6ddb54
updated unit test for v2.4.7 to correctly use alb controller v2.4.7 i…
Apr 26, 2023
6027be0
updated alb-controller integrity test with latest alb controller vers…
Apr 27, 2023
df36045
updated kubernetes-sigs alb link in README
Apr 27, 2023
ed729c6
updated alb controller version used during integ test
Apr 27, 2023
5993cbd
removed redundant unit tests
colifran Apr 28, 2023
8a5981f
Merge branch 'main' into colifran/alb-controller-versions
kaizencc May 4, 2023
0114564
Merge branch 'main' into colifran/alb-controller-versions
mergify[bot] May 4, 2023
ffda9fc
added HelmChartVersion enum and added helmChartVersion as property on…
colifran May 10, 2023
c3c1510
made helm chart version set based on provided value
colifran May 10, 2023
b4dc140
moved helmChartVersion prop to AlbControllerVersionOptions interface …
colifran May 10, 2023
2d078e6
updated integ tests and snapshots
colifran May 10, 2023
04fd773
merge from remote
colifran May 10, 2023
5b47021
fixed merge conflicts and merge from main
colifran May 10, 2023
9506b6f
merge from main
colifran May 10, 2023
df27b8e
deleted cdk-cli-wrapper
colifran May 10, 2023
14a251a
added helm chart version as AlbControllerVersion constructor with val…
colifran May 11, 2023
541296c
reverted integ test changes
colifran May 11, 2023
6a50182
made all previous versions have helm chart version 1.4.1
colifran May 11, 2023
0bf6c9b
added additional information to static of method in AlbControllerVers…
colifran May 11, 2023
2490356
added unit test to verify correct helm chart version is set in templa…
colifran May 15, 2023
17cf95e
fixed merge conflicts
colifran May 15, 2023
15c19ea
Update packages/aws-cdk-lib/aws-eks/test/alb-controller.test.ts
kaizencc May 15, 2023
038d80b
Merge branch 'main' into colifran/alb-controller-versions
mergify[bot] May 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,26 @@
"arn:aws:elasticloadbalancing:*:*:listener/net/*/*/*"
]
},
{
"Action": "elasticloadbalancing:AddTags",
"Condition": {
"StringEquals": {
"elasticloadbalancing:CreateAction": [
"CreateTargetGroup",
"CreateLoadBalancer"
]
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
},
"Effect": "Allow",
"Resource": [
"arn:aws:elasticloadbalancing:*:*:loadbalancer/app/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws:elasticloadbalancing:*:*:targetgroup/*/*"
]
},
{
"Action": [
"elasticloadbalancing:DeregisterTargets",
Expand Down Expand Up @@ -1454,7 +1474,7 @@
},
"Release": "aws-load-balancer-controller",
"Chart": "aws-load-balancer-controller",
"Version": "1.4.1",
"Version": "1.5.2",
"Wait": true,
"Timeout": "900s",
"Values": {
Expand All @@ -1473,7 +1493,7 @@
{
"Ref": "Vpc8378EB38"
},
"\",\"image\":{\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.4.1\"}}"
"\",\"image\":{\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.5.1\"}}"
]
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3385,6 +3385,26 @@
"arn:aws:elasticloadbalancing:*:*:listener/net/*/*/*"
]
},
{
"Action": "elasticloadbalancing:AddTags",
"Condition": {
"StringEquals": {
"elasticloadbalancing:CreateAction": [
"CreateTargetGroup",
"CreateLoadBalancer"
]
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
},
"Effect": "Allow",
"Resource": [
"arn:aws:elasticloadbalancing:*:*:loadbalancer/app/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws:elasticloadbalancing:*:*:targetgroup/*/*"
]
},
{
"Action": [
"elasticloadbalancing:DeregisterTargets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EksClusterAlbControllerStack extends Stack {
vpc,
...getClusterVersionConfig(this),
albController: {
version: eks.AlbControllerVersion.V2_4_1,
version: eks.AlbControllerVersion.V2_5_1,
kaizencc marked this conversation as resolved.
Show resolved Hide resolved
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,26 @@
"arn:aws:elasticloadbalancing:*:*:listener/net/*/*/*"
]
},
{
"Action": "elasticloadbalancing:AddTags",
"Condition": {
"StringEquals": {
"elasticloadbalancing:CreateAction": [
"CreateTargetGroup",
"CreateLoadBalancer"
]
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
},
"Effect": "Allow",
"Resource": [
"arn:aws:elasticloadbalancing:*:*:loadbalancer/app/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws:elasticloadbalancing:*:*:targetgroup/*/*"
]
},
{
"Action": [
"elasticloadbalancing:DeregisterTargets",
Expand Down Expand Up @@ -1809,7 +1829,7 @@
},
"Release": "aws-load-balancer-controller",
"Chart": "aws-load-balancer-controller",
"Version": "1.4.1",
"Version": "1.5.2",
"Wait": true,
"Timeout": "900s",
"Values": {
Expand All @@ -1828,7 +1848,7 @@
{
"Ref": "Vpc8378EB38"
},
"\",\"image\":{\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.4.1\"}}"
"\",\"image\":{\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.5.1\"}}"
]
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3842,6 +3842,26 @@
"arn:aws:elasticloadbalancing:*:*:listener/net/*/*/*"
]
},
{
"Action": "elasticloadbalancing:AddTags",
"Condition": {
"StringEquals": {
"elasticloadbalancing:CreateAction": [
"CreateTargetGroup",
"CreateLoadBalancer"
]
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
},
"Effect": "Allow",
"Resource": [
"arn:aws:elasticloadbalancing:*:*:loadbalancer/app/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws:elasticloadbalancing:*:*:targetgroup/*/*"
]
},
{
"Action": [
"elasticloadbalancing:DeregisterTargets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EksClusterInferenceStack extends Stack {
vpc,
...getClusterVersionConfig(this),
albController: {
version: eks.AlbControllerVersion.V2_4_1,
version: eks.AlbControllerVersion.V2_5_1,
},
});

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-eks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ The default value is `eks.EndpointAccess.PUBLIC_AND_PRIVATE`. Which means the cl

### Alb Controller

Some Kubernetes resources are commonly implemented on AWS with the help of the [ALB Controller](https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/).
Some Kubernetes resources are commonly implemented on AWS with the help of the [ALB Controller](https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.5/).

From the docs:

Expand Down
219 changes: 219 additions & 0 deletions packages/aws-cdk-lib/aws-eks/lib/addons/alb-iam_policy-v2.4.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:CreateServiceLinkedRole"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"iam:AWSServiceName": "elasticloadbalancing.amazonaws.com"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeAccountAttributes",
"ec2:DescribeAddresses",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeInternetGateways",
"ec2:DescribeVpcs",
"ec2:DescribeVpcPeeringConnections",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups",
"ec2:DescribeInstances",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeTags",
"ec2:GetCoipPoolUsage",
"ec2:DescribeCoipPools",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:DescribeLoadBalancerAttributes",
"elasticloadbalancing:DescribeListeners",
"elasticloadbalancing:DescribeListenerCertificates",
"elasticloadbalancing:DescribeSSLPolicies",
"elasticloadbalancing:DescribeRules",
"elasticloadbalancing:DescribeTargetGroups",
"elasticloadbalancing:DescribeTargetGroupAttributes",
"elasticloadbalancing:DescribeTargetHealth",
"elasticloadbalancing:DescribeTags"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"cognito-idp:DescribeUserPoolClient",
"acm:ListCertificates",
"acm:DescribeCertificate",
"iam:ListServerCertificates",
"iam:GetServerCertificate",
"waf-regional:GetWebACL",
"waf-regional:GetWebACLForResource",
"waf-regional:AssociateWebACL",
"waf-regional:DisassociateWebACL",
"wafv2:GetWebACL",
"wafv2:GetWebACLForResource",
"wafv2:AssociateWebACL",
"wafv2:DisassociateWebACL",
"shield:GetSubscriptionState",
"shield:DescribeProtection",
"shield:CreateProtection",
"shield:DeleteProtection"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateSecurityGroup"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:*:*:security-group/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction": "CreateSecurityGroup"
},
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:DeleteTags"
],
"Resource": "arn:aws:ec2:*:*:security-group/*",
"Condition": {
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "true",
"aws:ResourceTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress",
"ec2:DeleteSecurityGroup"
],
"Resource": "*",
"Condition": {
"Null": {
"aws:ResourceTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:CreateLoadBalancer",
"elasticloadbalancing:CreateTargetGroup"
],
"Resource": "*",
"Condition": {
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:CreateListener",
"elasticloadbalancing:DeleteListener",
"elasticloadbalancing:CreateRule",
"elasticloadbalancing:DeleteRule"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:AddTags",
"elasticloadbalancing:RemoveTags"
],
"Resource": [
"arn:aws:elasticloadbalancing:*:*:targetgroup/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/net/*/*",
"arn:aws:elasticloadbalancing:*:*:loadbalancer/app/*/*"
],
"Condition": {
"Null": {
"aws:RequestTag/elbv2.k8s.aws/cluster": "true",
"aws:ResourceTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:AddTags",
"elasticloadbalancing:RemoveTags"
],
"Resource": [
"arn:aws:elasticloadbalancing:*:*:listener/net/*/*/*",
"arn:aws:elasticloadbalancing:*:*:listener/app/*/*/*",
"arn:aws:elasticloadbalancing:*:*:listener-rule/net/*/*/*",
"arn:aws:elasticloadbalancing:*:*:listener-rule/app/*/*/*"
]
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:ModifyLoadBalancerAttributes",
"elasticloadbalancing:SetIpAddressType",
"elasticloadbalancing:SetSecurityGroups",
"elasticloadbalancing:SetSubnets",
"elasticloadbalancing:DeleteLoadBalancer",
"elasticloadbalancing:ModifyTargetGroup",
"elasticloadbalancing:ModifyTargetGroupAttributes",
"elasticloadbalancing:DeleteTargetGroup"
],
"Resource": "*",
"Condition": {
"Null": {
"aws:ResourceTag/elbv2.k8s.aws/cluster": "false"
}
}
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:RegisterTargets",
"elasticloadbalancing:DeregisterTargets"
],
"Resource": "arn:aws:elasticloadbalancing:*:*:targetgroup/*/*"
},
{
"Effect": "Allow",
"Action": [
"elasticloadbalancing:SetWebAcl",
"elasticloadbalancing:ModifyListener",
"elasticloadbalancing:AddListenerCertificates",
"elasticloadbalancing:RemoveListenerCertificates",
"elasticloadbalancing:ModifyRule"
],
"Resource": "*"
}
]
}
Loading