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

Optimize inplace update and support pod-template-hash label for cloneset #931

Conversation

FillZpp
Copy link
Member

@FillZpp FillZpp commented Mar 18, 2022

Signed-off-by: FillZpp FillZpp.pub@gmail.com

Ⅰ. Describe what this PR does

Optimize inplace update and support pod-template-hash label for cloneset.

Now there are two hash labels in pods that managed by cloneset:

  • controller-revision-hash is still the important one that indicates the pod version. It defaults to be "{CLONESET_NAME}-{HASH}", and it will be "{HASH}" if user enabled the CloneSetShortHash feature-gate.
  • pod-template-hash should always be the short format "{HASH}". cloneset-controller will not rely on it, but some other controllers, such as kruise-rollout, may use it to be the service selector.

@kruise-bot kruise-bot added the size/L size/L: 100-499 label Mar 18, 2022
@zmberg
Copy link
Member

zmberg commented Mar 18, 2022

/lgtm

@@ -198,6 +206,22 @@ func (c *realControl) refreshPodState(cs *appsv1alpha1.CloneSet, coreControl clo
return false, res.DelayDuration, nil
}

func (c *realControl) fixPodTemplateHashLabel(cs *appsv1alpha1.CloneSet, pod *v1.Pod) (bool, error) {
Copy link
Member

Choose a reason for hiding this comment

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

please comment the history and reason of why we need "fix" template hash. It seems that previously we only has controllerrevisionhash in the pod

@FillZpp FillZpp force-pushed the optimize-inplace-update-and-add-hash-label branch from d72d698 to 20ba503 Compare March 21, 2022 03:26
@kruise-bot kruise-bot removed the lgtm label Mar 21, 2022
Copy link
Member

@furykerry furykerry left a comment

Choose a reason for hiding this comment

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

/lgtm

@FillZpp
Copy link
Member Author

FillZpp commented Mar 21, 2022

/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FillZpp

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

@kruise-bot kruise-bot merged commit 3b0a040 into openkruise:master Mar 21, 2022
ppbits pushed a commit to ppbits/kruise that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants