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

Fix machine creation bootstrap tokens expiration #773

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

schrodit
Copy link
Contributor

What this PR does / why we need it:

The expiration of bootstrap tokens is hardcoded in the machine controller deployment. (depending on the provider but mostly approx. 20min).
There is an option to overwrite this default per worker group with machineCreationTimeout.
This option is considered during the machine creation but not in the bootstrap token.
So this means that if the machine takes more time than 20 minutes to be created, the bootstrap token is already expired and the needed configs cannot be fetched form the cluster.

This PR makes the bootstrap token respect the machines machineCreationTimeout option.

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

Special notes for your reviewer:

Tested with the equinix provider

Release note:

Fix a bug in the bootstrap token creation that caused node to not be able to join the cluster due to an expired bootstrap token.

@schrodit schrodit requested a review from a team as a code owner January 27, 2023 16:20
@gardener-robot
Copy link

@schrodit Thank you for your contribution.

@gardener-robot gardener-robot added needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels Jan 27, 2023
@gardener-robot-ci-3
Copy link
Contributor

Thank you @schrodit for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below.

Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

It is a serious bug , Thanks for the PR Tim!

Comment on lines 94 to 97
expiration := c.safetyOptions.MachineCreationTimeout.Duration
if machine.Spec.MachineConfiguration != nil && machine.Spec.MachineConfiguration.MachineCreationTimeout != nil {
expiration = machine.Spec.MachineConfiguration.MachineCreationTimeout.Duration
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we can use the helper function getEffectiveCreationTimeout for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah didn't know that helper function exists.

Updated the code PTAL.

@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Jan 31, 2023
@himanshu-kun himanshu-kun added the needs/cherry-pick Needs to be cherry-picked to older version label Jan 31, 2023
@himanshu-kun himanshu-kun self-assigned this Jan 31, 2023
Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/changes Needs (more) changes needs/review Needs review labels Jan 31, 2023
@himanshu-kun himanshu-kun 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 Jan 31, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 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 Jan 31, 2023
@himanshu-kun himanshu-kun merged commit 5e9582e into gardener:master Jan 31, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Jan 31, 2023
@himanshu-kun himanshu-kun added this to the v0.49 milestone Mar 20, 2023
@himanshu-kun himanshu-kun removed the needs/cherry-pick Needs to be cherry-picked to older version label Apr 4, 2023
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 size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node cannot join the cluster due to expired bootstrap token
5 participants