Skip to content

Commit

Permalink
Adds default sidecar cpu request and limit and add resources to the i…
Browse files Browse the repository at this point in the history
…nit container (#10759)
  • Loading branch information
tbcdns authored and etsybaev committed Mar 5, 2022
1 parent 9e1b5a1 commit ce7a154
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit ce7a154

Please sign in to comment.