Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ spec:
AvailabilityZone is an optinal field specifying the availability zone where instances of this machine pool should run
For Multi-AZ clusters, you can create a machine pool in a Single-AZ of your choice.
type: string
capacityReservationID:
description: |-
CapacityReservationId specifies the ID of an AWS On-Demand Capacity Reservation.
The CapacityReservationId must be pre-created in advance, before creating a NodePool.
type: string
instanceType:
description: InstanceType specifies the AWS instance type
type: string
Expand Down
6 changes: 6 additions & 0 deletions exp/api/v1beta2/rosamachinepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ type RosaMachinePoolSpec struct {
//
// +optional
UpdateConfig *RosaUpdateConfig `json:"updateConfig,omitempty"`

// CapacityReservationId specifies the ID of an AWS On-Demand Capacity Reservation.
// The CapacityReservationId must be pre-created in advance, before creating a NodePool.
//
// +optional
CapacityReservationID string `json:"capacityReservationID,omitempty"`
}

// RosaTaint represents a taint to be applied to a node.
Expand Down
4 changes: 4 additions & 0 deletions exp/controllers/rosamachinepool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@ func nodePoolBuilder(rosaMachinePoolSpec expinfrav1.RosaMachinePoolSpec, machine
if rosaMachinePoolSpec.VolumeSize > 75 {
awsNodePool = awsNodePool.RootVolume(cmv1.NewAWSVolume().Size(rosaMachinePoolSpec.VolumeSize))
}
if rosaMachinePoolSpec.CapacityReservationID != "" {
capacityReservation := cmv1.NewAWSCapacityReservation().Id(rosaMachinePoolSpec.CapacityReservationID)
awsNodePool = awsNodePool.CapacityReservation(capacityReservation)
}
npBuilder.AWSNodePool(awsNodePool)

if rosaMachinePoolSpec.Version != "" {
Expand Down
1 change: 1 addition & 0 deletions exp/controllers/rosamachinepool_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestNodePoolToRosaMachinePoolSpec(t *testing.T) {
Effect: corev1.TaintEffectNoExecute,
},
},
CapacityReservationID: "capacity-reservation-id",
}

machinePoolSpec := expclusterv1.MachinePoolSpec{
Expand Down
1 change: 1 addition & 0 deletions exp/utils/rosa_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func NodePoolToRosaMachinePoolSpec(nodePool *cmv1.NodePool) expinfrav1.RosaMachi
TuningConfigs: nodePool.TuningConfigs(),
AdditionalSecurityGroups: nodePool.AWSNodePool().AdditionalSecurityGroupIds(),
VolumeSize: nodePool.AWSNodePool().RootVolume().Size(),
CapacityReservationID: nodePool.AWSNodePool().CapacityReservation().Id(),
// nodePool.AWSNodePool().Tags() returns all tags including "system" tags if "fetchUserTagsOnly" parameter is not specified.
// TODO: enable when AdditionalTags day2 changes is supported.
// AdditionalTags: nodePool.AWSNodePool().Tags(),
Expand Down
8 changes: 6 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ require (
github.com/google/gofuzz v1.2.0
github.com/onsi/ginkgo/v2 v2.23.3
github.com/onsi/gomega v1.36.3
github.com/openshift-online/ocm-api-model/clientapi v0.0.431
github.com/openshift-online/ocm-common v0.0.29
github.com/openshift-online/ocm-sdk-go v0.1.465
github.com/openshift-online/ocm-sdk-go v0.1.476
github.com/openshift/rosa v1.2.55
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.1
Expand Down Expand Up @@ -70,7 +71,10 @@ require (
sigs.k8s.io/yaml v1.4.0
)

require github.com/aws/aws-sdk-go v1.55.7 // indirect
require (
github.com/aws/aws-sdk-go v1.55.7 // indirect
github.com/openshift-online/ocm-api-model/model v0.0.431 // indirect
)

require (
al.essio.dev/pkg/shellescape v1.5.1 // indirect
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,14 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
github.com/openshift-online/ocm-api-model/clientapi v0.0.431 h1:oGyJaX7ERZZVqVQBQD2OtmUcArsWl+97tXMcLTerbPo=
github.com/openshift-online/ocm-api-model/clientapi v0.0.431/go.mod h1:fZwy5HY2URG9nrExvQeXrDU/08TGqZ16f8oymVEN5lo=
github.com/openshift-online/ocm-api-model/model v0.0.431 h1:vIuELb0uH2AkN5LMQLYbLrdYIULMEK6ctQkbdoNbEZQ=
github.com/openshift-online/ocm-api-model/model v0.0.431/go.mod h1:PQIoq6P8Vlb7goOdRMLK8nJY+B7HH0RTqYAa4kyidTE=
github.com/openshift-online/ocm-common v0.0.29 h1:EyKoLvQXKOa3UpoWHT3cMyNHBbhSZURC8Ws/cxTaT1U=
github.com/openshift-online/ocm-common v0.0.29/go.mod h1:VEkuZp9aqbXtetZ5ycND6QpvhykvTuBF3oPsVM1X3vI=
github.com/openshift-online/ocm-sdk-go v0.1.465 h1:RZr92sdcAKyLVcL19/RYOn6KVtspDUH1wc3UuO4LgiE=
github.com/openshift-online/ocm-sdk-go v0.1.465/go.mod h1:EOkylgH0bafd+SlU9YvMrIIxHJw0Hk1EnC7W1VZeW8I=
github.com/openshift-online/ocm-sdk-go v0.1.476 h1:l5gp/QEqnocqM02m7pDeS9ndXcCTBamewVSGaymd88Y=
github.com/openshift-online/ocm-sdk-go v0.1.476/go.mod h1:ds+aOAlQbiK0ubZP3CwXkzd7m48v6fMQ1ef9UCrjzBY=
github.com/openshift/rosa v1.2.55 h1:Y6UD1474aExF4bZSh2KH4zE+Xl2NVsiuj3TLQGT9U+Y=
github.com/openshift/rosa v1.2.55/go.mod h1:EE0yTEjbwxfnH/9YbQZaUXUVbIzfPa9KCRNw19QdLsw=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/ocm_client_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.