Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Kurator resource key information to annotations #606

Open
LiZhenCheng9527 opened this issue Feb 21, 2024 · 1 comment
Open

Move Kurator resource key information to annotations #606

LiZhenCheng9527 opened this issue Feb 21, 2024 · 1 comment
Assignees

Comments

@LiZhenCheng9527
Copy link
Contributor

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.

@LiZhenCheng9527
Copy link
Contributor Author

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant