-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add ability to scale Ephemeral storage along with memory, similar to CPU #5008
Conversation
@@ -108,7 +108,12 @@ class WhiskPodBuilder(client: NamespacedKubernetesClient, config: KubernetesClie | |||
.getOrElse(Map.empty) | |||
|
|||
val diskLimit = config.ephemeralStorage | |||
.map(diskConfig => Map("ephemeral-storage" -> new Quantity(diskConfig.limit.toMB + "Mi"))) | |||
.map(diskConfig => | |||
if (diskConfig.scaleFactor > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can diskConfig.scaleFactor
be null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't think null was a valid value for a Double but, maybe I'm mixing up languages. Will test thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
based on KubernetesEphemeralStorageConfig
sig it should not be null, but technically it might be possible; If null was allowed, it should be Option[Doube]
; I would leave it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks reasonable to me.
.map(diskConfig => Map("ephemeral-storage" -> new Quantity(diskConfig.limit.toMB + "Mi"))) | ||
.map(diskConfig => | ||
if (diskConfig.scaleFactor > 0) { | ||
Map("ephemeral-storage" -> new Quantity(diskConfig.scaleFactor * memory.toMB + "Mi")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should still be a limit - i.e. use the scale factor unless the result is > some limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a fair critique. Will do that and adjust the docs.
Building on setting a simple limit for k8s ephemeral storage this introduces another config setting to also allow scaling the storage based on the memory.
Description
Along with CPU it seems reasonable action developers may need more disk as their actions use more and more memory. Ideally, we'd start to tease all this apart to allow developers to request a variety of resources but this simply creates a similar setting as CPU to allow the disk capacity to stretch along with memory.
Related issue and scope
My changes affect the following components
Types of changes
Checklist: