-
Notifications
You must be signed in to change notification settings - Fork 23
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
ENDOC-438 Refine the config profiles, add doc on the config map, exte… #462
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,8 +166,19 @@ ent prj be-test-run | |
``` sh | ||
ent prj fe-test-run | ||
``` | ||
|
||
See [this tutorial](../../tutorials/create/ms/run-local.md) for more details. | ||
|
||
### Get the Bundle ID and Plugin ID | ||
Entando will use a unique identifier for your bundle as a way to provide additional security controls around bundle-specific resources. You can determine this identifier with this command | ||
```sh | ||
ent prj get-bundle-id --auto | ||
``` | ||
|
||
If you have a microservice plugin in your project, an unique identifier will be calculated for it as well. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "a unique" (i looked it up to doublecheck :P) |
||
```sh | ||
ent prj get-plugin-id --auto --repo=<BUNDLE-REPO-URL> | ||
``` | ||
|
||
## Bundle Commands | ||
Use the `ent bundler` command to prepare a bundle for publication or extract a bundle from an application | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Configure the Entando Operator | ||
This tutorial demonstrates how to provide a ```ConfigMap``` for the Entando Operator to customize its behavior. | ||
|
||
## Prerequisites | ||
The Entando Operator makes use of an optional ```ConfigMap``` named ```entando-operator-config```. It must be present in the same namespace. In a quickstart environment you can check for its presence with this command: | ||
```sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think there should be a comma after "environment"... @jyunmitch? |
||
kubectl get configmap -n entando | ||
``` | ||
|
||
## Add a new ConfigMap | ||
If the ```ConfigMap``` doesn't already exist, you can use a template as a starting point. | ||
```sh | ||
curl -sfL "https://raw.githubusercontent.com/entando/entando-releases/v7.0.0/dist/ge-1-1-6/samples/entando-operator-config.yaml" | ||
``` | ||
|
||
Edit ```entando-operator-config.yaml``` to adjust existing settings or add new ones. You can then apply it to Kubernetes. | ||
|
||
```sh | ||
kubectl apply -f entando-operator-config.yaml -n entando | ||
``` | ||
|
||
The Entando Operator will automatically reload the settings from the new ```ConfigMap```. You can verify the reload by checking the logs in the operator pod. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "automatically reloads" (present tense) |
||
|
||
## Update an existing ConfigMap | ||
If the ```ConfigMap``` already exists, you can edit the ```ConfigMap``` to adjust existing settings or add new ones. | ||
```sh | ||
kubectl edit configmap/entando-operator-config -n entando | ||
``` | ||
|
||
The Entando Operator will automatically reload the settings from the ```ConfigMap```. You can verify the reload by checking the logs in the operator pod. Some settings may only take effect when a deployment is first created, for example, timeout settings or cpu limits. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. automatically reloads "...created, for example, timeout..." -> "...created, e.g. timeout..." (to avoid use of the comma to introduce the example verbiage) |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,52 @@ | |
sidebarDepth: 2 | ||
--- | ||
|
||
# Customize Deployment with Plugin Configuration Profiles | ||
# 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. | ||
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](./entando-operator.md) if needed | ||
* Enable this property under the `data` section so that the Entando Operator can manage resource settings. | ||
```yaml | ||
entando.k8s.operator.impose.limits: "true" | ||
``` | ||
|
||
## Profile Options | ||
|
||
The three methods to insert configuration profiles are: | ||
1. [Inline Profile](#method-1-inline-profile) | ||
2. [Mapped Profile](#method-2-mapped-profile) | ||
3. [Default Profile](#method-3-default-profile) | ||
|
||
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. The `request` is the basic amount required of each resource for a container in a pod. These determine which node a pod is assigned to. | ||
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. | ||
|
||
```yaml | ||
resources.limits.cpu: integer, millicpus | ||
resources.limits.memory: integer, mebibytes | ||
resources.requests.cpu: integer, millicpus | ||
resources.requests.memory: integer, mebibytes | ||
``` | ||
|
||
## Configuration | ||
A profile is a set of configurations encoded as YAML but embedded in the `OperatorConfigMap` as a string, as ConfigMaps can't be multilevel. The examples below use `[your-plugin-id]` and `[your-profile]` as placeholders for your names. Also note `|-` in the sample codes to specify each new line is read as such. | ||
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]` as placeholders for your names. Also note `|-` in the sample codes to specify each new line is read as such. | ||
|
||
### Retrieve the Plugin ID | ||
First 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 micro-service. Use the following command: | ||
First you will need to [retrieve the Plugin ID](../../docs/reference/entando-cli.md) 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comma after "First" you will need -> you need comma after "Plugin ID" |
||
```sh | ||
ent prj get-plugin-id --auto | ||
``` | ||
ent prj get-plugin-id | ||
|
||
If you just have a bundle, use this command with the appropriate parameters | ||
```sh | ||
ent ecr get-plugin-id --autho --repo=<BUNDLE-REPO-URL> | ||
``` | ||
Example: | ||
```sh | ||
$ 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]`. | ||
Add the parameters to the `OperatorConfigMap` as an inline profile at `data/entando.profile.plugins.[your-plugin-id]`. | ||
|
||
Example: | ||
|
||
|
@@ -40,20 +56,16 @@ data: | |
entando.profile.plugins.your-plugin-id: |- | ||
resources.limits.cpu: "1000" | ||
resources.limits.memory: "2000" | ||
resources.requests.cpu: "500" | ||
resources.requests.memory: "500" | ||
``` | ||
### Method 2: Mapped Profile | ||
1. Create the parameter profile in the `OperatorConfigMap` of the data profile at `data/entando.profile.[your-profile]`. | ||
1. Create the parameter profile in the `OperatorConfigMap` of the data profile at `data/entando.profile.[your-profile]`. | ||
|
||
Example: | ||
```yaml | ||
data: | ||
entando.profile.your-profile: |- | ||
resources.limits.cpu: "1000" | ||
resources.limits.memory: "2000" | ||
resources.requests.cpu: "500" | ||
resources.requests.memory: "500" | ||
``` | ||
2. Add a reference in the `profileMapping` file at `data/entando.plugins.profileMapping`: | ||
|
||
|
@@ -64,24 +76,23 @@ data: | |
``` | ||
|
||
### Method 3: Default Profile | ||
1. Create the parameter profile in the `OperatorConfigMap` in the data profile file at `data/entando.profile.[your-profile]`. | ||
1. Create the parameter profile in the `OperatorConfigMap` in the data profile file at `data/entando.profile.[your-profile]`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can omit "file" (reads awkwardly and no "file" follows "profile" above) |
||
|
||
```yaml | ||
data: | ||
entando.profile.your-profile: |- | ||
resources.limits.cpu: "1000" | ||
resources.limits.memory: "2000" | ||
resources.requests.cpu: "500" | ||
resources.requests.memory: "500" | ||
``` | ||
|
||
2. Add a reference to the profile at data/entando.plugins.defaultProfile: | ||
2. Add a reference to the profile at data/entando.plugins.defaultProfile: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. backticks on path (used above) |
||
|
||
```yaml | ||
data: | ||
entando.plugins.defaultProfile: your-profile | ||
``` | ||
|
||
## References | ||
Please refer to the [Kubernetes documentation on Resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for more details. | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will use -> uses (present tense convention)