-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add openshift/4.8.0-exp that produces MachineConfigs by default #212
Conversation
We want to support both OCP and OKD.
We're not going to switch to spec 3.3.0 in this cycle.
We'll need to generalize it.
Don't use it for anything yet, but require that metadata.name is specified.
I don't have full context here, is the usecase of this is that user can write openshift coreos config (yaml config) and can use fcct tool to generate MachineConfig? |
@sinnykumari Yup, that's right. For example, it would let us convert the mirrored disk instructions to use a MachineConfig manifest. Other workflows in the customization docs could also be switched to preprocess through fcct in cases where its sugar and validation capabilities would be useful. |
In the MCO today I believe we use FCCT to render our templates into machineconfigs, although we make no explicit reference to the schema type. Is that something we should change? Or is that perhaps unrelated to this change |
+1
agree, for better user experience it would be nice to be able to generate rest of MachineConfig file fields as well. And current .occ format looks fine to me. |
+1 from my side as well. Just to xref some previous ideas in this area:
Do I see this correctly and this RFC will be able tp obsolete these approaches? |
MCO is using FCCT in a limited way to transpile file and unit sections, but not to transpile entire configs. It should be fine to continue as is for now; there's no harm to passing desugared config through FCCT twice.
Yup, we can do that as a followup.
We're planning to do that before 4.8, currently blocked on finding a good name. If anyone has any ideas, please add them to #167.
I don't think they're incompatible. This RFC lets us incrementally improve our config handling without MCO changes. In the longer term, we could still reconsider the CRD format, which would allow us to avoid asking users to preprocess their configs with an external tool. |
No major objections raised so far; dropping |
This part of the new FCC syntax is worth some thought: metadata:
labels:
machineconfiguration.openshift.io/role: worker Nowhere else in the FCC or Ignition specs do we allow user-specified map keys. Normally we'd implement this functionality like so: metadata:
labels:
- key: machineconfiguration.openshift.io/role
value: worker I'm concerned that if we use a datatype here that we don't use elsewhere, and don't plan to use elsewhere, that it will cause complications. It already introduces a presentation issue in documentation and requires some additional code in Thoughts? |
I would lean towards the former example. I think making it clear that we're directly passing those arguments through into the resulting MachineConfig is sufficient (as well giving us the mentioned benefit of matching the k8s norms). |
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
internal/main.go
Outdated
@@ -45,6 +45,7 @@ func main() { | |||
pflag.Lookup("debug").Hidden = true | |||
pflag.BoolVarP(&options.Strict, "strict", "s", false, "fail on any warning") | |||
pflag.BoolVarP(&options.Pretty, "pretty", "p", false, "output formatted json") | |||
pflag.BoolVarP(&options.Raw, "raw", "r", false, "output only Ignition config, without any wrapper") |
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.
Do you think we should mention this is only valid on openshift
variants or maybe throw a warning/error if we see it set in other variants? I'm not sure that without any wrapper
means anything without context.
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.
Changed it to never wrap in a MachineConfig; force Ignition output
. For the other variants, we always output raw Ignition, so it feels odd to complain if the user redundantly requests it.
Agreed with @arithx. Just matching the k8s semantics would be a nicer UX. Documentation-wise, feels like we can just leave out the awkward
? |
Could also do something like this, describing the type as a |
Generate a MachineConfig by default, but produce an Ignition config if the Raw/-r/--raw translation option is specified. We host our own reimplementation of MachineConfig structs to avoid pulling in a massive (and circular) set of dependencies from openshift/machine-config-operator.
Rename
rhcos
/0.2.0-experimental
toopenshift
/4.8.0-experimental
. Useopenshift
as the variant name instead ofrhcos
because RHCOS is an implementation detail of OpenShift, and also would leave OKD in an awkward position. By reusing OpenShift version numbers, we're setting ourselves up to eventually violate semver, but it doesn't seem reasonable to create a novel set of user-facing version numbers that isn't connected to anything else.Have the new spec generate MachineConfigs by default, but also accept a new
-r/--raw/Raw
option to generate an Ignition config. This allows FCCT to be used for sugar (e.g. for boot disk mirroring) and validation (e.g. rejecting users other thancore
) without modifying the pointer config, and without requiring MCO changes. We'll have a new spec version for each OpenShift release, so we'll also have the ability to change the output format as needed by future MCO releases.As an implementation detail, ship a simplified copy of the MachineConfig structs so we don't have to pull in a bunch of k8s code as dependencies. (And to avoid a circular dependency with the MCO.)
Sample
input.occ
:fcct input.occ
produces:And
fcct --pretty --raw input.occ
produces:@yuqi-zhang, @sinnykumari, and/or other folks from the MCO team, wdyt?