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

Make it possible to use OnDelete update strategy on addon daemonset #10167

Merged
merged 2 commits into from
Nov 16, 2020

Conversation

olemarkus
Copy link
Member

Fixes #7971

Or at least makes it possible to fix it for the addons we need.

Works by adding another element to the addon spec. If it is set, will make channels patch an annotation on the relevant nodes that rolling update uses to determine if an instance needs updating.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 4, 2020
klog.Infof("addon %v wants to roll %v nodes", a.Name, a.Spec.NeedUpdate)
selector := ""
switch a.Spec.NeedUpdate {
case "masters":
Copy link
Member

Choose a reason for hiding this comment

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

Should probably use "control-plane" for newly added fields.

Copy link
Member

Choose a reason for hiding this comment

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

Hrm, I wonder if we should introduce a mix of old and new terminology now or instead wait for a new apiVersion to change all the terminology used in the API at once.

Copy link
Member

Choose a reason for hiding this comment

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

I'm willing to let this proceed with the legacy terminology.

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't really exposed to users, so I am all for changing the names.

switch a.Spec.NeedUpdate {
case "masters":
selector = "node-role.kubrnetes.io/master="
case "nodes":
Copy link
Member

Choose a reason for hiding this comment

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

Consider "worker"

@olemarkus olemarkus force-pushed the cilium-ondelete branch 3 times, most recently from 9266e90 to ca0391d Compare November 15, 2020 14:35
@johngmyers
Copy link
Member

/retest

Copy link
Member

@johngmyers johngmyers left a comment

Choose a reason for hiding this comment

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

Just a few nits.

// NeedUpdate determines if we should mark nodes as needing an update.
// Legal values are control-plane, workers, and all
// Empty value means no update needed
NeedUpdate string `json:"needsRollingUpdate,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Please make the struct field name and json name consistent. I think NeedsRollingUpdate would be a better struct name.

channels/pkg/channels/addon.go Outdated Show resolved Hide resolved
Make it possible for addons to set needs-update annotation

Use onDelete update strategy for cilium and set needs-update annotation

Rename node roles
@johngmyers
Copy link
Member

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johngmyers, olemarkus

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 Nov 16, 2020
@k8s-ci-robot k8s-ci-robot merged commit 92911d7 into kubernetes:master Nov 16, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Nov 16, 2020
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. area/addons area/channels area/rolling-update 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.

Bootstrap channel DaemonSets have updateStrategy: RollingUpdate
3 participants