@@ -61,6 +61,10 @@ class KubernetesProvider(ExecutionProvider, RepresentationMixin):
6161 Memory limits of the blocks (pods), in Mi or Gi.
6262 This is the memory "requests" option for resource specification on kubernetes.
6363 Check kubernetes docs for more details. Default is 250Mi.
64+ extra_requests: Dict[str, str]
65+ Extra resource requests of the blocks (pods). Check kubernetes docs for more details.
66+ extra_limits: Dict[str, str]
67+ Extra resource limits of the blocks (pods). Check kubernetes docs for more details.
6468 parallelism : float
6569 Ratio of provisioned task slots to active tasks. A parallelism value of 1 represents aggressive
6670 scaling where as many resources as possible are used; parallelism close to 0 represents
@@ -98,6 +102,8 @@ def __init__(self,
98102 max_mem : str = "500Mi" ,
99103 init_cpu : float = 1 ,
100104 init_mem : str = "250Mi" ,
105+ extra_requests : Optional [Dict [str , str ]] = None ,
106+ extra_limits : Optional [Dict [str , str ]] = None ,
101107 parallelism : float = 1 ,
102108 worker_init : str = "" ,
103109 pod_name : Optional [str ] = None ,
@@ -142,6 +148,8 @@ def __init__(self,
142148 self .max_mem = max_mem
143149 self .init_cpu = init_cpu
144150 self .init_mem = init_mem
151+ self .extra_requests = extra_requests if extra_requests else {}
152+ self .extra_limits = extra_limits if extra_limits else {}
145153 self .parallelism = parallelism
146154 self .worker_init = worker_init
147155 self .secret = secret
@@ -300,9 +308,9 @@ def _create_pod(self,
300308 volume_mounts .append (client .V1VolumeMount (mount_path = volume [1 ],
301309 name = volume [0 ]))
302310 resources = client .V1ResourceRequirements (limits = {'cpu' : str (self .max_cpu ),
303- 'memory' : self .max_mem },
311+ 'memory' : self .max_mem } | self . extra_limits ,
304312 requests = {'cpu' : str (self .init_cpu ),
305- 'memory' : self .init_mem }
313+ 'memory' : self .init_mem } | self . extra_requests ,
306314 )
307315 # Configure Pod template container
308316 container = client .V1Container (
0 commit comments