File tree Expand file tree Collapse file tree
JobProxyKubernetes/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/kubernetes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ private String startContainerTask(Task t) {
6161
6262 Container containers = new ContainerBuilder ()
6363 .withName (containerUUID )
64+ .withNewResources ()
65+ .addToLimits ("cpu" , new Quantity (t .getCores ().toString ()))
66+ .addToLimits ("memory" , new Quantity (t .getMemory ().toString ()))
67+ .addToRequests ("cpu" , new Quantity (t .getCores ().toString ()))
68+ .addToRequests ("memory" , new Quantity (t .getMemory ().toString ()))
69+ .endResources ()
6470 .withImage (t .getContainer ().getImage ())
6571 .withCommand (t .getCmd ().split (" " ))
6672 .withVolumeMounts (containerVolumes ).build ();
@@ -84,6 +90,10 @@ private String startNonContainerTask(Task t) {
8490 Container containers = new ContainerBuilder ()
8591 .withName (containerUUID )
8692 .withImage (DEFAULT_IMAGE )
93+ .withNewResources ()
94+ .addToLimits ("cpu" , new Quantity ("1" ))
95+ .addToRequests ("memory" , new Quantity ("200" ))
96+ .endResources ()
8797 .withCommand (t .getCmd ().split (" " )).build ();
8898
8999 ObjectMeta meta = new ObjectMetaBuilder ().withNamespace (KUBERNETES_NAMESPACE ).withName (containerUUID ).build ();
You can’t perform that action at this time.
0 commit comments