-
Notifications
You must be signed in to change notification settings - Fork 216
Bug 1907329: Add cluster profile support #404
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
Bug 1907329: Add cluster profile support #404
Conversation
|
AWS failed to bootstrap /retest |
|
@vrutkovs yes it is because I didn't solve the issue of "where we should store the profile". Currently, the CVO expects to find it in a ConfigMap and it is still created by hand. Do you think it's a good idea to read it from a ConfigMap ? There is a chicken and egg issue with this: if the ConfigMap is not present, the CVO cannot run but the ns openshift-config is created by the CVO. |
|
CVO should fall back to default profile (so that upgrade would succeed) if the configmap is not present |
|
OK, so I will change this PR to:
It will be the responsibility of the installer to have the ConfigMap in place before the CVO runs for the first time. Does it sound good ? |
|
I experimented a bit more and found an interesting problem by making optional the ConfigMap. During the boostrap, the CVO is created via a bootstrap-manifest and it runs before manifests are created (located in /manifests - even before the first one 0000_00_cluster-version-operator_00_namespace.yaml). It could not find the ConfigMap and therefore load the default profile. Any thoughts on this ? How can we make the CVO waiting for the ConfigMap but still having the choice to not have it ? Perhaps if we use the ClusterVersion type to hold the profile, we will have the ConfigMap always defined. |
I'm not sure I'm following - why installed profile is incorrect? I assumed that no profile specified == "default" profile. If its not set then all operators (unless explicitly excluded) are enabled |
bd95493 to
947807a
Compare
|
I wanted to change the behavior to load once the profile at startup but it doesn't work. CVO is launched before manifests are created. At start the ClusterVersion object doesn't exist and locks the CVO. To work correctly with a profile, the user have to ensure the ConfigMap is created before the ClusterVersion. For snc, I did something like: |
947807a to
4f8a2b8
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/test e2e-gcp-upgrade |
|
/retest |
|
@jottofar: The specified target(s) for
Use DetailsIn response to this:
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. |
4f8a2b8 to
0679960
Compare
|
/retest |
csrwng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me, just a couple of comments
pkg/cvo/sync_worker.go
Outdated
| } | ||
|
|
||
| type ClusterProfileRetriever interface { | ||
| RetrieveClusterProfile(ctx context.Context) string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should return an error in this function. It's probably safer to fail in the case you can't read the profile than to assume "default"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, you can check the error for IsNotFound and return default... however other errors probably indicate an api server error and you should probably report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you're right, it's better now.
We can see in the log now: I0727 15:08:48.205731 1 updatepayload.go:336] Cannot get ConfigMap openshift-config/cluster-profile, using default profile: configmap "cluster-profile" not found
pkg/cvo/updatepayload.go
Outdated
| func (r *clusterProfileRetriever) RetrieveClusterProfile(_ context.Context) string { | ||
| configMap, err := r.cmConfigLister.Get(internal.ClusterProfileConfigMap) | ||
| if err != nil { | ||
| klog.Infof("cannot get configmap openshift-config/cluster-profile, using default profile") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for the interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 👍
494461c to
a84ec7a
Compare
|
/test unit |
|
/hold Blocked by operator-framework/operator-lifecycle-manager#1887 to label the InstallPlans CRD manifest (among other things) to avoid |
LalatenduMohanty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
/retest |
8 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
This is matches openshift/enhancements#510 and doesn't change existing behavior
48fa4e9 to
8f4d36c
Compare
|
/hold cancel I'd held this for operator-framework/operator-lifecycle-manager#1887, which has since landed. |
LalatenduMohanty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guillaumerose, LalatenduMohanty The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@guillaumerose: All pull requests linked via external trackers have merged:
Bugzilla bug 1907329 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
Implementation of openshift/enhancements#200
This adds a CLUSTER_PROFILE env variable that is used to determine which manifests to apply based on the
include.release.openshift.io/annotation.It is exactly what is written in the enhancement, not more.
This env. variable is not used by any components and, as it is empty, it defaults to the value of the default profile
self-managed-high-availability.