Skip to content

Commit 3d98eab

Browse files
ankitasguptaJesper Pedersen
authored and
Jesper Pedersen
committed
Set CPU Request
1 parent 91021e2 commit 3d98eab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

k8s-deployer/src/main/java/io/hyperfoil/deploy/k8s/K8sDeployer.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,13 @@ public DeployedAgent start(Agent agent, String runId, Benchmark benchmark, Consu
143143
int threads = agent.threads() < 0 ? benchmark.defaultThreads() : agent.threads();
144144
ResourceRequirements resourceRequirements = new ResourceRequirements();
145145
Map<String, Quantity> podResourceRequests = new LinkedHashMap<>();
146-
podResourceRequests.put("cpu", new Quantity(String.valueOf(threads)));
146+
String cpuRequest = agent.properties.getOrDefault(
147+
"pod-cpu",
148+
Properties.get("io.hyperfoil.deployer.k8s.pod.cpu", null)
149+
);
150+
if (cpuRequest != null) {
151+
podResourceRequests.put("cpu", new Quantity(cpuRequest));
152+
}
147153
String memoryRequest = agent.properties.getOrDefault(
148154
"pod-memory",
149155
Properties.get("io.hyperfoil.deployer.k8s.pod.memory", null)

0 commit comments

Comments
 (0)