# Plugin Configuration Profiles
This tutorial describes three methods to utilize configuration profiles to specify resource allocation for Entando plugins. This provides a simple way to customize plugin deployment parameters for improved efficiency.
# Prerequisites
- Add an Entando Operator ConfigMap if needed
- Enable this property under the
datasection so that the Entando Operator can manage resource settings.
entando.k8s.operator.impose.limits: "true"
# Profile Options
A profile is a set of configurations encoded as YAML embedded in the OperatorConfigMap as a string, since ConfigMaps cannot be multilevel.
The three methods to insert configuration profiles are:
# Configuration
Currently, the resources for memory and CPU can be specified. When you specify a limit on a resource, it is the upper limit allowed for the container. The units for the resources are listed below but should not be included in the specification. Resource settings help Kubernetes determine in which node a pod should be created.
resources.limits.cpu: integer, millicpus
resources.limits.memory: integer, mebibytes
The examples below use YOUR-PLUGIN, YOUR-PLUGIN-CODE, YOUR-ORG, YOUR-BUNDLE and YOUR-PROFILE-NAME as placeholders. Also note the use of |- to designate a new line in the code.
# Retrieve the Plugin ID
You will need to retrieve the Plugin ID which is calculated during installation and written to the EntandoPlugin Custom Resource as part of the deployment of the plugin microservice. Use the following command from the project directory
ent prj get-plugin-id --auto
If you just have a bundle, use this command with the appropriate parameters
ent ecr get-plugin-id --autho --repo=YOUR-BUNDLE-REPO-URL
Example:
$ ent ecr get-plugin-id --auto --repo=https://github.com/entando-samples/entando-hub-application-bundle.git
pn-cee95efc-77ff566e-entandopsdh-entando-hub-catalog-ms
# Method 1: Inline Profile
Add the parameters to the OperatorConfigMap as an inline profile at data/entando.profile.plugins.YOUR-PLUGIN-ID.
Example:
data:
entando.profile.plugins.YOUR-PLUGIN-ID: |-
resources.limits.cpu: "1000"
resources.limits.memory: "2000"
# Method 2: Mapped Profile
- Create the parameter profile in the
OperatorConfigMapof the data profile atdata/entando.profile.YOUR-PROFILE-NAME.
Example:
data:
entando.profile.YOUR-PROFILE-NAME: |-
resources.limits.cpu: "1000"
resources.limits.memory: "2000"
- Add a reference in the
profileMappingfile atdata/entando.plugins.profileMapping:
data:
entando.plugins.profileMapping: |-
your-plugin-id: YOUR-PROFILE-NAME
# Method 3: Default Profile
- Add the profile to the
OperatorConfigMapin the data section atdata/entando.profile.YOUR-PROFILE-NAME.
data:
entando.profile.YOUR-PROFILE-NAME: |-
resources.limits.cpu: "1000"
resources.limits.memory: "2000"
- Add a reference to the profile at
data/entando.plugins.defaultProfile:
data:
entando.plugins.defaultProfile: YOUR-PROFILE-NAME
# References
Please refer to the Kubernetes documentation on Resources (opens new window) for more details.