@@ -411,7 +411,8 @@ func (r *KarpenterMachinePoolReconciler) createOrUpdateEC2NodeClass(ctx context.
411
411
ec2NodeClass := & unstructured.Unstructured {}
412
412
ec2NodeClass .SetGroupVersionKind (ec2NodeClassGVR .GroupVersion ().WithKind ("EC2NodeClass" ))
413
413
ec2NodeClass .SetName (karpenterMachinePool .Name )
414
- ec2NodeClass .SetNamespace ("default" )
414
+ ec2NodeClass .SetNamespace ("" )
415
+ ec2NodeClass .SetLabels (map [string ]string {"app.kubernetes.io/managed-by" : "aws-resolver-rules-operator" })
415
416
416
417
// Generate user data for Ignition
417
418
userData := r .generateUserData (awsCluster .Spec .S3Bucket .Name , cluster .Name , karpenterMachinePool .Name )
@@ -526,7 +527,8 @@ func (r *KarpenterMachinePoolReconciler) createOrUpdateNodePool(ctx context.Cont
526
527
nodePool := & unstructured.Unstructured {}
527
528
nodePool .SetGroupVersionKind (nodePoolGVR .GroupVersion ().WithKind ("NodePool" ))
528
529
nodePool .SetName (karpenterMachinePool .Name )
529
- nodePool .SetNamespace ("default" )
530
+ nodePool .SetNamespace ("" )
531
+ nodePool .SetLabels (map [string ]string {"app.kubernetes.io/managed-by" : "aws-resolver-rules-operator" })
530
532
531
533
// Set default requirements and overwrite with the user provided configuration
532
534
requirements := []map [string ]interface {}{
@@ -572,6 +574,8 @@ func (r *KarpenterMachinePoolReconciler) createOrUpdateNodePool(ctx context.Cont
572
574
requirements = append (requirements , requirement )
573
575
}
574
576
}
577
+ nodePool .SetNamespace ("" )
578
+ nodePool .SetLabels (map [string ]string {"app.kubernetes.io/managed-by" : "aws-resolver-rules-operator" })
575
579
576
580
// Set default labels and overwrite with the user provided configuration
577
581
labels := map [string ]string {
@@ -603,7 +607,7 @@ func (r *KarpenterMachinePoolReconciler) createOrUpdateNodePool(ctx context.Cont
603
607
"value" : "true" ,
604
608
},
605
609
},
606
- "requirements" : requirements ,
610
+ "requirements" : karpenterMachinePool . Spec . NodePool . Template . Spec . Requirements ,
607
611
"nodeClassRef" : map [string ]interface {}{
608
612
"group" : "karpenter.k8s.aws" ,
609
613
"kind" : "EC2NodeClass" ,
0 commit comments