Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the Hyperthreading field to MachinePool which allows the user to
enable or disable hyperthreading for machines. The default is for hyperthreading to be enabled. RHCOS ships with pivot.service that uses the `/etc/pivot/kernel-args` to override the kernel arguments for hosts. Adding `nosmt` kernel argument switches hyperthreading off. Add MachineConfig to disable hyperthreading for control plane and compute that have the hyperthreading option disabled.
- Loading branch information
1 parent
3d904d3
commit 71c6f2d
Showing
14 changed files
with
464 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package machineconfig | ||
|
||
import ( | ||
"fmt" | ||
|
||
igntypes "github.com/coreos/ignition/config/v2_2/types" | ||
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
"github.com/openshift/installer/pkg/asset/ignition" | ||
) | ||
|
||
// ForHyperthreadingDisabled creates the MachineConfig to disable hyperthreading. | ||
// RHCOS ships with pivot.service that uses the `/etc/pivot/kernel-args` to override the kernel arguments for hosts. | ||
func ForHyperthreadingDisabled(role string) *mcfgv1.MachineConfig { | ||
return &mcfgv1.MachineConfig{ | ||
TypeMeta: metav1.TypeMeta{ | ||
APIVersion: "machineconfiguration.openshift.io/v1", | ||
Kind: "MachineConfig", | ||
}, | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: fmt.Sprintf("99-%s-disable-hyperthreading", role), | ||
Labels: map[string]string{ | ||
"machineconfiguration.openshift.io/role": role, | ||
}, | ||
}, | ||
Spec: mcfgv1.MachineConfigSpec{ | ||
Config: igntypes.Config{ | ||
Ignition: igntypes.Ignition{ | ||
Version: igntypes.MaxVersion.String(), | ||
}, | ||
Storage: igntypes.Storage{ | ||
Files: []igntypes.File{ | ||
ignition.FileFromString("/etc/pivot/kernel-args", "root", 0600, "ADD nosmt"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.