Skip to content

Move Kurator resource key information to annotations #606

@LiZhenCheng9527

Description

@LiZhenCheng9527

What would you like to be added:
Ensuring name uniqueness for application resources distributed to managed clusters

Currently, Kurator concatenates the resource.Name, Cluster.Kind and Cluster.Name when distributing application resources to managed clusters, to ensure uniqueness of names.

func generatePolicyResourceName(policyName, clusterKind, clusterName string) string {
	return policyName + "-" + clusterKind + "-" + clusterName
}

However, this approach runs the risk of generating very long names.

To address the issue of name length being too long, we can store the generated resource name in an annotation instead.

The resource can then directly use its original name. Meanwhile, a UID will be generated and recorded in the resource label to enable future retrieval through label selectors.

resourcebinding.kurator.dev/uid: 93162d3c-ee8e-4995-9034-05f4d5d2c2b9

Why is this needed:

When distributing Kubernetes resources as part of application deployments across multiple managed clusters, long generated names can cause resource creation to fail.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions