Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion modules/karpenter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ resource "aws_iam_role_policy_attachment" "node" {
for_each = { for k, v in merge(
{
AmazonEKSWorkerNodePolicy = "${local.node_iam_role_policy_prefix}/AmazonEKSWorkerNodePolicy"
AmazonEC2ContainerRegistryReadOnly = "${local.node_iam_role_policy_prefix}/AmazonEC2ContainerRegistryReadOnly"
AmazonEC2ContainerRegistryPullOnly = "${local.node_iam_role_policy_prefix}/AmazonEC2ContainerRegistryPullOnly"
},
local.ipv4_cni_policy,
local.ipv6_cni_policy
Expand Down
8 changes: 7 additions & 1 deletion modules/karpenter/policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ data "aws_iam_policy_document" "controller" {
"arn:${local.partition}:ec2:${local.region}:*:network-interface/*",
"arn:${local.partition}:ec2:${local.region}:*:launch-template/*",
"arn:${local.partition}:ec2:${local.region}:*:spot-instances-request/*",
"arn:${local.partition}:ec2:${local.region}:*:capacity-reservation/*"
]
actions = [
"ec2:RunInstances",
Expand Down Expand Up @@ -180,7 +181,6 @@ data "aws_iam_policy_document" "controller" {
sid = "AllowRegionalReadActions"
resources = ["*"]
actions = [
"ec2:DescribeCapacityReservations",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryantbiggs Why was this permission removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davivcgarcia in the time its taken you to post 3+ different messages you could have simply opened a PR to fix this error - try to put a little effort in would ya

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for that, but I didn't know if that was in purpose or not. :-(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearly not - we want to align with the upstream policy but there was an error made in aligning the permissions

"ec2:DescribeAvailabilityZones",
"ec2:DescribeImages",
"ec2:DescribeInstances",
Expand Down Expand Up @@ -349,6 +349,12 @@ data "aws_iam_policy_document" "controller" {
actions = ["iam:GetInstanceProfile"]
}

statement {
sid = "AllowUnscopedInstanceProfileListAction"
resources = ["*"]
actions = ["iam:ListInstanceProfiles"]
}

statement {
sid = "AllowAPIServerEndpointDiscovery"
resources = ["arn:${local.partition}:eks:${local.region}:${local.account_id}:cluster/${var.cluster_name}"]
Expand Down