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

Honor OS update policy at InstanceGroup level too #10913

Conversation

seh
Copy link
Contributor

@seh seh commented Feb 23, 2021

As with the Cluster "spec.updatePolicy" field, add a similar field at the InstanceGroup level, allowing overriding of the cluster-level choice in each InstanceGroup.

Introduce a new value for the field ("automatic") as equivalent to the default value applied when the field is absent. Honoring this new value allows disabling automatic updates at the cluster level, but then enabling them again for particular InstanceGroups. Without such a positive affirmation, it's not possible to override a cluster-level "external" policy at the InstanceGroup level, as there's no way to specify positively that you want to recover the default value. Instead, expressing the explicit "automatic" value is clear and unambiguous.

See this thread in the "kops-users" channel of the "Kubernetes" Slack workspace for preceding discussion.


This change is Reviewable

@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 Feb 23, 2021
Copy link
Contributor Author

@seh seh left a comment

Choose a reason for hiding this comment

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

I remain uncertain whether we need to change file upup/pkg/fi/nodeup/nodetasks/package.go. At present, it pays attention to the "external" policy, but its treatment might be inverted accidentally.

@@ -133,8 +133,8 @@ type ClusterSpec struct {
IsolateMasters *bool `json:"isolateMasters,omitempty"`
// UpdatePolicy determines the policy for applying upgrades automatically.
// Valid values:
// 'external' do not apply updates automatically - they are applied manually or by an external system
// missing: default policy (currently OS security upgrades that do not require a reboot)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this avoidance of reboots was and is not true for Flatcar Container Linux. It only installs updates by way of rebooting. It downloads and verifies them ahead of time, but only pivots to using the new files upon reboot.

Copy link
Contributor Author

@seh seh left a comment

Choose a reason for hiding this comment

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

I asked @hakman whether I should build a loader.OptionsBuilder for this field, or to add it to an existing one, in order to set the default value to "automatic." We could consider that for the ClusterSpec type, but should not do so for the InstanceGroupSpec type, because the latter should default to not overriding the former, by way of making no statement about its policy.

@seh
Copy link
Contributor Author

seh commented Feb 23, 2021

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2021
@seh seh force-pushed the scope-os-update-policy-to-instance-group-too branch from c306818 to 94ab4d1 Compare February 26, 2021 13:35
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2021
@seh
Copy link
Contributor Author

seh commented Feb 26, 2021

I was able to rebase this cleanly, two documentation conflicts notwithstanding. PTAL.

@seh
Copy link
Contributor Author

seh commented Feb 26, 2021

/retest

@hakman hakman self-assigned this Mar 1, 2021
@seh
Copy link
Contributor Author

seh commented Mar 1, 2021

@johngmyers, can you speak to the concern that I raised in this Slack message regarding (*Package).findDpkg and (*Package).FindYum?

@seh
Copy link
Contributor Author

seh commented Mar 1, 2021

can you speak to the concern that I raised in this Slack message regarding (*Package).findDpkg and (*Package).FindYum?

@hakman set me straight. He's the original author of the blocks in question, and he explained that it's working as intended, but needs to be augmented to take my new InstanceGroup-level field into account.

seh added 3 commits March 5, 2021 08:53
As with the Cluster-level "spec.updatePolicy" field, add a similar
field at the InstanceGroup level, allowing overriding of the
cluster-level choice in each InstanceGroup.

Introduce a new value for the field ("automatic") as equivalent to the
default value applied when the field is absent. Honoring this new
value allows disabling automatic updates at the cluster level, but
then enabling them again for particular InstanceGroups. Without such a
positive affirmation, it's not possible to override a cluster-level
"external" policy at the InstanceGroup level, as there's no way to
specify positively that you want to recover the default
value. Instead, expressing the explicit "automatic" value is clear and
unambiguous.
@seh seh force-pushed the scope-os-update-policy-to-instance-group-too branch from 94ab4d1 to 2fc6856 Compare March 5, 2021 14:42
@seh
Copy link
Contributor Author

seh commented Mar 5, 2021

Per private discussion with @hakman, in commit 2fc6856 I noted that for now we can't take this new InstanceGroup-level overriding of the Cluster-level update policy into account for the dpkg and YUM OS package installation tasks.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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 Mar 13, 2021
@k8s-ci-robot k8s-ci-robot merged commit ad7c793 into kubernetes:master Mar 13, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 13, 2021
k8s-ci-robot added a commit that referenced this pull request Mar 13, 2021
…-upstream-release-1.20

Automated cherry pick of #10913: Honor OS update policy at InstanceGroup level too
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/api area/nodeup 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.

None yet

3 participants