Skip to content

Support Kubernetes Quantity format when specifying functions resources #9753

@fantapsody

Description

@fantapsody

Is your enhancement request related to a problem? Please describe.
When specifying resources in either function worker configuration (min/max/...) or function APIs (creation), the specified value must be an explicit number, just as the official example shows:

$ bin/pulsar-admin functions create \
  --jar target/my-functions.jar \
  --classname org.example.functions.MyFunction \
  --cpu 8 \
  --ram 8589934592 \
  --disk 10737418240

Especially for the storage which could be a large number, it's tedious and error-prone to specify these values as decimals explicitly.

Describe the solution you'd like
Maybe pulsar could take the example of the pattern of how Kubernetes define the value of resources:

  • 12Mi: 12 * (2 ^ 20)
  • 12M: 12 * (10 ^ 6)
  • 1000m: 1 cpu

Describe alternatives you've considered
Maybe the storage quantity should be prioritized.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staletype/enhancementThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions