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

[eks-prow-build] Upgrade karpenter to v1.0.2 #7345

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

koksay
Copy link
Contributor

@koksay koksay commented Sep 26, 2024

This PR will upgrade karpenter and karpenter-crd helmreleases to v1.0.2.

v1.0 migration requires some updates on the IAM side, this will be provided by adding enable_v1_permissions = true to karpenter.tf and running terraform.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 26, 2024
@k8s-ci-robot k8s-ci-robot added area/infra Infrastructure management, infrastructure design, code in infra/ area/infra/aws Issues or PRs related to Kubernetes AWS infrastructure sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 26, 2024
@koksay
Copy link
Contributor Author

koksay commented Sep 26, 2024

This is the terraform plan output. It includes some addon updates, as well as bottlerocket update for the stable nodes:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.eks.aws_eks_addon.this["aws-ebs-csi-driver"] will be updated in-place
  ~ resource "aws_eks_addon" "this" {
      ~ addon_version               = "v1.33.0-eksbuild.1" -> "v1.35.0-eksbuild.1"
        id                          = "prow-build-cluster:aws-ebs-csi-driver"
        tags                        = {}
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.eks.aws_eks_addon.this["coredns"] will be updated in-place
  ~ resource "aws_eks_addon" "this" {
      ~ addon_version               = "v1.11.1-eksbuild.11" -> "v1.11.3-eksbuild.1"
        id                          = "prow-build-cluster:coredns"
        tags                        = {}
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.eks.aws_eks_addon.this["eks-pod-identity-agent"] will be updated in-place
  ~ resource "aws_eks_addon" "this" {
      ~ addon_version               = "v1.3.0-eksbuild.1" -> "v1.3.2-eksbuild.2"
        id                          = "prow-build-cluster:eks-pod-identity-agent"
        tags                        = {}
        # (11 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.eks.aws_eks_addon.this["kube-proxy"] will be updated in-place
  ~ resource "aws_eks_addon" "this" {
      ~ addon_version               = "v1.30.3-eksbuild.2" -> "v1.30.3-eksbuild.5"
        id                          = "prow-build-cluster:kube-proxy"
        tags                        = {}
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.eks.aws_eks_addon.this["vpc-cni"] will be updated in-place
  ~ resource "aws_eks_addon" "this" {
      ~ addon_version               = "v1.18.3-eksbuild.2" -> "v1.18.3-eksbuild.3"
        id                          = "prow-build-cluster:vpc-cni"
        tags                        = {}
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.karpenter.aws_iam_policy.controller[0] will be updated in-place
  ~ resource "aws_iam_policy" "controller" {
        id               = "arn:aws:iam::468814281478:policy/KarpenterController-2024072911501951240000000b"
        name             = "KarpenterController-2024072911501951240000000b"
      ~ policy           = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Resource = [
                          - "arn:aws:ec2:*::snapshot/*",
                          - "arn:aws:ec2:*::image/*",
                          - "arn:aws:ec2:*:*:subnet/*",
                          - "arn:aws:ec2:*:*:spot-instances-request/*",
                          - "arn:aws:ec2:*:*:security-group/*",
                          - "arn:aws:ec2:*:*:launch-template/*",
                          + "arn:aws:ec2:us-east-2::snapshot/*",
                          + "arn:aws:ec2:us-east-2::image/*",
                          + "arn:aws:ec2:us-east-2:*:subnet/*",
                          + "arn:aws:ec2:us-east-2:*:security-group/*",
                        ]
                      ~ Sid      = "AllowScopedEC2InstanceActions" -> "AllowScopedEC2InstanceAccessActions"
                        # (2 unchanged attributes hidden)
                    },
                  ~ {
                      ~ Action    = [
                            "ec2:RunInstances",
                          - "ec2:CreateLaunchTemplate",
                            "ec2:CreateFleet",
                        ]
                      ~ Condition = {
                          ~ StringEquals = {
                              - "aws:RequestTag/kubernetes.io/cluster/prow-build-cluster"  = "owned"
                              + "aws:ResourceTag/kubernetes.io/cluster/prow-build-cluster" = "owned"
                            }
                          ~ StringLike   = {
                              - "aws:RequestTag/karpenter.sh/nodepool"  = "*"
                              + "aws:ResourceTag/karpenter.sh/nodepool" = "*"
                            }
                        }
                      ~ Resource  = [
                          - "arn:aws:ec2:*:*:volume/*",
                          - "arn:aws:ec2:*:*:spot-instances-request/*",
                          - "arn:aws:ec2:*:*:network-interface/*",
                          - "arn:aws:ec2:*:*:launch-template/*",
                          - "arn:aws:ec2:*:*:instance/*",
                          - "arn:aws:ec2:*:*:fleet/*",
                        ] -> "arn:aws:ec2:us-east-2:*:launch-template/*"
                      ~ Sid       = "AllowScopedEC2InstanceActionsWithTags" -> "AllowScopedEC2LaunchTemplateAccessActions"
                        # (1 unchanged attribute hidden)
                    },
                  ~ {
                      ~ Action    = "ec2:CreateTags" -> [
                          + "ec2:RunInstances",
                          + "ec2:CreateLaunchTemplate",
                          + "ec2:CreateFleet",
                        ]
                      ~ Condition = {
                          ~ StringEquals = {
                              + "aws:RequestTag/eks:eks-cluster-name"                     = "prow-build-cluster"
                              - "ec2:CreateAction"                                        = [
                                  - "RunInstances",
                                  - "CreateFleet",
                                  - "CreateLaunchTemplate",
                                ]
                                # (1 unchanged attribute hidden)
                            }
                            # (1 unchanged attribute hidden)
                        }
                      ~ Resource  = [
                          ~ "arn:aws:ec2:*:*:volume/*" -> "arn:aws:ec2:us-east-2:*:volume/*",
                          ~ "arn:aws:ec2:*:*:spot-instances-request/*" -> "arn:aws:ec2:us-east-2:*:spot-instances-request/*",
                          ~ "arn:aws:ec2:*:*:network-interface/*" -> "arn:aws:ec2:us-east-2:*:network-interface/*",
                          ~ "arn:aws:ec2:*:*:launch-template/*" -> "arn:aws:ec2:us-east-2:*:launch-template/*",
                          ~ "arn:aws:ec2:*:*:instance/*" -> "arn:aws:ec2:us-east-2:*:instance/*",
                          ~ "arn:aws:ec2:*:*:fleet/*" -> "arn:aws:ec2:us-east-2:*:fleet/*",
                        ]
                      ~ Sid       = "AllowScopedResourceCreationTagging" -> "AllowScopedEC2InstanceActionsWithTags"
                        # (1 unchanged attribute hidden)
                    },
                  ~ {
                      ~ Condition = {
                          - "ForAllValues:StringEquals" = {
                              - "aws:TagKeys" = [
                                  - "karpenter.sh/nodeclaim",
                                  - "Name",
                                ]
                            }
                          ~ StringEquals                = {
                              + "aws:RequestTag/eks:eks-cluster-name"                      = "prow-build-cluster"
                              + "aws:RequestTag/kubernetes.io/cluster/prow-build-cluster"  = "owned"
                              - "aws:ResourceTag/kubernetes.io/cluster/prow-build-cluster" = "owned"
                              + "ec2:CreateAction"                                         = [
                                  + "RunInstances",
                                  + "CreateFleet",
                                  + "CreateLaunchTemplate",
                                ]
                            }
                          ~ StringLike                  = {
                              + "aws:RequestTag/karpenter.sh/nodepool"  = "*"
                              - "aws:ResourceTag/karpenter.sh/nodepool" = "*"
                            }
                        }
                      ~ Resource  = "arn:aws:ec2:*:*:instance/*" -> [
                          + "arn:aws:ec2:us-east-2:*:volume/*",
                          + "arn:aws:ec2:us-east-2:*:spot-instances-request/*",
                          + "arn:aws:ec2:us-east-2:*:network-interface/*",
                          + "arn:aws:ec2:us-east-2:*:launch-template/*",
                          + "arn:aws:ec2:us-east-2:*:instance/*",
                          + "arn:aws:ec2:us-east-2:*:fleet/*",
                        ]
                      ~ Sid       = "AllowScopedResourceTagging" -> "AllowScopedResourceCreationTagging"
                        # (2 unchanged attributes hidden)
                    },
                  ~ {
                      ~ Action    = [
                          - "ec2:TerminateInstances",
                          - "ec2:DeleteLaunchTemplate",
                        ] -> "ec2:CreateTags"
                      ~ Condition = {
                          + "ForAllValues:StringEquals" = {
                              + "aws:TagKeys" = [
                                  + "eks:eks-cluster-name",
                                  + "karpenter.sh/nodeclaim",
                                  + "Name",
                                ]
                            }
                          + StringEqualsIfExists        = {
                              + "aws:RequestTag/eks:eks-cluster-name" = "prow-build-cluster"
                            }
                            # (2 unchanged attributes hidden)
                        }
                      ~ Resource  = [
                          - "arn:aws:ec2:*:*:launch-template/*",
                          - "arn:aws:ec2:*:*:instance/*",
                        ] -> "arn:aws:ec2:us-east-2:*:instance/*"
                      ~ Sid       = "AllowScopedDeletion" -> "AllowScopedResourceTagging"
                        # (1 unchanged attribute hidden)
                    },
                  + {
                      + Action    = [
                          + "ec2:TerminateInstances",
                          + "ec2:DeleteLaunchTemplate",
                        ]
                      + Condition = {
                          + StringEquals = {
                              + "aws:ResourceTag/kubernetes.io/cluster/prow-build-cluster" = "owned"
                            }
                          + StringLike   = {
                              + "aws:ResourceTag/karpenter.sh/nodepool" = "*"
                            }
                        }
                      + Effect    = "Allow"
                      + Resource  = [
                          + "arn:aws:ec2:us-east-2:*:launch-template/*",
                          + "arn:aws:ec2:us-east-2:*:instance/*",
                        ]
                      + Sid       = "AllowScopedDeletion"
                    },
                    {
                        Action    = [
                            "ec2:DescribeSubnets",
                            "ec2:DescribeSpotPriceHistory",
                            "ec2:DescribeSecurityGroups",
                            "ec2:DescribeLaunchTemplates",
                            "ec2:DescribeInstances",
                            "ec2:DescribeInstanceTypes",
                            "ec2:DescribeInstanceTypeOfferings",
                            "ec2:DescribeImages",
                            "ec2:DescribeAvailabilityZones",
                        ]
                        Condition = {
                            StringEquals = {
                                "aws:RequestedRegion" = "us-east-2"
                            }
                        }
                        Effect    = "Allow"
                        Resource  = "*"
                        Sid       = "AllowRegionalReadActions"
                    },
                    # (1 unchanged element hidden)
                    {
                        Action   = "pricing:GetProducts"
                        Effect   = "Allow"
                        Resource = "*"
                        Sid      = "AllowPricingReadActions"
                    },
                  ~ {
                      ~ Action   = [
                            # (1 unchanged element hidden)
                            "sqs:GetQueueUrl",
                          - "sqs:GetQueueAttributes",
                            "sqs:DeleteMessage",
                        ]
                        # (3 unchanged attributes hidden)
                    },
                    {
                        Action    = "iam:PassRole"
                        Condition = {
                            StringEquals = {
                                "iam:PassedToService" = "ec2.amazonaws.com"
                            }
                        }
                        Effect    = "Allow"
                        Resource  = "arn:aws:iam::468814281478:role/karpenter-nodes"
                        Sid       = "AllowPassingInstanceRole"
                    },
                  ~ {
                      ~ Condition = {
                          ~ StringEquals = {
                              + "aws:RequestTag/eks:eks-cluster-name"                     = "prow-build-cluster"
                                # (2 unchanged attributes hidden)
                            }
                            # (1 unchanged attribute hidden)
                        }
                      ~ Resource  = "*" -> "arn:aws:iam::468814281478:instance-profile/*"
                        # (3 unchanged attributes hidden)
                    },
                  ~ {
                      ~ Condition = {
                          ~ StringEquals = {
                              + "aws:RequestTag/eks:eks-cluster-name"                      = "prow-build-cluster"
                              + "aws:RequestTag/topology.kubernetes.io/region"             = "us-east-2"
                                # (3 unchanged attributes hidden)
                            }
                            # (1 unchanged attribute hidden)
                        }
                      ~ Resource  = "*" -> "arn:aws:iam::468814281478:instance-profile/*"
                        # (3 unchanged attributes hidden)
                    },
                  ~ {
                      ~ Resource  = "*" -> "arn:aws:iam::468814281478:instance-profile/*"
                        # (4 unchanged attributes hidden)
                    },
                  ~ {
                      ~ Resource = "*" -> "arn:aws:iam::468814281478:instance-profile/*"
                        # (3 unchanged attributes hidden)
                    },
                    {
                        Action   = "eks:DescribeCluster"
                        Effect   = "Allow"
                        Resource = "arn:aws:eks:us-east-2:468814281478:cluster/prow-build-cluster"
                        Sid      = "AllowAPIServerEndpointDiscovery"
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        tags             = {
            "Cluster" = "prow-build-cluster"
        }
        # (7 unchanged attributes hidden)
    }

  # module.eks.module.eks_managed_node_group["stable"].aws_eks_node_group.this[0] will be updated in-place
  ~ resource "aws_eks_node_group" "this" {
        id                     = "prow-build-cluster:managed-stable-20240108155006589600000006"
      ~ release_version        = "1.21.1-82691b51" -> "1.23.0-74970be4"
        tags                   = {
            "Cluster" = "prow-build-cluster"
            "Name"    = "managed-stable"
        }
        # (16 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

Plan: 0 to add, 7 to change, 0 to destroy.

@koksay
Copy link
Contributor Author

koksay commented Sep 26, 2024

/assign @xmudrii
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2024
@koksay
Copy link
Contributor Author

koksay commented Sep 26, 2024

Currently:

  • Stable nodes: Bottlerocket OS 1.21.1 (aws-k8s-1.30)
  • Karpenter nodes: Bottlerocket OS 1.23.0 (aws-k8s-1.30)

Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

:shipit:
/lgtm
/approve
/hold
unhold when ready

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 26, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: koksay, xmudrii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 26, 2024
@koksay
Copy link
Contributor Author

koksay commented Sep 26, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2024
@k8s-ci-robot k8s-ci-robot merged commit 305610e into kubernetes:main Sep 26, 2024
3 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.32 milestone Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/infra/aws Issues or PRs related to Kubernetes AWS infrastructure area/infra Infrastructure management, infrastructure design, code in infra/ cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants