Skip to content

add resource request and limit for server pods #2462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ class ItParameterizedDomain {
private static String miiDomainNegativeNamespace = null;
private static String miiImage = null;
private static String encryptionSecretName = "encryptionsecret";
private static Map<String, Quantity> resourceRequest = new HashMap<>();
private static Map<String, Quantity> resourceLimit = new HashMap<>();

private String curlCmd = null;

Expand Down Expand Up @@ -264,6 +266,11 @@ public static void initAll(@Namespaces(6) List<String> namespaces) {
nodeportshttp = getServiceNodePort(nginxNamespace, nginxServiceName, "http");
logger.info("NGINX http node port: {0}", nodeportshttp);

// set resource request and limit
resourceRequest.put("cpu", new Quantity("250m"));
resourceRequest.put("memory", new Quantity("768Mi"));
resourceLimit.put("cpu", new Quantity("2"));
resourceLimit.put("memory", new Quantity("2Gi"));

// create model in image domain with multiple clusters
miiDomain = createMiiDomainWithMultiClusters(miiDomainUid, miiDomainNamespace);
Expand Down Expand Up @@ -926,7 +933,10 @@ private static Domain createMiiDomainWithMultiClusters(String domainUid, String
.value("-Dweblogic.StdoutDebugEnabled=false"))
.addEnvItem(new V1EnvVar()
.name("USER_MEM_ARGS")
.value("-Djava.security.egd=file:/dev/./urandom ")))
.value("-Djava.security.egd=file:/dev/./urandom "))
.resources(new V1ResourceRequirements()
.requests(resourceRequest)
.limits(resourceLimit)))
.adminServer(new AdminServer()
.serverStartState("RUNNING")
.adminService(new AdminService()
Expand Down Expand Up @@ -1089,7 +1099,10 @@ private static Domain createDomainOnPvUsingWdt(String domainNamespace) {
.claimName(pvcName)))
.addVolumeMountsItem(new V1VolumeMount()
.mountPath("/u01/shared")
.name(pvName)))
.name(pvName))
.resources(new V1ResourceRequirements()
.limits(resourceLimit)
.requests(resourceRequest)))
.adminServer(new AdminServer()
.serverStartState("RUNNING")
.adminService(new AdminService()
Expand Down Expand Up @@ -1427,8 +1440,8 @@ private static Domain createAndVerifyDomainInImageUsingWdt(String domainNamespac
.name("USER_MEM_ARGS")
.value("-Djava.security.egd=file:/dev/./urandom "))
.resources(new V1ResourceRequirements()
.limits(new HashMap<>())
.requests(new HashMap<>())))
.limits(resourceLimit)
.requests(resourceRequest)))
.adminServer(new AdminServer()
.serverStartState("RUNNING")
.adminService(new AdminService()
Expand Down