-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Update CloudFormation to handle v1beta1 permissions (#4771)
- Loading branch information
1 parent
0ef00ab
commit aae8b73
Showing
4 changed files
with
253 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
166 changes: 166 additions & 0 deletions
166
.github/actions/e2e/create-cluster/alpha-controller-policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "AllowScopedEC2InstanceActions", | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}::image/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}::snapshot/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:spot-instances-request/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:security-group/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:subnet/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:launch-template/*" | ||
], | ||
"Action": [ | ||
"ec2:RunInstances", | ||
"ec2:CreateFleet" | ||
] | ||
}, | ||
{ | ||
"Sid": "AllowScopedEC2InstanceActionsWithTags", | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:fleet/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:instance/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:volume/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:network-interface/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:launch-template/*" | ||
], | ||
"Action": [ | ||
"ec2:RunInstances", | ||
"ec2:CreateFleet", | ||
"ec2:CreateLaunchTemplate" | ||
], | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:RequestTag/kubernetes.io/cluster/${CLUSTER_NAME}": "owned" | ||
}, | ||
"StringLike": { | ||
"aws:RequestTag/karpenter.sh/provisioner-name": "*" | ||
} | ||
} | ||
}, | ||
{ | ||
"Sid": "AllowScopedResourceCreationTagging", | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:fleet/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:instance/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:volume/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:network-interface/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:launch-template/*" | ||
], | ||
"Action": "ec2:CreateTags", | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:RequestTag/kubernetes.io/cluster/${CLUSTER_NAME}": "owned", | ||
"ec2:CreateAction": [ | ||
"RunInstances", | ||
"CreateFleet", | ||
"CreateLaunchTemplate" | ||
] | ||
}, | ||
"StringLike": { | ||
"aws:RequestTag/karpenter.sh/provisioner-name": "*" | ||
} | ||
} | ||
}, | ||
{ | ||
"Sid": "AllowMachineMigrationTagging", | ||
"Effect": "Allow", | ||
"Resource": "arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:instance/*", | ||
"Action": "ec2:CreateTags", | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:ResourceTag/kubernetes.io/cluster/${CLUSTER_NAME}": "owned", | ||
"aws:RequestTag/karpenter.sh/managed-by": "${CLUSTER_NAME}" | ||
}, | ||
"StringLike": { | ||
"aws:RequestTag/karpenter.sh/provisioner-name": "*" | ||
}, | ||
"ForAllValues:StringEquals": { | ||
"aws:TagKeys": [ | ||
"karpenter.sh/provisioner-name", | ||
"karpenter.sh/managed-by" | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"Sid": "AllowScopedDeletion", | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:instance/*", | ||
"arn:${AWS_PARTITION}:ec2:${AWS_REGION}:*:launch-template/*" | ||
], | ||
"Action": [ | ||
"ec2:TerminateInstances", | ||
"ec2:DeleteLaunchTemplate" | ||
], | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:ResourceTag/kubernetes.io/cluster/${CLUSTER_NAME}": "owned" | ||
}, | ||
"StringLike": { | ||
"aws:ResourceTag/karpenter.sh/provisioner-name": "*" | ||
} | ||
} | ||
}, | ||
{ | ||
"Sid": "AllowRegionalReadActions", | ||
"Effect": "Allow", | ||
"Resource": "*", | ||
"Action": [ | ||
"ec2:DescribeAvailabilityZones", | ||
"ec2:DescribeImages", | ||
"ec2:DescribeInstances", | ||
"ec2:DescribeInstanceTypeOfferings", | ||
"ec2:DescribeInstanceTypes", | ||
"ec2:DescribeLaunchTemplates", | ||
"ec2:DescribeSecurityGroups", | ||
"ec2:DescribeSpotPriceHistory", | ||
"ec2:DescribeSubnets" | ||
], | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:RequestedRegion": "${AWS_REGION}" | ||
} | ||
} | ||
}, | ||
{ | ||
"Sid": "AllowSSMReadActions", | ||
"Effect": "Allow", | ||
"Resource": "arn:${AWS_PARTITION}:ssm:${AWS_REGION}::parameter/aws/service/*", | ||
"Action": "ssm:GetParameter" | ||
}, | ||
{ | ||
"Sid": "AllowPricingReadActions", | ||
"Effect": "Allow", | ||
"Resource": "*", | ||
"Action": "pricing:GetProducts" | ||
}, | ||
{ | ||
"Sid": "AllowInterruptionQueueActions", | ||
"Effect": "Allow", | ||
"Resource": "arn:aws:sqs:${AWS_REGION}:${AWS_ACCOUNT_ID}:${CLUSTER_NAME}", | ||
"Action": [ | ||
"sqs:DeleteMessage", | ||
"sqs:GetQueueAttributes", | ||
"sqs:GetQueueUrl", | ||
"sqs:ReceiveMessage" | ||
] | ||
}, | ||
{ | ||
"Sid": "AllowPassingInstanceRole", | ||
"Effect": "Allow", | ||
"Resource": "arn:${AWS_PARTITION}:iam::${AWS_ACCOUNT_ID}:role/KarpenterNodeRole-${CLUSTER_NAME}", | ||
"Action": "iam:PassRole", | ||
"Condition": { | ||
"StringEquals": { | ||
"iam:PassedToService": "ec2.amazonaws.com" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters