File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ const Env = z.object({
8989 KUBERNETES_CPU_REQUEST_RATIO : z . coerce . number ( ) . min ( 0 ) . max ( 1 ) . default ( 0.75 ) , // Ratio of CPU limit, so 0.75 = 75% of CPU limit
9090 KUBERNETES_MEMORY_REQUEST_MIN_GB : z . coerce . number ( ) . min ( 0 ) . default ( 0 ) ,
9191 KUBERNETES_MEMORY_REQUEST_RATIO : z . coerce . number ( ) . min ( 0 ) . max ( 1 ) . default ( 1 ) , // Ratio of memory limit, so 1 = 100% of memory limit
92+ KUBERNETES_MEMORY_OVERHEAD_GB : z . coerce . number ( ) . min ( 0 ) . optional ( ) , // Optional memory overhead to add to the limit in GB
9293
9394 // Placement tags settings
9495 PLACEMENT_TAGS_ENABLED : BoolEnv . default ( false ) ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export class KubernetesWorkloadManager implements WorkloadManager {
2525 private readonly cpuRequestRatio = env . KUBERNETES_CPU_REQUEST_RATIO ;
2626 private readonly memoryRequestMinGb = env . KUBERNETES_MEMORY_REQUEST_MIN_GB ;
2727 private readonly memoryRequestRatio = env . KUBERNETES_MEMORY_REQUEST_RATIO ;
28+ private readonly memoryOverheadGb = env . KUBERNETES_MEMORY_OVERHEAD_GB ;
2829
2930 constructor ( private opts : WorkloadManagerOptions ) {
3031 this . k8s = createK8sApi ( ) ;
@@ -319,9 +320,13 @@ export class KubernetesWorkloadManager implements WorkloadManager {
319320 }
320321
321322 #getResourceLimitsForMachine( preset : MachinePreset ) : ResourceQuantities {
323+ const memoryLimit = this . memoryOverheadGb
324+ ? preset . memory + this . memoryOverheadGb
325+ : preset . memory ;
326+
322327 return {
323328 cpu : `${ preset . cpu } ` ,
324- memory : `${ preset . memory } G` ,
329+ memory : `${ memoryLimit } G` ,
325330 } ;
326331 }
327332
You can’t perform that action at this time.
0 commit comments