Configure Application Containers
Many aspects of Commerce application container configuration are specified in files that are checked into source control, in the CloudOps for Kubernetes Git project cloud-ops-kubernetes under path terraform/commerce-stack/env-file. Elastic Path refers to these files as Resource Profiles.
The Resource Profiles specify configuration values that can be tuned per environment type, such as memory and CPU allocation for the various application containers.
Two Resource Profile files are included out of the box:
terraform/commerce-stack/env-file/dev.tfvars: An example that is a suitable starting point for a development or QA environment.terraform/commerce-stack/env-file/prod-small.tfvars: An example that is a suitable starting point for a production environment with low load requirements.
Creating a Custom Resource Profile
If is common for Commerce environments to be tuned to meet unique requirements. Complete the below steps to create custom resourcing profiles, to tune your Commerce container configuration.
Copy one of the existing files to a new file in the
terraform/commerce-stack/env-filedirectory. Ensure that new file has no spaces in the name and has the.tfvarsextension.Make the desired changes to the values in the new
*.tfvarsfile.Commit and push the changes to the CloudOps for Kubernetes repository and branch used by the Jenkins job
deploy-or-delete-commerce-stack.
You can create multiple resource profiles. It is possible to have a different resource profile for each type of environment, or even a unique profile for each environment.
Using the Resource Profiles
You specify which resource profile to use when you configure a Commerce environment using the deploy-or-delete-commmerce-stack Jenkins job. That job contains a parameter named epStackResourcingProfile, and that parameter is where you specify which resource profile to use for the given Commerce environment.
The value to specify for parameter epStackResourcingProfile is the file name, minus the extension. For example:
If you want to use
terraform/commerce-stack/env-file/prod-small.tfvarsthen specifyprod-smallin parameterepStackResourcingProfile.If you created and want to use a custom file named
terraform/commerce-stack/env-file/my-custom-profile1.tfvarsthen specifymy-custom-profile1in parameterepStackResourcingProfile.
Contents of the Resource Profile Files
The Resource Profile files contain various values that impact different aspect of the container configuration. The details below are a guide to the purpose to the various values in the files.
Used to configure the Kubernetes container resource allocation:
EP_*_CPU_CORESEP_*_CONTAINER_MEMORY
Used to configure the Java Virtual Machine (JVM) heap size:
EP_*_JVM_MEMORYUsed to configure the Horizontal Pod Autoscaler (HPA), if the HPA enabled in the
deploy-or-delete-commmerce-stackJenkins with parameterincludeHorizontalPodAutoscalers:EP_*_MIN_REPLICASEP_*_MIN_REPLICASEP_*_TARGET_CPU_UTILIZATIONEP_*_MAX_SURGEEP_*_MAX_UNAVAIL
Used to configure the size and cleanup of the volume used to store Java heap dumps:
EP_HEAPDUMP_PVC_SIZEEP_APP_HEAPDUMP_MAX_USAGE
Used to define JVM arguments used by all Commerce applications:
EP_X_JVM_ARGSUsed to define JVM arguments for specific Commerce applications:
EP_BATCH_X_JVM_ARGSEP_CM_X_JVM_ARGSEP_CORTEX_X_JVM_ARGSEP_SYNC_X_JVM_ARGSEP_INTEGRATION_X_JVM_ARGSEP_SEARCH_X_JVM_ARGS
important
To use the above JVM arguments for specific Commerce applications, ensure that you are using and building your Commerce images with Commerce containerization tools that support this option.
The following versions of the Elastic Path Docker project support this feature.
- Release
4.5.2and higher. - Release
4.4.5and higher. - Release
4.3.5and higher.