Skip to content

Commit ce9b967

Browse files
authored
Adds default sidecar cpu request and limit and add resources to the init container (#10759)
1 parent 016a401 commit ce9b967

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ public class KubePodProcess extends Process implements KubePod {
102102
private static final String INIT_CONTAINER_NAME = "init";
103103
private static final String DEFAULT_MEMORY_REQUEST = "25Mi";
104104
private static final String DEFAULT_MEMORY_LIMIT = "50Mi";
105+
private static final String DEFAULT_CPU_REQUEST = "0.1";
106+
private static final String DEFAULT_CPU_LIMIT = "0.2";
105107
private static final ResourceRequirements DEFAULT_SIDECAR_RESOURCES = new ResourceRequirements()
106-
.withMemoryLimit(DEFAULT_MEMORY_LIMIT).withMemoryRequest(DEFAULT_MEMORY_REQUEST);
108+
.withMemoryLimit(DEFAULT_MEMORY_LIMIT).withMemoryRequest(DEFAULT_MEMORY_REQUEST)
109+
.withCpuLimit(DEFAULT_CPU_LIMIT).withCpuRequest(DEFAULT_CPU_REQUEST);
107110

108111
private static final String PIPES_DIR = "/pipes";
109112
private static final String STDIN_PIPE_FILE = PIPES_DIR + "/stdin";
@@ -176,6 +179,7 @@ private static Container getInit(final boolean usesStdin,
176179
.withImage(busyboxImage)
177180
.withWorkingDir(CONFIG_DIR)
178181
.withCommand("sh", "-c", initCommand)
182+
.withResources(getResourceRequirementsBuilder(DEFAULT_SIDECAR_RESOURCES).build())
179183
.withVolumeMounts(mainVolumeMounts)
180184
.build();
181185
}

0 commit comments

Comments
 (0)