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

Add support for allow/deny regexp(s) in instanceSelector #8247

Conversation

dims
Copy link
Contributor

@dims dims commented Feb 24, 2025

xref: #3718

It is useful to have expose allow and deny functionality already in ec2-instance-selector as i don't see any other helpful feature/future suggestions in #3718 are happening anytime soon.

Tested with the following config by hand in addition to the test case:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: your-cluster-name
  region: us-west-2

managedNodeGroups:
  - name: worker-1c-spot-2-v5
    minSize: 0
    maxSize: 60
    privateNetworking: true
    labels:
      unimed.de/nodegroup: worker
    amiFamily: Bottlerocket
    iam:
      withAddonPolicies:
        autoScaler: true
        efs: true
        ebs: true
        cloudWatch: true
    taints:
      - key: nodegroup
        value: worker
        effect: NoSchedule
    propagateASGTags: true
    instanceSelector:
      vCPUs: 8
      memory: 16GiB
      cpuArchitecture: x86_64

without any allow/deny statements you will see following instanceTypes:

  instanceTypes:
  - c5.2xlarge
  - c5a.2xlarge
  - c5d.2xlarge
  - c6a.2xlarge
  - c6i.2xlarge
  - c6id.2xlarge
  - c6in.2xlarge
  - c7a.2xlarge
  - c7i-flex.2xlarge
  - c7i.2xlarge
  - inf1.2xlarge

then added various combinations of allow and deny to make sure the list of instance types matches what is expected.

example:

allow : "c5[a-d]+.*"
deny : "inf1.*"

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
@dims
Copy link
Contributor Author

dims commented Feb 24, 2025

cc @bryantbiggs

@dims dims merged commit 270bd7a into eksctl-io:main Feb 24, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants