Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented May 29, 2019

Give cluster admins a knob for turning these on and off.

This is part of addressing openshift/cluster-version-operator#99.

CC @abhinavdahiya, @smarterclayton.

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 29, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wking
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: eparis

If they are not already assigned, you can assign the PR to them by writing /assign @eparis in a comment when ready.

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

The pull request process is described here

Details 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

Copy link
Contributor

@smarterclayton smarterclayton left a comment

Choose a reason for hiding this comment

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

Needs a design

wking added 2 commits May 30, 2019 09:23
Give cluster admins a knob for turning these on and off.  You could
conceivably build a bunch of logic in here, like an update-schedule
schema configuring allowed upgrade times [1].  But it's going to be
hard to get a spec schema that supports all the upgrade-gating logic
that users will need.  Instead, we have a simple boolean switch here
and very basic logic in the cluster-version operator.  Users who want
more control can run their own Cincinnati proxy/mirrors with Policy
Engines [2] that add their desired behavior (e.g. removing all edges
during times when they don't want clusters auto-upgrading).

[1]: openshift#326 (comment)
[2]: https://github.com/openshift/cincinnati/blob/1777fc45cefaab3c8c0e870ef1dfc29564d2d37b/docs/design/cincinnati.md#policy-engine
With:

  $ make generate
@wking wking force-pushed the auto-update-spec branch from d3cfead to 0b9690b Compare May 30, 2019 16:27

// automaticUpdates enables automatic updates.
// +optional
AutomaticUpdates bool `json:"automaticUpdates,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

We want people to opt-out, this API is opt-in.

Copy link
Member Author

Choose a reason for hiding this comment

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

We want people to opt-out, this API is opt-in.

Existing users will need to opt in. How do we do that with an opt-out API? Can we have an opt-in API here and have an opt-out API in the install-config, so new installers will generate ClusterVersion with this set true by default?

Copy link

Choose a reason for hiding this comment

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

The zero value of a bool is false so "auto-updates=false" means "no auto updates by default", thus it's opt in.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's opt in here, and I think we want that for compat with existing clusters (which are all manual-update). If/when we add an installer knob that feeds this property, that installer knob should be opt out. Are we all on the same page, or am I missing something?

@wking
Copy link
Member Author

wking commented May 30, 2019

I meant it to be a boolean. Schedule structure sounds good; I'll reroll tonight.

I've pushed d3cfead -> 0b9690b to go with a boolean after all. Talking this over with @abhinavdahiya and @crawford, I think getting a spec structure that makes most users happy is going to be hard, and it diverges from the "simple CVO, complex logic in Cincinnati" approach we've followed so far. With a boolean "should I auto-upgrade?" switch for the CVO, users that need more complicated logic can implement that by pointing clusters at their own Cincinnati proxy that slurps the graph from our upstream Cincinnati (or wherever) and applies the logic they want (e.g. removing all upgrade edges during times when they don't want clusters auto-upgrading). If we find there's a lot of demand for specific logic (like your cron schedule schema), we can ship images for Policy Engine Cincinnati proxies like that to make it easy for users to set them up locally. But we don't need to bake that logic into the cluster itself. Thoughts?

@smarterclayton
Copy link
Contributor

smarterclayton commented May 31, 2019 via email

@smarterclayton
Copy link
Contributor

smarterclayton commented May 31, 2019 via email

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 31, 2019
@crawford
Copy link

crawford commented Jun 1, 2019

I'll try to get my thoughts into a doc early next week.

@crawford
Copy link

crawford commented Jun 8, 2019

I've got my proposed big picture down here: https://docs.google.com/document/d/1i4srAn3exEHWBjQmVE0Vz4V5gB8n7eOJi4MUm1rDhFo. (sorry OKD. We'll be right back)

I think we should adopt something similar to this:

apiVersion: config.openshift.io/v1
kind: ClusterVersion
spec:
  channel: stable-4.1
  clusterID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  upstream: https://api.openshift.com/api/upgrades_info/v1/graph
  automaticUpdates:
    schedule:
      - Mon..Fri *-2..10-* 10:00,14:00
      - Tues..Thurs *-11..1-* 11:00

schedule is a set of times that the CVO should check for updates (I don't have much preference for the actual syntax). An empty schedule implies that automatic updates should be disabled. We can leave everything more complex than that to a policy engine.

@deads2k
Copy link
Contributor

deads2k commented Sep 25, 2019

/close

closing without prejudice due to age. Please open an enhancement in openshift/enhancements

@openshift-ci-robot
Copy link

@deads2k: Closed this PR.

Details

In response to this:

/close

closing without prejudice due to age. Please open an enhancement in openshift/enhancements

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@cgwalters
Copy link
Member

Is it written down somewhere an example "best practice" for basic enablement of automatic updates today? Just something like a cron job pod that runs oc adm upgrade using the cli container? I think we should have this in the docs.

@wking
Copy link
Member Author

wking commented Nov 19, 2019

Please open an enhancement in openshift/enhancements

Opened: openshift/enhancements#124

Just something like a cron job pod that runs oc adm upgrade using the cli container?

Probably oc adm upgrade --to-latest, but yeah, should work. I don't see a need to doc a stopgap though, we should just land the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants