@@ -28,6 +28,7 @@ const (
2828
2929 labelEKSComputeType = "eks.amazonaws.com/compute-type"
3030 labelSageMakerComputeType = "sagemaker.amazonaws.com/compute-type"
31+ hybridNetworkInterfaceID = "hybrid-no-eni"
3132)
3233
3334// PodENIInfoResolver is responsible for resolve the AWS VPC ENI that supports pod network.
@@ -176,6 +177,18 @@ func (r *defaultPodENIInfoResolver) resolvePodsViaCascadedLookup(ctx context.Con
176177 }
177178 }
178179 }
180+ // Hybrid pods don't have ENIs - they're connected via Direct Connect
181+ // We'll handle them specially in the networking manager
182+ if len (podsByComputeType .hybridPods ) > 0 {
183+ // Return empty ENI info for hybrid pods - they'll be handled specially
184+ for _ , pod := range podsByComputeType .hybridPods {
185+ eniInfoByPodKey [pod .Key ] = ENIInfo {
186+ // Use a special identifier to mark this as a hybrid pod
187+ NetworkInterfaceID : hybridNetworkInterfaceID ,
188+ SecurityGroups : []string {},
189+ }
190+ }
191+ }
179192 return eniInfoByPodKey , nil
180193}
181194
@@ -401,14 +414,15 @@ func (r *defaultPodENIInfoResolver) isPodSupportedByNodeENI(pod k8s.PodInfo, nod
401414 return false
402415}
403416
404- // PodsByComputeType groups pods based on their compute type (EC2, Fargate, SageMaker HyperPod)
417+ // PodsByComputeType groups pods based on their compute type (EC2, Fargate, SageMaker HyperPod, Hybrid )
405418type PodsByComputeType struct {
406419 ec2Pods []k8s.PodInfo
407420 fargatePods []k8s.PodInfo
408421 sageMakerHyperPodPods []k8s.PodInfo
422+ hybridPods []k8s.PodInfo
409423}
410424
411- // classifyPodsByComputeType classifies in to ec2, fargate and sagemaker-hyperpod groups
425+ // classifyPodsByComputeType classifies in to ec2, fargate, sagemaker-hyperpod and hybrid groups
412426func (r * defaultPodENIInfoResolver ) classifyPodsByComputeType (ctx context.Context , pods []k8s.PodInfo ) (PodsByComputeType , error ) {
413427 var podsByComputeType PodsByComputeType
414428 nodeNameByComputeType := make (map [string ]string )
@@ -418,9 +432,12 @@ func (r *defaultPodENIInfoResolver) classifyPodsByComputeType(ctx context.Contex
418432 podsByComputeType .fargatePods = append (podsByComputeType .fargatePods , pod )
419433 } else if nodeNameByComputeType [pod .NodeName ] == "sagemaker-hyperpod" {
420434 podsByComputeType .sageMakerHyperPodPods = append (podsByComputeType .sageMakerHyperPodPods , pod )
435+ } else if nodeNameByComputeType [pod .NodeName ] == "hybrid" {
436+ podsByComputeType .hybridPods = append (podsByComputeType .hybridPods , pod )
421437 } else {
422438 podsByComputeType .ec2Pods = append (podsByComputeType .ec2Pods , pod )
423439 }
440+ continue // Skip the rest of the loop iteration since we already processed this pod
424441 }
425442
426443 nodeKey := types.NamespacedName {Name : pod .NodeName }
@@ -434,6 +451,9 @@ func (r *defaultPodENIInfoResolver) classifyPodsByComputeType(ctx context.Contex
434451 } else if node .Labels [labelSageMakerComputeType ] == "hyperpod" {
435452 podsByComputeType .sageMakerHyperPodPods = append (podsByComputeType .sageMakerHyperPodPods , pod )
436453 nodeNameByComputeType [pod .NodeName ] = "sagemaker-hyperpod"
454+ } else if node .Labels [labelEKSComputeType ] == "hybrid" {
455+ podsByComputeType .hybridPods = append (podsByComputeType .hybridPods , pod )
456+ nodeNameByComputeType [pod .NodeName ] = "hybrid"
437457 } else {
438458 podsByComputeType .ec2Pods = append (podsByComputeType .ec2Pods , pod )
439459 nodeNameByComputeType [pod .NodeName ] = "ec2"
0 commit comments