BUILD-281: add feature gate, OCM configuration bit, to enable build csi volume tech preview #1007
Conversation
|
hold .... THIS story is also suppose to do the feature gate a la #982 |
|
unhold ... feature gate commit included PTAL |
d40bccb to
e694e3a
Compare
@gabemontero does that mean you confirmed what i said earlier (that we need it in both places because one is the user facing config api, and the other is the internal config struct for the controller process?) |
not confirmed @bparees .... placeholder / anticipating the answer. Still waiting on @adambkaplan to catch up to this, as he was the one who cited updating openshiftcontrollplane |
actually @bparees @adambkaplan .... if we were to take the discussion thread with @deads2k at https://coreos.slack.com/archives/C014MHHKUSF/p1631216153043900 even further, and mimic the use of library-go for features gates like the kubeapiserver, then we would duplicate for OCM the existing openshift api server https://github.com/openshift/api/blob/master/openshiftcontrolplane/v1/types.go#L48, which is analogous to https://github.com/openshift/api/blob/master/kubecontrolplane/v1/types.go#L64, which is what is currently used by https://github.com/openshift/cluster-kube-apiserver-operator/blob/master/pkg/operator/configobservation/configobservercontroller/observe_config_controller.go#L134 the only fly in the ointment there is those TODO comments above the lines in those first 2 links |
e694e3a to
eaa29e1
Compare
|
OK @bparees @adambkaplan @deads2k this revamped version attempts to capture/implement guidance from various slack conversations with each of you in some fashion, along with some resolution of items previously discussed here Key points:
Also, I have WIP PRs for illustrating the end to end flow between library-go, OCM-O, and OCM, and the minimal amount of code delta required, to achieve are means. Please consider which are all based on the current commit level of this PR at the time of this comment thanks |
There was a problem hiding this comment.
First, necessary background:
- https://github.com/openshift/api/blob/master/config/v1/types_build.go#L19-L45 is the build controller configuration that is stored in etcd and configurable by the admin.
- This configuration (and others) gets rendered into the
spec.observedConfigfield of the operator OpenshiftControllerManager object: https://github.com/openshift/api/blob/master/operator/v1/types_openshiftcontrollermanager.go#L15-L24. - The schema for OpenshiftControllerManager's observed config is the old 3.x controller manager configuration, which can be expressed as JSON/YAML: https://github.com/openshift/api/blob/master/openshiftcontrolplane/v1/types.go#L164.
- Ultimately openshift-controller-manager-operator merges the default, observed, and unsupported overrides into the OpenshiftControllerManager JSON, and mounts this as a ConfigMap: https://github.com/openshift/cluster-openshift-controller-manager-operator/blob/master/pkg/operator/sync_openshiftcontrollermanager_v311_00.go#L183-L186
So the net is that the API in /config is stored in etcd, the API in /openshiftcontrolplane is not.
In this approach, the library-go function used will parse out the feature gates and render an array of strings with the format <FeatureGate>=<true|false>. The FeatureGates field therefore should just be []string if we move forward with this approach. That said, we would then need extra logic in openshift-controller-manager to parse the feature gates, which to me feels like a bit of overkill.
When I scoped the story out, my thought is we could do the following:
- Add a field to BuildControllerConfig indicating if CSI volumes are enabled: https://github.com/openshift/api/blob/master/openshiftcontrolplane/v1/types.go#L198
- Update our existing build config observation function to read the cluster feature gates, check if
BuildCSIVolumesis enabled, and if so, set the appropriate value. See https://github.com/openshift/cluster-openshift-controller-manager-operator/blob/master/pkg/operator/configobservation/builds/observe_builds.go#L18
This would avoid the "kube feature gates" -> "controller manager config" translation, which IMO feels brittle. The downside is that we would more or less need to replicate the logic in the cluster-storage-operator - see https://github.com/openshift/cluster-storage-operator/blob/2e76e02cb8479784a582e57a587be8fd5d75cae2/pkg/operator/csidriveroperator/driverstarter.go#L268-L292
| // featureGates captures the current set of OpenShift feature gates that are of interest to | ||
| // components of the OpenShift Controller Manager. NOTE: this field will possibly be deprecated | ||
| // in a future OpenShift release if the feature gate mechanism in OpenShift is removed. | ||
| FeatureGates map[string][]string `json:"featureGates"` |
There was a problem hiding this comment.
I would leave the bits about future deprecation and such out.
| // featureGates captures the current set of OpenShift feature gates that are of interest to | |
| // components of the OpenShift Controller Manager. NOTE: this field will possibly be deprecated | |
| // in a future OpenShift release if the feature gate mechanism in OpenShift is removed. | |
| FeatureGates map[string][]string `json:"featureGates"` | |
| // featureGates are the set of extra OpenShift feature gates for openshift-controller-manager. | |
| // These feature gates can be used to enable features that are tech preview or otherwise not available on | |
| // OpenShift by default. | |
| FeatureGates map[string][]string `json:"featureGates"` |
There was a problem hiding this comment.
A few other things
- The library-go function referenced in BUILD-281: add library-go watch/update of new OCM feature gate field cluster-openshift-controller-manager-operator#227 produces a
[]stringoutput and sets that on whatever nested JSON object you have. I think this field needs to be[]stringand notmap[string][]string. - The data is of the format
<FeatureGate>=<true|false>. So something on ocm needs to parse the feature gates. Are we OK with that?
There was a problem hiding this comment.
My testing of things on Friday as I recall came to the conclusion that anything set to false did not get included in what ultimately bubbled up. i.e. it got filtered at the library-go level.
I'll double check if we move forward down this path. But if I'm incorrect, then yes, ocm-o/ocm would need to account for it.
In the interest of code reuse and expediency, I at least am OK with it.
There was a problem hiding this comment.
I'll pull your suggestion in manually @adambkaplan since I'll need to run make update anyway to get the verifications to pass ... save on some CI churn
thanks
|
Thanks for catching up to this after your kubecon foray @adambkaplan ... some opnion/responses embedded below.
OK @adambkaplan yes this gets to the crux of the questions @bparees and I had at the beginning of this PR. The intent you outlined above ^^ now does not precisely with what came out of planning for BUILD-281 and what I currently see in the description there. But no big deal wrt that specifically. I think the crux of the decisions we need to make here is what you accurately summarized below.
Totally agree with the characterization of things. My current opinions are:
Bottom line, I think we can manage any "brittle" translation in the short term while dealing with a tech preview item, and just jettison the whole thing when we graduate to GA. |
I think this PR will help: openshift/library-go#1208 |
eaa29e1 to
54c181a
Compare
This allows CSI volumes provided by the 'CSIDriverSharedResource' feature gate to be included in DockerBuildStrategy and SourceBuildStrategy Builds in OpenShift. Currently, this should only be installed on clusters that opt into tech preview features.
54c181a to
4d8e022
Compare
This is fair. I'm now sold on using |
8b27ba4 to
ada51a0
Compare
|
type now |
|
Confirmed - the observe features function in library-go will write a |
adambkaplan
left a comment
There was a problem hiding this comment.
/lgtm
@deads2k build team is in agreement with this approach.
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adambkaplan, deads2k, gabemontero 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 |
/assign @adambkaplan
/assign @bparees
(given historical involvement in this effort, please feel free to unassign at your discretion)
/assign @deads2k
(given recent reviews in this space as well as historical involvement in the shared/projected resource space; of course reassign at your discretion)