From 3102a35be9530f259f5b34b467631537ccccc639 Mon Sep 17 00:00:00 2001 From: Thibaud Chardonnens Date: Tue, 1 Mar 2022 13:42:18 +0100 Subject: [PATCH] add default sidecar cpu request and limit and add resources to the init container --- .../java/io/airbyte/workers/process/KubePodProcess.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java b/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java index ee6c9754d369..2ddba00dfa4a 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java @@ -102,8 +102,11 @@ public class KubePodProcess extends Process implements KubePod { private static final String INIT_CONTAINER_NAME = "init"; private static final String DEFAULT_MEMORY_REQUEST = "25Mi"; private static final String DEFAULT_MEMORY_LIMIT = "50Mi"; + private static final String DEFAULT_CPU_REQUEST = "0.1"; + private static final String DEFAULT_CPU_LIMIT = "0.2"; private static final ResourceRequirements DEFAULT_SIDECAR_RESOURCES = new ResourceRequirements() - .withMemoryLimit(DEFAULT_MEMORY_LIMIT).withMemoryRequest(DEFAULT_MEMORY_REQUEST); + .withMemoryLimit(DEFAULT_MEMORY_LIMIT).withMemoryRequest(DEFAULT_MEMORY_REQUEST) + .withCpuLimit(DEFAULT_CPU_LIMIT).withCpuRequest(DEFAULT_CPU_REQUEST); private static final String PIPES_DIR = "/pipes"; private static final String STDIN_PIPE_FILE = PIPES_DIR + "/stdin"; @@ -176,6 +179,7 @@ private static Container getInit(final boolean usesStdin, .withImage(busyboxImage) .withWorkingDir(CONFIG_DIR) .withCommand("sh", "-c", initCommand) + .withResources(getResourceRequirementsBuilder(DEFAULT_SIDECAR_RESOURCES).build()) .withVolumeMounts(mainVolumeMounts) .build(); }