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

support kernel arguments #388

Closed
cgwalters opened this issue Feb 7, 2019 · 9 comments · Fixed by #762
Closed

support kernel arguments #388

cgwalters opened this issue Feb 7, 2019 · 9 comments · Fixed by #762
Labels

Comments

@cgwalters
Copy link
Member

We landed a lot of good work in rpm-ostree kargs. What we need to do is wrap that in MachineConfigs. One decision point is whether this is an extension to Ignition (if specified then does Ignition reboot?). Or is it a new item in the MachineConfig spec itself?

And the MCD would need to understand how to reconcile the user-specified kargs versus what's the default.

@mrguitar
Copy link

mrguitar commented Feb 7, 2019

@runcom ^^

@cgwalters
Copy link
Member Author

cgwalters commented Mar 27, 2019

A lot of discussion around this; see this pivot discussion.

One thing that seems increasingly clear is that we should use MachineConfig as a "sugar" for Ignition where it makes sense.

IOW, we start from this:

diff --git a/pkg/apis/machineconfiguration.openshift.io/v1/types.go b/pkg/apis/machineconfiguration.openshift.io/v1/types.go
index f7df1d5..318506c 100644
--- a/pkg/apis/machineconfiguration.openshift.io/v1/types.go
+++ b/pkg/apis/machineconfiguration.openshift.io/v1/types.go
@@ -226,6 +226,8 @@ type MachineConfig struct {
 
 // MachineConfigSpec is the for MachineConfig
 type MachineConfigSpec struct {
+	// KernelArguments defines additional kernel arguments beyond the host defaults.
+	KernelArguments []string `json:"kernelArguments"`
 	// OSImageURL specifies the remote location that will be used to
 	// fetch the OS.
 	OSImageURL string `json:"osImageURL"`

@runcom
Copy link
Member

runcom commented Mar 27, 2019

One thing that seems increasingly clear is that we should use MachineConfig as a "sugar" for Ignition where it makes sense.

cannot agree more with this...

@cgwalters
Copy link
Member Author

With coreos/rpm-ostree#1802

the MCD in upgrade.go when detecting a diff between the current/target KernelArgs would first call --remove on the old ones, then --add for the new ones.

There's an alternative implementation path where the MCD reads the BLS config performs the diff internally, and calls the appropriate rpm-ostree kargs invocation.

@runcom
Copy link
Member

runcom commented May 9, 2019

With projectatomic/rpm-ostree#1802

the MCD in upgrade.go when detecting a diff between the current/target KernelArgs would first call --remove on the old ones, then --add for the new ones.

if coreos/rpm-ostree#1802 provides a way to achieve the above it would be my preferred way.
We still need to decide on where to put Kargs (MC vs CRD vs something higher level?)

@runcom
Copy link
Member

runcom commented May 14, 2019

been thinking about this...do we want Kargs to be a list of "changes" over the current kargs on a boot? I suppose so, but we need to have some sort of syntax to describe that in the CRD or whatever. Also --append vs --replace should be something to take into account as well. Moreover, if we're supporting --delete we need to blacklist from removing kargs like ignition.platform and the like I guess.

@runcom
Copy link
Member

runcom commented May 14, 2019

also, for fips we need to also specify boot:

we require the ability to configure "fips=1" and "boot=UUID=" in order to successfully configure FIPS.

uuid=$(findmnt -no uuid /boot)
[[ -n $uuid ]] && echo $uuid

Last one for now, do we do this early pivot or day-2? both? (probably both, just triple checking)

@pliurh
Copy link
Contributor

pliurh commented May 16, 2019

Can we also support this feature in RHEL based cluster? I think it would be great, if MCO can expose the same API for all the operating systems we support. So that, users don't have to implement other automation solution by their own, and it would also be beneficial for other component which relay on this feature, to work cross the operating systems.

@cgwalters
Copy link
Member Author

Can we also support this feature in RHEL based cluster?

Probably. I bet it wouldn't be hard at all, but I'd like to land the feature for RHCOS first.

cgwalters added a commit to cgwalters/machine-config-operator that referenced this issue May 20, 2019
We need to support things like adding `nosmt` to the kernel
commandline, for users that want to choose security over performance;
this is particularly relevant for multi-tenant clusters.
There are a lot of other "tuning" features that are expressed as
kernel cmdline args; another good exmaple is to have `node-tuning-operator`
to write something like `machineconfig/05-node-tuning-operator`.

Per discussion in the PR, we down the line probably want to add
an `operatingsystem` type or so that would be a high level wrapper
for this, but today everything else is expressed in `MachineConfig`,
so we need to extend this type.

There have also been some discussions about extending Ignition,
but that's not likely to land soon, and even if it did we still
need to handle "early pivot" pulling `machine-os-content`, and
scoping both OS updates and kargs into Ignition is too far out.

This is the first step which will support "day 2" configuration.
After this lands, we have further work to have the MCS provide
`MachineConfig` and not just Ignition, so that we can replace
the "early pivot" with MCD code.

Closes: openshift#388
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants