Skip to content
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

Merged
merged 2 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions vuepress/docs/.vuepress/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@ module.exports = {
title: 'Manage NGINX',
path: path + 'devops/manage-nginx.md',
},
{
title: 'Plugin Configuration',
path: path + 'devops/plugin-configuration.md',
},
{
title: 'Configure the Entando Operator',
path: path + 'devops/entando-operator.md',
},
]
},
]
Expand Down
13 changes: 12 additions & 1 deletion vuepress/docs/next/docs/reference/entando-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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)

```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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Expand Down
32 changes: 32 additions & 0 deletions vuepress/docs/next/tutorials/devops/entando-operator.md
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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)



47 changes: 29 additions & 18 deletions vuepress/docs/next/tutorials/devops/plugin-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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:

Expand All @@ -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`:

Expand All @@ -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]`.
Copy link
Contributor

Choose a reason for hiding this comment

The 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:
Copy link
Contributor

Choose a reason for hiding this comment

The 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.


Expand Down