diff --git a/pkg/cloudprovider/cloudprovider.go b/pkg/cloudprovider/cloudprovider.go index d03be9193d07..9c02442ccbbd 100644 --- a/pkg/cloudprovider/cloudprovider.go +++ b/pkg/cloudprovider/cloudprovider.go @@ -18,6 +18,7 @@ import ( "context" stderrors "errors" "fmt" + "strings" "time" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -240,7 +241,9 @@ func getTags(ctx context.Context, nodeClass *v1.EC2NodeClass, nodeClaim *karpv1. v1.EKSClusterNameTagKey: options.FromContext(ctx).ClusterName, v1.LabelNodeClass: nodeClass.Name, } - return lo.Assign(nodeClass.Spec.Tags, staticTags) + return lo.Assign(lo.OmitBy(nodeClass.Spec.Tags, func(key string, _ string) bool { + return strings.HasPrefix(key, "kubernetes.io/cluster/") + }), staticTags) } func (c *CloudProvider) resolveNodeClassFromNodeClaim(ctx context.Context, nodeClaim *karpv1.NodeClaim) (*v1.EC2NodeClass, error) {