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

Limit the Random Hash in the MachineSet Name #500

Merged
merged 1 commit into from
Aug 26, 2020
Merged

Limit the Random Hash in the MachineSet Name #500

merged 1 commit into from
Aug 26, 2020

Conversation

AxiomSamarth
Copy link
Contributor

What this PR does / why we need it:
Currently, MachineSet names are with variable length of the random hash. The MCM is also not limiting the random hash in the machineset names. But if we limit the length of the random hash, it will help to reduce the occurrences of the CSI issue till it is fixed upstream

Which issue(s) this PR fixes:
Fixes #461

Special notes for your reviewer:

Release note:

NONE

@AxiomSamarth AxiomSamarth requested review from ggaurav10 and a team as code owners August 20, 2020 06:50
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Aug 20, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 20, 2020
@prashanth26
Copy link
Contributor

/invite @danielfoehrKn I don't think this change hinders the g/g worker actuator code by any chance. However, just wanted you to take a look at this change.

@AxiomSamarth - Also did you confirm though both scenario based testing and code logic that this wouldn't trigger rolling updates of existing machine sets backed by deployments?

@AxiomSamarth
Copy link
Contributor Author

@prashanth26 I tested this with the fresh deployment. I will test to see if this triggers any rolling updates of existing machine sets backed by deployment.

Copy link

@amshuman-kr amshuman-kr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielfoehrKn
Copy link

I don't think this change hinders the g/g worker actuator code by any chance. However, just wanted you to take a look at this change.

The generic worker actuator deploys the Machine Deployment - how the MCM generates the MachineSets etc. is unrelated I think.

@prashanth26
Copy link
Contributor

@danielfoehrKn - Okay thanks for that. I thought the same but wanted to just confirm from you.

@AxiomSamarth
Copy link
Contributor Author

@prashanth26 @hardikdr Perhaps a stupid question. Why do we not simply use GenerateName and let the kube-apiserver figure out the name generation?

@amshuman-kr Hi Amshu, seems like even with the GenerateName, the random hash generated will be 5-8 characters long if I understand correctly. So, again, there is a possibility of variable length. Limiting it to 5 would help avoid that variable length of the machine set name is the assumption in this context.

@prashanth26
Copy link
Contributor

@prashanth26 @hardikdr Perhaps a stupid question. Why do we not simply use GenerateName and let the kube-apiserver figure out the name generation?

Back then this code was copied over from the replicaSet controller code. And this was the code there back then i think. Even now they use kind of similar code ther.

@amshuman-kr
Copy link

Back then this code was copied over from the replicaSet controller code. And this was the code there back then i think. Even now they use kind of similar code ther.

Thanks for the clarification. Is there any hurdle to start using GenerateName now (like support for older kubernetes versions etc.)? If not, I would suggest to start using GenerateName already. Not in all the places in one shot, of course. Just starting here and later in other places when we touch them. WDYT?

@hardikdr
Copy link
Member

hardikdr commented Aug 24, 2020

Is there any hurdle to start using GenerateName now (like support for older kubernetes versions etc.)?

That's actually a good suggestion, and we should probably move to generateName eventually for all the occurrences.
I am not completely aware of all the effects of the move and would like to be a little more cautious before that change.

As this is only a ramp-up task for Samarth, and he is still getting familiar with the code-base, I'd refrain from having him test e2e with this pov.
For now, let's go ahead with the current PR, and later create an issue and follow-up separately for the generateName feature.

Ref : #502

Copy link
Member

@hardikdr hardikdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably cross-check once, if this change has any side-effect on the rolling-update, hopefully not.

/lgtm otherwise.
Thanks for the PR :)

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels Aug 24, 2020
@hardikdr hardikdr added this to the v0.34.0 milestone Aug 25, 2020
Copy link
Contributor

@prashanth26 prashanth26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit the Random Hash in the MachineSet Name
8 participants