# 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
data
section so that the Entando Operator can manage resource settings.
entando.k8s.operator.impose.limits: "true"
# Profile Options
The three methods to insert configuration profiles are:
Currently, the following resources for memory and CPU can be specified. When you specify a limit
on a resource, it is the maximum allowed for the container. Resource settings help Kubernetes determine in which node a pod should be created.
resources.limits.cpu: integer, millicpus
resources.limits.memory: integer, mebibytes
# Configuration
A profile is a set of configurations encoded as YAML but embedded in the OperatorConfigMap
as a string, since ConfigMaps cannot be multilevel. The examples below use YOUR-PLUGIN-ID
and YOUR-PROFILE-NAME
as placeholders for your names. Also note |-
in the sample codes to specify each new line is read as such.
# 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
OperatorConfigMap
of 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
profileMapping
file atdata/entando.plugins.profileMapping
:
data:
entando.plugins.profileMapping: |-
your-plugin-id: YOUR-PROFILE-NAME
# Method 3: Default Profile
- Add the profile to the
OperatorConfigMap
in 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.