Sitelet https://github.com/kubernetes/kops/pull/18113
Skip to content

Add excludedInstanceTypes to instanceRequirements - #18113

Merged
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
HealthengineAU:exclude-node-types
Mar 27, 2026
Merged

k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
HealthengineAU:exclude-node-types

Conversation

@jim-barber-he

Copy link
Copy Markdown
Contributor

When defining instanceRequirements in the mixedInstancesPolicy for an instance group, allow defining a list of instance types that can be excluded from the set of eligible instances using a new excludedInstanceTypes field.

When defining instanceRequirements in the mixedInstancesPolicy for an
instance group, allow defining a list of instance types that can be
excluded from the set of eligible instances using a new
excludedInstanceTypes field.
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 26, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @jim-barber-he. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 26, 2026
@k8s-ci-robot
k8s-ci-robot requested a review from johngmyers March 26, 2026 05:36
@k8s-ci-robot
k8s-ci-robot requested a review from olemarkus March 26, 2026 05:36
@k8s-ci-robot k8s-ci-robot added area/documentation area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 26, 2026
@jim-barber-he

Copy link
Copy Markdown
Contributor Author

The reason I have raised this PR is because the AWS VPC CNI doesn't work on t2 AWS instances when using Ubuntu 24.04 images.
The networking doesn't seem to come up fully for some reason.
The AWS VPC CNI works on t2 instances when using Ubuntu 22.04 images, but I don't want to have to lock to them forever.

To test I spun up a cluster with the node instance group using this in the spec

  mixedInstancesPolicy:
    instanceRequirements:
      cpu:
        max: "4"
        min: "4"
      excludedInstanceTypes:
        - t2.*
      memory:
        max: "16384M"
        min: "16384M"

The Auto Scaling Group (ASG) in AWS shows this under the Instance type requirements heading of the Details tab:
image

Then I edited the instance group and changed it to this:

  mixedInstancesPolicy:
    instanceRequirements:
      cpu:
        max: "4"
        min: "4"
      excludedInstanceTypes:
        - t2.*
        - t3.*
      memory:
        max: "16384M"
        min: "16384M"

The kops update cluster shows:

Will modify resources:
  AutoscalingGroup/node.test3.he0.io
        MixedInstanceOverrides   [] -> <nil>
        InstanceRequirements     {"Architecture":null,"CPUMin":4,"CPUMax":4,"MemoryMin":null,"MemoryMax":16384,"ExcludedInstanceTypes":["t2.*"]} -> {"Architecture":null,"CPUMin":4,"CPUMax":4,"MemoryMin":16384,"MemoryMax":16384,"ExcludedInstanceTypes":["t2.*","t3.*"]}

And the result in the ASG is:
image

Finally I edited the instance group and removed:

      excludedInstanceTypes:
        - t2.*
        - t3.*

The kops update cluster shows:

Will modify resources:
  AutoscalingGroup/node.test3.he0.io
        MixedInstanceOverrides   [] -> <nil>
        InstanceRequirements     {"Architecture":null,"CPUMin":4,"CPUMax":4,"MemoryMin":null,"MemoryMax":16384,"ExcludedInstanceTypes":["t2.*","t3.*"]} -> {"Architecture":null,"CPUMin":4,"CPUMax":4,"MemoryMin":16384,"MemoryMax":16384,"ExcludedInstanceTypes":null}

And the Exclude instances part of the Instance type requirements section of the ASG is no longer showing because there are no instances being excluded anymore.

@hakman

hakman commented Mar 27, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 27, 2026
@@ -49,6 +50,9 @@ func findInstanceRequirements(asg *autoscalingtypes.AutoScalingGroup) (*Instance
actual.MemoryMax = override.InstanceRequirements.MemoryMiB.Max
actual.MemoryMax = override.InstanceRequirements.MemoryMiB.Min

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unrelated bug, but good occasion to fix.

Suggested change
actual.MemoryMax = override.InstanceRequirements.MemoryMiB.Min
actual.MemoryMin = override.InstanceRequirements.MemoryMiB.Min

@hakman

hakman commented Mar 27, 2026

Copy link
Copy Markdown
Member

Thanks @jim-barber-he, nice update. If you get a chance could you send another PR to fix the unrelated small bug?
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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

The pull request process is described here

Details 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 Mar 27, 2026
k8s-ci-robot added a commit that referenced this pull request Mar 27, 2026
…-upstream-release-1.35

Automated cherry pick of #18113: Add excludedInstanceTypes to instanceRequirements
@k8s-triage-robot

Copy link
Copy Markdown

Retesting failed PR that otherwise appears ready for merge.

Please help us fix flaky tests by following our Flaky Tests Guide.

Prevent this bot from retesting with /lgtm cancel or /hold.
For this robot's configuration, see here.

/retest-required

@k8s-ci-robot
k8s-ci-robot merged commit 885952a into kubernetes:master Mar 27, 2026
26 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.36 milestone Mar 27, 2026
@jim-barber-he
jim-barber-he deleted the exclude-node-types branch March 28, 2026 00:27
@jim-barber-he

Copy link
Copy Markdown
Contributor Author

Thanks @jim-barber-he, nice update. If you get a chance could you send another PR to fix the unrelated small bug? /lgtm /approve

@hakman Yeah I can raise another PR for that bug.

Now that this PR is merged, do you want me to raise a PR to cherry pick it into the release-1.35 branch so that it ends up in the kOps 1.35.1 release?
Or is that something you'll do anyway?

@hakman

hakman commented Mar 28, 2026

Copy link
Copy Markdown
Member

@hakman Yeah I can raise another PR for that bug.

👍

Now that this PR is merged, do you want me to raise a PR to cherry pick it into the release-1.35 branch so that it ends up in the kOps 1.35.1 release? Or is that something you'll do anyway?

Already done, see #18119.

@jim-barber-he

Copy link
Copy Markdown
Contributor Author

@hakman The PR to fix the unrelated bug above:
#18123

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/api area/documentation area/provider/aws Issues or PRs related to aws provider 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants