Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 62 additions & 45 deletions data/data/rhcos.json
Original file line number Diff line number Diff line change
@@ -1,94 +1,111 @@
{
"amis": {
"ap-northeast-1": {
"hvm": "ami-0fbc0018a8310e53e"
"hvm": "ami-09d3305f4d4a32aab"
},
"ap-northeast-2": {
"hvm": "ami-0ba6edf20991dee91"
"hvm": "ami-05000ed15563794d4"
},
"ap-south-1": {
"hvm": "ami-0acf1668760f8f8e9"
"hvm": "ami-085b9dd31ce1d0c47"
},
"ap-southeast-1": {
"hvm": "ami-0bcecfdf9ff5fd5ca"
"hvm": "ami-0b32c19c0e043fa25"
},
"ap-southeast-2": {
"hvm": "ami-0480abd0220d56ae2"
"hvm": "ami-0fa580c9d5f47044d"
},
"ca-central-1": {
"hvm": "ami-0de4e822461cb671b"
"hvm": "ami-0e7d27d33a5f83576"
},
"eu-central-1": {
"hvm": "ami-056c9291dce6d5023"
"hvm": "ami-0fb5771d5798d7999"
},
"eu-west-1": {
"hvm": "ami-0f0159b00648b0bf4"
"hvm": "ami-046291643f08c3c4b"
},
"eu-west-2": {
"hvm": "ami-044f299a3abcb4d96"
"hvm": "ami-05076ca846cebfed7"
},
"eu-west-3": {
"hvm": "ami-095776c2e71c62b2f"
"hvm": "ami-037a1a3dbe2087b95"
},
"sa-east-1": {
"hvm": "ami-00aefabf6d653ff5d"
"hvm": "ami-0e045e16599cf5732"
},
"us-east-1": {
"hvm": "ami-07f604c5f18a1e7a9"
"hvm": "ami-035b0b988ae903258"
},
"us-east-2": {
"hvm": "ami-0eef624367320ec26"
"hvm": "ami-0ccc42f7973195c2a"
},
"us-west-1": {
"hvm": "ami-0f89dba68d747846b"
"hvm": "ami-09c22dc55423861b8"
},
"us-west-2": {
"hvm": "ami-0eac581fbaa9fa9c6"
"hvm": "ami-0e4e79ed5d1ef2d16"
}
},
"baseURI": "https://releases-rhcos.svc.ci.openshift.org/storage/releases/ootpa/410.8.20190325.0/",
"buildid": "410.8.20190325.0",
"baseURI": "https://releases-rhcos.svc.ci.openshift.org/storage/releases/ootpa/410.8.20190410.0/",
"buildid": "410.8.20190410.0",
"images": {
"aws": {
"path": "rhcos-410.8.20190410.0-aws.vmdk",
"sha256": "a63f92fc88064005df2171c88053c6c339f9a326f91bb9aa6f333830a1568bb3",
"size": "754143810",
"uncompressed-sha256": "67b75cff7f650721227142a79465ab7d33c4df12d31343dd94368f864db69943",
"uncompressed-size": 788509696
},
"initramfs": {
"path": "rhcos-410.8.20190410.0-installer-initramfs.img",
"sha256": "7c8b27cdcf9ffc6e8bb1f058470b6d952be6fefe7e3d9c3ae8f8cef8c7465c21"
},
"iso": {
"path": "rhcos-410.8.20190410.0-installer.iso",
"sha256": "f44282e438d38795b8ac35d76ccc9ceadafdc1edf735b2909c0e6b7e1dd1932e"
},
"kernel": {
"path": "rhcos-410.8.20190410.0-installer-kernel",
"sha256": "370db9a3943d4f46dc079dbaeb7e0cc3910dca069f7eede66d3d7d0d5177f684"
},
"metal-bios": {
"path": "rhcos-410.8.20190325.0-metal-bios.raw",
"sha256": "3caaf8d714ac8bb820af6b31d595b8afae5ef951c68f8cee3701e236e9600f30",
"size": "735841103",
"uncompressed-sha256": "32d19b94cfb2aa45799caed2dda70f4e7ac1d0fca2b834a1cbd4459a6b0d056a",
"uncompressed-size": "17179869184"
"path": "rhcos-410.8.20190410.0-metal-bios.raw",
"sha256": "0ee2ee1535f34bc1c525025473276cc6783a54225241cd62304cc27bafecc716",
"size": "763528244",
"uncompressed-sha256": "1aedfa206accd485346fdcc536da0d7ce0f84b570c0724baebb3f467d20feca1",
"uncompressed-size": "3490709504"
},
"metal-uefi": {
"path": "rhcos-410.8.20190325.0-metal-uefi.raw",
"sha256": "1686bb2e3b01873804325b50e286d858435afe1fbc3e88479d54b7a21e58d0f1",
"size": "732781221",
"uncompressed-sha256": "4c9a34f8b30ff7c5b107c87faac0f34a6b591d07a43ae729c45d98d15f3a8fa1",
"uncompressed-size": "17179869184"
"path": "rhcos-410.8.20190410.0-metal-uefi.raw",
"sha256": "37adc9d83eaf91332a91faed999a808028f6a4a3eb102aea13402d401a68ce59",
"size": "763025389",
"uncompressed-sha256": "e956e0da3c20b07acbf2c26433cff773b447c8fdf96922ae22551aa3d5a36a30",
"uncompressed-size": "3490709504"
},
"openstack": {
"path": "rhcos-410.8.20190325.0-openstack.qcow2",
"sha256": "1b16214e59d38b5c1e6d291aea35f2539845232ca3300462104d022f9877fede",
"size": "721092654",
"uncompressed-sha256": "f2f1362c155d8d331387ce759a46b16c83c8a454f59d2ab5087d9781cdc29c97",
"uncompressed-size": "2014380032"
"path": "rhcos-410.8.20190410.0-openstack.qcow2",
"sha256": "707195b2dd279e10638f8bd6c46e4592f7c292d928197ce6ba9a876c8cdad1ca",
"size": "762738936",
"uncompressed-sha256": "176a6ab6206c5bbced4322cb6dc31b76b5a52842a3a39d4ef69a87198c2d3c2f",
"uncompressed-size": "2165440512"
},
"qemu": {
"path": "rhcos-410.8.20190325.0-qemu.qcow2",
"sha256": "12b2db0cae8ea4019f24183dfc905609ab27e8a0fa01bf3631dc6ad7d2afe664",
"size": "721096885",
"uncompressed-sha256": "3b288cf2e02b63f8852c731836d5923a75230a836c63814a3988a96c26268257",
"uncompressed-size": "2014314496"
"path": "rhcos-410.8.20190410.0-qemu.qcow2",
"sha256": "f162c7caeb444146d28e3d0c9c8ffbc7083bb77170f3a824778b92e0c9259370",
"size": "762718951",
"uncompressed-sha256": "3a9956efb0a66906c2889ae57d2424b892314db09e157e10b4eb055af15c7089",
"uncompressed-size": "2165374976"
},
"vmware": {
"path": "rhcos-410.8.20190325.0-vmware.ova",
"sha256": "d8c78e90f3a6fccd21c848a53b669c1c51080972377ad3f6bc81cdcc2cb48300",
"size": "710257080",
"uncompressed-sha256": "f73f5ef77095b0c79a648e2957a965f60544da08c78176028393948500da0dfc",
"uncompressed-size": "743802880"
"path": "rhcos-410.8.20190410.0-vmware.ova",
"sha256": "d1409d64665ce05318719f29e547e667f7183e7c50ed7a394dc462ed8e66d06b",
"size": "788520960"
}
},
"oscontainer": {
"digest": "sha256:007512169406dfa78f2eefdcd1553d94c399340bd1e871b4c884baf609a967ba",
"digest": "sha256:e1bd2d7b1819c84c0d7b56fa96ca40a35e92a728dce4c70a44e4c00bbea12aae",
"image": "docker-registry-default.cloud.registry.upshift.redhat.com/redhat-coreos/ootpa"
},
"ostree-commit": "ed3e5f10b22db9db37e48b72e907ee60113ed259eeef5c019faa0109feeeccf8",
"ostree-version": "410.8.20190325.0"
"ostree-commit": "67a85a81e3dc38dbae236a623ddccac67a5f8bb4ddd541e50e704978d1e0cca4",
"ostree-version": "410.8.20190410.0"
}
30 changes: 18 additions & 12 deletions pkg/asset/installconfig/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ func TestInstallConfigGenerate_FillsInDefaults(t *testing.T) {
},
},
ControlPlane: &types.MachinePool{
Name: "master",
Replicas: pointer.Int64Ptr(3),
Name: "master",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
},
Compute: []types.MachinePool{
{
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
},
},
Platform: types.Platform{
Expand Down Expand Up @@ -135,13 +137,15 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
},
},
ControlPlane: &types.MachinePool{
Name: "master",
Replicas: pointer.Int64Ptr(3),
Name: "master",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
},
Compute: []types.MachinePool{
{
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
},
},
Platform: types.Platform{
Expand Down Expand Up @@ -214,13 +218,15 @@ network:
},
},
ControlPlane: &types.MachinePool{
Name: "master",
Replicas: pointer.Int64Ptr(3),
Name: "master",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
},
Compute: []types.MachinePool{
{
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
},
},
Platform: types.Platform{
Expand Down
40 changes: 40 additions & 0 deletions pkg/asset/machines/machineconfig/hyperthreading.go
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"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these assembled if other folks add MachineConfigs with their own kernel options? Do we need to set Append on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/etc/pivot/kernel-args is a RHCOS impl and it only accepts the ADD nosmt so no append.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/etc/pivot/kernel-args is a RHCOS impl and it only accepts the ADD nosmt so no append.

Oh, so there's no ability for ADD some-other-flag at the moment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone attempts to ADD or DELETE any other argument it will skip it and log. Only items in the whitelist inside pivot are allowed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
},
},
},
}
}
22 changes: 14 additions & 8 deletions pkg/asset/machines/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import (
libvirtapi "github.com/openshift/cluster-api-provider-libvirt/pkg/apis"
libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1"
machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
awsapi "sigs.k8s.io/cluster-api-provider-aws/pkg/apis"
awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1beta1"
openstackapi "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis"
openstackprovider "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/openstackproviderconfig/v1alpha1"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/ignition/machine"
"github.com/openshift/installer/pkg/asset/installconfig"
Expand All @@ -17,20 +26,13 @@ import (
"github.com/openshift/installer/pkg/asset/machines/machineconfig"
"github.com/openshift/installer/pkg/asset/machines/openstack"
"github.com/openshift/installer/pkg/asset/rhcos"
"github.com/openshift/installer/pkg/types"
awstypes "github.com/openshift/installer/pkg/types/aws"
awsdefaults "github.com/openshift/installer/pkg/types/aws/defaults"
libvirttypes "github.com/openshift/installer/pkg/types/libvirt"
nonetypes "github.com/openshift/installer/pkg/types/none"
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
vspheretypes "github.com/openshift/installer/pkg/types/vsphere"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
awsapi "sigs.k8s.io/cluster-api-provider-aws/pkg/apis"
awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1beta1"
openstackapi "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis"
openstackprovider "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/openstackproviderconfig/v1alpha1"
)

// Master generates the machines for the `master` machine pool.
Expand Down Expand Up @@ -91,6 +93,7 @@ func (m *Master) Generate(dependencies asset.Parents) error {
dependencies.Get(clusterID, installconfig, rhcosImage, mign)

ic := installconfig.Config

pool := ic.ControlPlane
var err error
machines := []machineapi.Machine{}
Expand Down Expand Up @@ -150,6 +153,9 @@ func (m *Master) Generate(dependencies asset.Parents) error {
}

machineConfigs := []*mcfgv1.MachineConfig{}
if pool.Hyperthreading == types.HyperthreadingDisabled {
machineConfigs = append(machineConfigs, machineconfig.ForHyperthreadingDisabled("master"))
}
if ic.SSHKey != "" {
machineConfigs = append(machineConfigs, machineconfig.ForAuthorizedKeys(ic.SSHKey, "master"))
}
Expand Down
Loading