-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
ReplicaSet naming is inconsistent #121687
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/sig cluster-lifecycle |
/remove-sig cluster-lifecycle |
I'm not sure that's a bug. A better way is to match via labels or via /priority awaiting-more-evidence Also: |
@sftim: Those labels are not set on the issue: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I agree, but there's no reason not to add this small quality of life improvement to help identify resources. In large scale systems, looking through all pods and replicasets for their owners may put a unwanted load on the EKS control plane when using the name directly may be a more reasonable solution. In the end, the proposed change simply makes this option (using names to identify owners) more reliable and consistent. Additionally, there is a low chance that there is a very low number of characters in the suffix which should be considered a bug as the resource names should be obviously "computer generated", i.e. obvious that they are dependents of other resources. For example, there is a 10/4294967295 chance of having a suffix with a single character. This happens if the hash generates number 0-9. |
It can be improved, but using regular expressions to identify ReplicaSets may not be the good approach. This is because the number of random characters is not guaranteed and could change in the future. For example, in the case of Pods, there was an attempt to increase the length of random characters from 5 to 10. In the end, there were several projects relying on parsing random strings, and the PR is currently on hold due to a lack of a good alternative (#116430, gocrane/crane#716). cc: @thockin |
A few thoughts:
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I think we can close this one. As folks mentioned above we don't support or encourage parsing names, and I don't see evidence that RS suffix length could cause issues. |
What happened?
When kubernetes is creating a ReplicaSet automatically through a deployment, the suffix added to the deployment name has an inconsistent length. Although this is not necessarily a bug, this can lead to issues in trying to identify ReplicaSets that were created through deployments using, for instance, RegEx.
This code is responsible for creating a suffix string to add to the deployment name to create the ReplicaSet name. The number created by
podTemplateSpecHasher.Sum32()
is any number from 0 to 4,294,967,295. This means the suffix string after the number goes throughrand.SafeEncodeString
(link) will have a length of 0 to 10.What did you expect to happen?
ReplicaSet names should always have a suffix of consistent length when created automatically via a deployment.
How can we reproduce it (as minimally and precisely as possible)?
Create a number of deployments that will in turn create ReplicaSets. On average, 23% of these ReplicaSets will have suffixes of length 9 or shorter instead of the expected 10.
Anything else we need to know?
An easy solution would be to simply change the code as follows:
There is no risk to a solution like this as it will only go into effect when new ReplicaSet revisions are created and will only make ReplicaSet names more consistent. Any names that would be generated out of a number like 1,234,567 will instead be generated by 0,001,234,567, i.e. there is the same number of possible suffixes as before.
Kubernetes version
Doesn't really matter but:
Cloud provider
Not sure what this means.
The text was updated successfully, but these errors were encountered: