Skip to content

WIP: add throughput field to EBSBlockDevice in machine-api#2220

Closed
sjenning wants to merge 1 commit intoopenshift:masterfrom
sjenning:machine-api-aws-throughput
Closed

WIP: add throughput field to EBSBlockDevice in machine-api#2220
sjenning wants to merge 1 commit intoopenshift:masterfrom
sjenning:machine-api-aws-throughput

Conversation

@sjenning
Copy link
Copy Markdown
Contributor

@sjenning sjenning commented Mar 5, 2025

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 5, 2025

Hello @sjenning! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 5, 2025
@openshift-ci openshift-ci Bot requested review from deads2k and mandre March 5, 2025 19:12
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sjenning

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 5, 2025
// it is not used in requests to create gp2, st1, sc1, or standard volumes.
// +optional
Iops *int64 `json:"iops,omitempty"`
// Throughput to provision in MiB/s. This parameter is valid only for gp3 volumes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CAPI docs:

Throughput to provision in MiB/s supported for the volume type. Not applicable to all types.

Do we want to echo that punt to AWS? Or do we want the inlined AWS context you have here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was following this, which I felt was more informative.

https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html

"This only applies to the enumerated volume types" is more helpful than "This doesn't apply to some unenumerated volumes types"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it is more helpful while it's accurate, but it means you're on the hook to keep it accurate. The rate of AWS-side changes is likely not high, so it could go either way. I'm just pointing out that CAPI has gone the punt-to-AWS way.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 5, 2025

@sjenning: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/lint 9eb52a8 link true /test lint
ci/prow/verify 9eb52a8 link true /test verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Iops *int64 `json:"iops,omitempty"`
// Throughput to provision in MiB/s. This parameter is valid only for gp3 volumes.
//
// Constraints: 125-1000 for General Purpose SSD (gp3)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we validate this constraints with min/max and that this is only set when VolumeType=gp3 with CEL

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we also doc what's default if unset and since this is mutable what happens if changed day2?

//
// Constraints: 125-1000 for General Purpose SSD (gp3)
// +optional
Throughput *int64 `json:"throughput,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm still learning the ropes for what guidelines we typically follow for the openshift APIs when reviewing the machine APIs as they don't result in CRDs. I'm going to review this change from a standard openshift API change perspective and may make some slight tweaks based on what I do know about how the machine types are used.

// throughput is an optional field used to specify the throughput, in MiB/s, that the volume should be provisioned with.
// throughput may be specified when volumeType is set to gp3 and is forbidden otherwise.
// throughput must be greater than or equal to 125 and less than or equal to 1000.
  • With a constraint of 125 - 1000 it seems like this doesn't really need to be an int64 and could instead be an int32. I see that the upstream equivalent field is an int64 and int64 is used throughout this type so I won't hold you to this, but worth mentioning.
  • This field is optional, which means that even when volumeType is set to gp3 a user doesn't have to specify this. Is there a default value that is set if this field is omitted?
  • Doesn't need to be included in the change here, but a link to where the validations for this field are implemented would be handy to better understand the constraints that should be specified for this field.
  • Note: the GoDoc for the volumeType has no mention of gp3 as an allowed value. I think this aligns with @wking's previous comment of needing to be on top of maintaining this as things change if we want to be explicit in the GoDoc of what is and is not supported.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also worth noting that this doesn't need to be a pointer if it's omitempty, a Go marshalled zero value won't show up so it won't trigger the validation on size limits

@sjenning
Copy link
Copy Markdown
Contributor Author

sjenning commented Mar 6, 2025

Decided I didn't want to take this on. Future is CAPI and might just wait for it to arrive. Thanks for the reviews though!

@sjenning sjenning closed this Mar 6, 2025
@wking
Copy link
Copy Markdown
Member

wking commented Jan 23, 2026

Hey, #2480 added ThroughputMib for gp3 in 4.21! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants