diff --git a/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml b/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml index 22e808ed82..4d97e9d5c5 100644 --- a/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml +++ b/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml @@ -213,6 +213,12 @@ spec: description: The instance type to use, for example `r5.xlarge`. Instance type ref; https://aws.amazon.com/ec2/instance-types/ type: string + volumeSize: + description: VolumeSize set the disk volume size for the default + workers machine pool in Gib. The default is 300 GiB. + maximum: 16384 + minimum: 75 + type: integer type: object domainPrefix: description: |- diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml index a5786fd8bf..3756bf65b5 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_rosamachinepools.yaml @@ -219,6 +219,12 @@ spec: Version specifies the OpenShift version of the nodes associated with this machinepool. ROSAControlPlane version is used if not set. type: string + volumeSize: + description: VolumeSize set the disk volume size for the machine pool, + in Gib. The default is 300 GiB. + maximum: 16384 + minimum: 75 + type: integer required: - instanceType - nodePoolName diff --git a/controlplane/rosa/api/v1beta2/rosacontrolplane_types.go b/controlplane/rosa/api/v1beta2/rosacontrolplane_types.go index f14c59f781..bcc9ac33d7 100644 --- a/controlplane/rosa/api/v1beta2/rosacontrolplane_types.go +++ b/controlplane/rosa/api/v1beta2/rosacontrolplane_types.go @@ -308,6 +308,13 @@ type DefaultMachinePoolSpec struct { // must be equal or multiple of the availability zones count. // +optional Autoscaling *expinfrav1.RosaMachinePoolAutoScaling `json:"autoscaling,omitempty"` + + // VolumeSize set the disk volume size for the default workers machine pool in Gib. The default is 300 GiB. + // +kubebuilder:validation:Minimum=75 + // +kubebuilder:validation:Maximum=16384 + // +immutable + // +optional + VolumeSize int `json:"volumeSize,omitempty"` } // AWSRolesRef contains references to various AWS IAM roles required for operators to make calls against the AWS API. diff --git a/controlplane/rosa/controllers/rosacontrolplane_controller.go b/controlplane/rosa/controllers/rosacontrolplane_controller.go index 5a5b07a718..5c389e7894 100644 --- a/controlplane/rosa/controllers/rosacontrolplane_controller.go +++ b/controlplane/rosa/controllers/rosacontrolplane_controller.go @@ -957,6 +957,10 @@ func buildOCMClusterSpec(controlPlaneSpec rosacontrolplanev1.RosaControlPlaneSpe ocmClusterSpec.NetworkType = networkSpec.NetworkType } + if controlPlaneSpec.DefaultMachinePoolSpec.VolumeSize >= 75 { + ocmClusterSpec.MachinePoolRootDisk = &ocm.Volume{Size: controlPlaneSpec.DefaultMachinePoolSpec.VolumeSize} + } + // Set cluster compute autoscaling replicas // In case autoscaling is not defined and multiple zones defined, set the compute nodes equal to the zones count. if computeAutoscaling := controlPlaneSpec.DefaultMachinePoolSpec.Autoscaling; computeAutoscaling != nil { diff --git a/exp/api/v1beta2/rosamachinepool_types.go b/exp/api/v1beta2/rosamachinepool_types.go index 3b591dde65..2442d7c65a 100644 --- a/exp/api/v1beta2/rosamachinepool_types.go +++ b/exp/api/v1beta2/rosamachinepool_types.go @@ -93,6 +93,13 @@ type RosaMachinePoolSpec struct { // +optional AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"` + // VolumeSize set the disk volume size for the machine pool, in Gib. The default is 300 GiB. + // +kubebuilder:validation:Minimum=75 + // +kubebuilder:validation:Maximum=16384 + // +immutable + // +optional + VolumeSize int `json:"volumeSize,omitempty"` + // ProviderIDList contain a ProviderID for each machine instance that's currently managed by this machine pool. // +optional ProviderIDList []string `json:"providerIDList,omitempty"` diff --git a/exp/controllers/rosamachinepool_controller.go b/exp/controllers/rosamachinepool_controller.go index 41a8f15848..eb690a45f5 100644 --- a/exp/controllers/rosamachinepool_controller.go +++ b/exp/controllers/rosamachinepool_controller.go @@ -473,6 +473,9 @@ func nodePoolBuilder(rosaMachinePoolSpec expinfrav1.RosaMachinePoolSpec, machine if rosaMachinePoolSpec.AdditionalTags != nil { awsNodePool = awsNodePool.Tags(rosaMachinePoolSpec.AdditionalTags) } + if rosaMachinePoolSpec.VolumeSize > 75 { + awsNodePool = awsNodePool.RootVolume(cmv1.NewAWSVolume().Size(rosaMachinePoolSpec.VolumeSize)) + } npBuilder.AWSNodePool(awsNodePool) if rosaMachinePoolSpec.Version != "" { @@ -513,6 +516,7 @@ func nodePoolToRosaMachinePoolSpec(nodePool *cmv1.NodePool) expinfrav1.RosaMachi InstanceType: nodePool.AWSNodePool().InstanceType(), TuningConfigs: nodePool.TuningConfigs(), AdditionalSecurityGroups: nodePool.AWSNodePool().AdditionalSecurityGroupIds(), + VolumeSize: nodePool.AWSNodePool().RootVolume().Size(), // 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(), diff --git a/exp/controllers/rosamachinepool_controller_test.go b/exp/controllers/rosamachinepool_controller_test.go index 0ff8ae0c83..994ebbc742 100644 --- a/exp/controllers/rosamachinepool_controller_test.go +++ b/exp/controllers/rosamachinepool_controller_test.go @@ -24,6 +24,7 @@ func TestNodePoolToRosaMachinePoolSpec(t *testing.T) { AutoRepair: true, InstanceType: "m5.large", TuningConfigs: []string{"config1"}, + VolumeSize: 199, NodeDrainGracePeriod: &metav1.Duration{ Duration: time.Minute * 10, },