Skip to content

feat: support network interface configuration#9027

Merged
ryan-mist merged 17 commits intoaws:mainfrom
ryan-mist:network-interface-support
Apr 1, 2026
Merged

feat: support network interface configuration#9027
ryan-mist merged 17 commits intoaws:mainfrom
ryan-mist:network-interface-support

Conversation

@ryan-mist
Copy link
Copy Markdown
Contributor

@ryan-mist ryan-mist commented Mar 23, 2026

Fixes #N/A

Description

  • adds support for configuring network interfaces on the nodeclass
spec:
  networkInterfaces:
        - networkCardIndex: int
          deviceIndex: int
          interfaceType: "interface" | "efa-only"

How was this change tested?

  • unit tests
  • manual testing

Manual Tests

Drift

# Apply NodeClass with no network interface configuration
ryanmist@c889f3b6ff52 efa % k apply -f nodeclass.yaml
ec2nodeclass.karpenter.k8s.aws/efa-1 created
ryanmist@c889f3b6ff52 efa % k get ec2nodeclass
NAME    READY   AGE
efa-1   True    25s
ryanmist@c889f3b6ff52 efa % k apply -f nodepool.yaml
nodepool.karpenter.sh/i4g-16xlarge-pool created

# Create Node; Launched with No EFA Configurations
ryanmist@c889f3b6ff52 efa % k apply -f pod.yaml
deployment.apps/non-efa-deployment configured
ryanmist@c889f3b6ff52 efa % aws ec2 describe-instances --instance-ids i-030f2ec9b6b7104fa  --query "Reservations[].Instances[].NetworkInterfaces[].InterfaceType"
[
    "interface"
]

# Change NodeClass Configuration 
ryanmist@c889f3b6ff52 efa % k apply -f nodeclass.yaml
ec2nodeclass.karpenter.k8s.aws/efa-1 configured

# Node is Drifted
    Last Transition Time:  2026-03-23T07:34:36Z
    Message:               NodeClassDrift
    Observed Generation:   1
    Reason:                NodeClassDrift
    Status:                True
    Type:                  Drifted

# New Node Launched with EFA
ryanmist@c889f3b6ff52 efa % aws ec2 describe-instances --instance-ids i-0d2a8ae49f5ab9137  --query "Reservations[].Instances[].NetworkInterfaces[].InterfaceType"
[
    "efa-only",
    "interface"
]

Static Provisioning

# Apply NodeClass And Static NodePool
# Multiple NodeClaims provisioned
NAME                      TYPE           CAPACITY   ZONE         NODE   READY     AGE
i4g-16xlarge-pool-dk5sb   i4g.16xlarge   spot       us-west-2d          Unknown   16s
i4g-16xlarge-pool-r5t6h   i4g.16xlarge   spot       us-west-2d          Unknown   30s
# With Correct Allocatable / Capacity 
Status:
  Allocatable:
    vpc.amazonaws.com/efa:      1

Dynamic Provisioning

# When pods does not request EFA - instance is still launched with NodeClass config
ryanmist@c889f3b6ff52 efa % aws ec2 describe-instances --instance-ids i-00bca795a6864fbf7  --query "Reservations[].Instances[].NetworkInterfaces[].InterfaceType"
[
    "interface",
    "efa-only",
    "efa-only",
    "efa-only",
    "efa-only"
]
Allocatable:
    vpc.amazonaws.com/efa:      4
# When pods does request EFA - instance is launched with NodeClass config
ryanmist@c889f3b6ff52 efa % k apply -f efa-pod.yaml
deployment.apps/efa-deployment configured
Resources:
  Requests:
    Cpu:                    1150m
    Memory:                 100Mi
    Pods:                   4
    vpc.amazonaws.com/efa:  1
Status:
  Allocatable:
    Cpu:                        191450m
    Ephemeral - Storage:        17Gi
    Memory:                     1937871Mi
    nvidia.com/gpu:             8
    Pods:                       149
    vpc.amazonaws.com/efa:      4
# When pod requests over EFA resource of NodeClass
ryanmist@c889f3b6ff52 efa % k apply -f efa-pod.yaml
deployment.apps/five-efa-deployment created

From Karpenter Logs
{"level":"ERROR","time":"2026-03-23T08:47:09.824Z","logger":"controller","caller":"scheduling/scheduler.go:257","message":"could not schedule pod","commit":"cfc53f3-dirty","controller":"provisioner","namespace":"","name":"","reconcileID":"38b08750-bb1b-4ed3-9929-d5687cfd95f2","Pod":{"name":"five-efa-deployment-769b5785f6-7nqrs","namespace":"default"},"error":"no instance type has enough resources, requirements=karpenter.k8s.aws/ec2nodeclass In [efa-1], karpenter.sh/nodepool In [efa-pool], kubernetes.io/os In [linux], resources={\"cpu\":\"1150m\",\"memory\":\"100Mi\",\"pods\":\"4\",\"vpc.amazonaws.com/efa\":\"5\"}"}
# When pod requests EFA w/ NodeClass with no Network Interface Configurations
ryanmist@c889f3b6ff52 efa % k apply -f efa-pod.yaml
deployment.apps/efa-deployment configured
ryanmist@c889f3b6ff52 efa % aws ec2 describe-instances --instance-ids i-035054426a7520613  --query "Reservations[].Instances[].NetworkInterfaces[].InterfaceType"
[
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa",
    "efa"
]

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ryan-mist ryan-mist force-pushed the network-interface-support branch from cfc53f3 to ecb1e4f Compare March 23, 2026 15:52
@ryan-mist ryan-mist requested a review from a team as a code owner March 23, 2026 15:52
@ryan-mist ryan-mist requested a review from azishabibi March 23, 2026 15:52
Copy link
Copy Markdown

@nathangeology nathangeology left a comment

Choose a reason for hiding this comment

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

Hope these comments help. Let me know if you have any questions.

Comment thread pkg/providers/instance/instance.go
Comment thread pkg/providers/instancetype/offering/offering.go
Comment thread pkg/providers/launchtemplate/launchtemplate.go Outdated
Comment thread pkg/controllers/nodeclass/validation.go Outdated
Comment thread pkg/providers/instancetype/compatibility/compatibility.go Outdated
Comment thread pkg/providers/instancetype/compatibility/compatibility.go
Comment thread pkg/apis/v1/labels.go Outdated
Comment thread pkg/cloudprovider/cloudprovider.go
Comment thread pkg/apis/v1/ec2nodeclass.go
Comment thread pkg/apis/v1/labels.go Outdated
Comment thread pkg/providers/instance/instance.go
Comment thread pkg/providers/instancetype/compatibility/compatibility.go Outdated
Comment thread pkg/providers/instancetype/compatibility/compatibility.go Outdated
Comment thread pkg/providers/instancetype/offering/offering.go
Comment thread pkg/apis/v1/ec2nodeclass.go
Comment thread pkg/controllers/nodeclass/validation_test.go Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Preview deployment ready!

Preview URL: https://pr-9027.d18coufmbnnaag.amplifyapp.com

Built from commit 7979c6d7162c4fd851aa48ee350bc562071e8205

@ryan-mist ryan-mist force-pushed the network-interface-support branch from de1c210 to 8a4ebc3 Compare March 26, 2026 01:33
Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-936b08d1884d1646c503ae66f451c7eb2a87d0c9.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-936b08d1884d1646c503ae66f451c7eb2a87d0c9" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-bbcdb60da8d671b2491de2e789ad84fd476a76ff.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-bbcdb60da8d671b2491de2e789ad84fd476a76ff" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Comment thread pkg/apis/v1/ec2nodeclass.go
@ryan-mist ryan-mist force-pushed the network-interface-support branch from bbcdb60 to 27fffb3 Compare March 27, 2026 01:33
Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-27fffb37a48dbadb9cbcc8e57c81bbd2e4da8b0e.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-27fffb37a48dbadb9cbcc8e57c81bbd2e4da8b0e" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-ff174646bcfc676c072f846dfe3bff5eb52945aa.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-ff174646bcfc676c072f846dfe3bff5eb52945aa" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Comment thread pkg/providers/instancetype/compatibility/compatibility.go Outdated
Comment thread pkg/cloudprovider/suite_test.go Outdated
@ryan-mist ryan-mist force-pushed the network-interface-support branch from b3e4a5e to 57b0329 Compare March 30, 2026 16:50
Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-57b0329ec8c2dda0547dd43fdaf244f1aaa08eef.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-57b0329ec8c2dda0547dd43fdaf244f1aaa08eef" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

@ryan-mist ryan-mist force-pushed the network-interface-support branch from 22cc9be to 097e3fe Compare March 31, 2026 08:48
@ryan-mist ryan-mist force-pushed the network-interface-support branch from 097e3fe to c31964e Compare March 31, 2026 08:51
Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-74ef6f74363ff90bf2af58fac69f0c260c9faf0c.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-74ef6f74363ff90bf2af58fac69f0c260c9faf0c" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Comment thread pkg/providers/instance/instance.go Outdated
Comment thread pkg/providers/instancetype/types.go
Comment thread pkg/providers/launchtemplate/launchtemplate.go Outdated
Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-930348c626cfa4137edbf96ec87c74e4bc72b95d.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-930348c626cfa4137edbf96ec87c74e4bc72b95d" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

@ryan-mist ryan-mist force-pushed the network-interface-support branch from efef3b7 to 7979c6d Compare April 1, 2026 06:20
Copy link
Copy Markdown
Contributor Author

@ryan-mist ryan-mist left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-7979c6d7162c4fd851aa48ee350bc562071e8205.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-7979c6d7162c4fd851aa48ee350bc562071e8205" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Copy link
Copy Markdown
Contributor

@jmdeal jmdeal left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@ryan-mist ryan-mist enabled auto-merge (squash) April 1, 2026 18:34
@ryan-mist ryan-mist disabled auto-merge April 1, 2026 18:34
@ryan-mist ryan-mist enabled auto-merge (squash) April 1, 2026 18:34
@ryan-mist ryan-mist disabled auto-merge April 1, 2026 18:34
@ryan-mist ryan-mist merged commit 1de6d8c into aws:main Apr 1, 2026
35 of 38 checks passed
@ryan-mist ryan-mist deleted the network-interface-support branch April 1, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants