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

🌱 Topology controller upgrades templates in place when there are only metadata changes #5416

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR makes the topology controller to upgrade templates in place when there are only metadata changes (instead of doing a template rotation, which in turns triggers a machine rollout)

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 11, 2021
@fabriziopandini fabriziopandini requested review from vincepri and removed request for enxebre and JoelSpeed October 11, 2021 10:53
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 11, 2021
@fabriziopandini
Copy link
Member Author

/hold
for the assumptions on the issue to be confirmed

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 11, 2021
@fabriziopandini
Copy link
Member Author

/hold cancel
@sbueringer @vincepri this is ready for review

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 12, 2021
@sbueringer
Copy link
Member

Looks good, very nice optimization only one comment regarding an additional test case

// If there are no changes in the spec, and thus only changes in metadata, instead of doing a full template
// rotation we patch the object in place. This avoids recreating machines.
if !patchHelper.HasSpecChanges() {
log.Infof("Patching %s", tlog.KObj{Obj: in.desired})
Copy link
Member

Choose a reason for hiding this comment

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

should this be log.V(3) consistently with above?

Copy link
Member Author

Choose a reason for hiding this comment

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

All the actual changes are logged at v0, like in this cases, while at v3 we are adding tracing info e.g. surfacing that when we detected no changes.

@fabriziopandini
Copy link
Member Author

fabriziopandini commented Oct 12, 2021

@sbueringer @enxebre comment addressed PTAL

@enxebre
Copy link
Member

enxebre commented Oct 12, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2021
@fabriziopandini fabriziopandini force-pushed the topology-should-upgrade-template-inplace-when-possible branch from eef2cf0 to f185d8c Compare October 12, 2021 19:48
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2021
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve

@vincepri
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit 841bdbb into kubernetes-sigs:main Oct 12, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Oct 12, 2021
@fabriziopandini fabriziopandini deleted the topology-should-upgrade-template-inplace-when-possible branch October 25, 2021 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Topology controller should avoid template rotation in case of changes to template metadata only
5 participants