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

Add machine names as etcd name #778

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

apedriza
Copy link
Contributor

@apedriza apedriza commented Oct 15, 2024

Partially fix #768

@apedriza apedriza requested a review from a team as a code owner October 15, 2024 09:41
@apedriza apedriza marked this pull request as draft October 15, 2024 09:42
@apedriza apedriza force-pushed the add_machine_name_as_etcd_name branch from 95c6840 to d2bdb80 Compare October 16, 2024 14:04
return ctrl.Result{}, fmt.Errorf("error retrieving storage.etcd: %w", err)

}
if found && storage != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably need to set it even if it's not found in the original config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I added a check to set it always if kind storage is not set

@apedriza apedriza force-pushed the add_machine_name_as_etcd_name branch 3 times, most recently from 95d6293 to b631780 Compare October 22, 2024 09:29
@apedriza apedriza marked this pull request as ready for review October 22, 2024 09:29
@apedriza apedriza force-pushed the add_machine_name_as_etcd_name branch from b631780 to a47ee0c Compare October 22, 2024 16:16
@apedriza
Copy link
Contributor Author

capi-controlplane-docker test failing. Converting PR to draft until fix it

@apedriza apedriza marked this pull request as draft October 23, 2024 09:00
@apedriza apedriza force-pushed the add_machine_name_as_etcd_name branch from a47ee0c to 195753f Compare October 23, 2024 10:44
@apedriza apedriza marked this pull request as ready for review October 23, 2024 10:49
@@ -155,6 +156,25 @@ func (c *ControlPlaneController) Reconcile(ctx context.Context, req ctrl.Request
)

if config.Spec.K0s != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

A few thoughts:

  • Should we set the field even if user didn't provide us any custom k0s config?
  • At the end of this if statement, we call kutil.ReconcileDynamicConfig, but we probably need to remove the etcd node name from the DynamicConfig.
  • Should the most of the code of this statement be in the control plane controller instead of bootstrap controller?

Copy link
Contributor Author

@apedriza apedriza Oct 24, 2024

Choose a reason for hiding this comment

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

  • Should we set the field even if user didn't provide us any custom k0s config?

Agree. It is already used etcd node name as default value if kine is not set so I think is safe assume that. Added

  • At the end of this if statement, we call kutil.ReconcileDynamicConfig, but we probably need to remove the etcd node name from the DynamicConfig.

Im not sure if I follow your point. It is not removed spec.storage in kutil.ReconcileDynamicConfig from the DynamicConfig?

  • Should the most of the code of this statement be in the control plane controller instead of bootstrap controller?

If you mean to move most of the logic to the place where we create bootstrapv1.K0sControllerConfig Im ok with that. But I think that change should be done carefully, Im not sure exactly what it might imply rn. Maybe addressing that refactoring in another PR makes more sense, wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Im not sure if I follow your point. It is not removed spec.storage in kutil.ReconcileDynamicConfig from the DynamicConfig?

Sorry, missed it. Yeah, that's good then.

Maybe addressing that refactoring in another PR makes more sense, wdyt?

Sorry, I was not clear enough: of course, it's better to do it in a separate PR.

Copy link
Contributor Author

@apedriza apedriza Oct 29, 2024

Choose a reason for hiding this comment

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

Ive created an issue for that refactor #798

@apedriza apedriza force-pushed the add_machine_name_as_etcd_name branch from 195753f to 110c116 Compare October 23, 2024 17:01
@apedriza apedriza marked this pull request as draft October 24, 2024 06:19
@apedriza apedriza force-pushed the add_machine_name_as_etcd_name branch from 110c116 to e7e447e Compare October 24, 2024 08:02
Signed-off-by: Adrian Pedriza <adripedriza@gmail.com>
@apedriza apedriza force-pushed the add_machine_name_as_etcd_name branch from e7e447e to 10f2faa Compare October 24, 2024 08:54
@apedriza apedriza marked this pull request as ready for review October 24, 2024 09:03
@apedriza apedriza merged commit e84413c into k0sproject:main Oct 29, 2024
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clean up controlnodes and etcdmembers after Machine removal
3 participants