Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve DSL syntax for resource requirements quantity #5

Open
teyckmans opened this issue Mar 20, 2019 · 2 comments
Open

improve DSL syntax for resource requirements quantity #5

teyckmans opened this issue Mar 20, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@teyckmans
Copy link
Collaborator

teyckmans commented Mar 20, 2019

This needs some polishing:

requests {
    request("cpu") {
        quantity("500m")
    }
    request("memory") {
        quantity("250Mi")
    }
}
limits {
    limit("cpu") {
        quantity("1000m")
    }
    limit("memory") {
        quantity("500Mi")
    }
}

Would be nice to have this:

requests {
    cpu(500, [MILLICPU, MILLICORES])
    memory(250, [E, P, T, G, M, K, Ei, Pi, Ti, Gi, Mi, Ki])
}

With m and Mi being values of enums.

@teyckmans
Copy link
Collaborator Author

teyckmans commented May 20, 2019

might be better/cleaner to solve this with an extension function

resources(
    cpuRequest="500m", 
    memoryRequest="250Mi",
    cpuLimit="1000m",
    memoryLimit="500Mi"
)

@teyckmans
Copy link
Collaborator Author

it may be needed to model the unit, to allow for smart policies to set limit, e.g. maxMemory(10, G)

@teyckmans teyckmans added the enhancement New feature or request label May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant