-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat: Documentation for starting standalone schema manager #5101
Changes from 10 commits
8f35dc0
1472c61
0c08cee
4c8b223
def8773
4b1f930
d6c9bba
ec198b3
6a78531
21430f7
1760e61
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 |
---|---|---|
@@ -0,0 +1,282 @@ | ||
--- | ||
id: elasticsearch-without-cluster-privileges | ||
title: "Elasticsearch without cluster privileges" | ||
--- | ||
|
||
In case the Camunda single application cannot access Elasticsearch with cluster privileges, it is possible to run the schema manager as a stand-alone application separate from the main application. The schema manager solely creates all necessary Elasticsearch Indices. In this case, elevated privileges are only required for the schema creation, the single application does not need to have cluster privileges to work any more. | ||
|
||
:::note Database Support | ||
This feature is only available from version 8.6.10 on and is also only supported for Elasticsearch installations (no OpenSearch support). | ||
grlimacan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
::: | ||
|
||
:::note Essential privileges required by the single application | ||
An index-level privilege of at least `manage` is still required for the Camunda single application to work properly. | ||
::: | ||
|
||
## Setup | ||
|
||
For this setup to work, the database schema must be initialized first (step 1). This requires cluster level privileges for the database. This only needs to be executed once. | ||
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. ❓
Wouldn't this be, this needs to be executed once on the first installation, and then every time they perform an update? Or are we not discussing updates? Because they will eventually update, and they will need to run it again at that point. 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. Following this discussion it is better to leave as is to avoid confusion. We will update this text before 8.6.11 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. Do we have a way to ensure it will be done before the next update? Note that the next patch is coming out this Tuesday 😄 I mean, I don't expect we have schema changes until then, so it's fine. But you get the idea ;) |
||
Once the schema is initialized, the application can be started without cluster level privileges (step 2). The steps are described in detail below. | ||
|
||
### 1. Initialize the Schema Manager | ||
|
||
The schema manager is started as a separate standalone Java application and is responsible for creating and managing the database schema and applying database settings, such as retention policies for example. | ||
This step requires cluster level privileges for the database and only needs to be executed once per installation. | ||
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. ❓ Do we need to specify the required permissions? Or is there an ES equivalent, i.e. saying |
||
|
||
#### 1.1 Configure Schema Manager | ||
|
||
Create an additional custom configuration for the schema manager with the following values: | ||
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. 🔧 The configuration below implies they want ILM. Maybe we can add a note that the configuration can be tweaked based on existing configuration (link to the respective components configuration), but that config here would be a minimal sample configuration. 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've added a note on the config file about ILM. About the existing configuration, that is what is implied with |
||
|
||
``` | ||
zeebe.broker.exporters.elasticsearch: | ||
className: io.camunda.zeebe.exporter.ElasticsearchExporter | ||
args: | ||
index: | ||
createTemplate: true | ||
retention: | ||
enabled: true | ||
# Example assuming an existing user called 'camunda-admin' who has 'superuser' privileges | ||
authentication: | ||
username: camunda-admin | ||
password: camunda123 | ||
camunda: | ||
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. this configuration requires tasklist and operate to know the elasticsearchs url in the form of this example: camunda.operate.elasticsearch.url: "http://camunda-elasticsearch:9200" and camunda.tasklist.elasticsearch.url: "http://camunda-elasticsearch:9200" 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 left this undefined on purpose, because I am only documenting the necessary changes additionally to the settings the customer already has. When left unset, in our example, all tools will use the default |
||
operate: | ||
elasticsearch: | ||
# Example assuming an existing user called 'camunda-admin' who has 'superuser' privileges | ||
username: camunda-admin | ||
password: camunda123 | ||
healthCheckEnabled: false | ||
archiver: | ||
ilmEnabled: true | ||
tasklist: | ||
elasticsearch: | ||
# Example assuming an existing user called 'camunda-admin' who has 'superuser' privileges | ||
username: camunda-admin | ||
password: camunda123 | ||
healthCheckEnabled: false | ||
archiver: | ||
ilmEnabled: true | ||
|
||
``` | ||
|
||
#### 1.2 Start the Schema Manager with the config above | ||
|
||
Start the Java application `schema` (or `schema.bat` for Windows) provided in the `bin` folder of the delivered jar file. The schema manager will create the necessary indices and templates in the database and apply the respective settings. | ||
Assuming the configuration above was saved in a file named `schema-manager.yaml`, you can start the application with the following command: | ||
|
||
``` | ||
SPRING_CONFIG_ADDITIONALLOCATION=/path/to/schema-manager.yaml ./bin/schema | ||
``` | ||
|
||
Verify that the application executed successfully. | ||
|
||
### 2. Start the Camunda single application | ||
|
||
The Camunda single application can now be started without cluster level privileges. The application will connect to the database and use the schema created by the schema manager. | ||
|
||
#### 2.1 Ensure that an Elasticsearch user with sufficient privileges exists | ||
|
||
The application requires a database user with at least `manage` privileges on the indices it is meant to work with. | ||
|
||
If preferred, you can use an existing user with the required privileges. Alternatively the required privileges can be assigned to an example user named `camunda-app` with the following request to the Elasticsearch REST API: | ||
|
||
``` | ||
PUT _security/role/read_write_role | ||
{ | ||
"indices": [ | ||
{ | ||
"names": [ | ||
"*" | ||
], | ||
"privileges": [ | ||
"read", | ||
"write", | ||
"view_index_metadata" | ||
], | ||
"allow_restricted_indices": false | ||
}, | ||
{ | ||
"names": [ | ||
"operate-*", | ||
"tasklist-*", | ||
"zeebe-*" | ||
], | ||
"privileges": [ | ||
"manage" | ||
], | ||
"allow_restricted_indices": false | ||
} | ||
], | ||
"applications": [], | ||
"run_as": [], | ||
"metadata": {}, | ||
"transient_metadata": { | ||
"enabled": true | ||
} | ||
} | ||
``` | ||
|
||
Then, assign the user to the role defined above. For example, if Elasticsearch is running on Docker, this can be achieved with the following command: | ||
|
||
``` | ||
docker exec -t elasticsearch elasticsearch-users useradd camunda-app -p camunda123 | ||
docker exec -t elasticsearch elasticsearch-users roles camunda-app -a read_write_role | ||
``` | ||
|
||
#### 2.2 Configure the Camunda single application | ||
|
||
Create a configuration for the Camunda single application with the values below. This essentially disables schema creation for the app. | ||
|
||
``` | ||
zeebe.broker.exporters.elasticsearch: | ||
className: io.camunda.zeebe.exporter.ElasticsearchExporter | ||
args: | ||
index: | ||
createTemplate: false | ||
retention: | ||
enabled: false | ||
managePolicy: false | ||
# Example assuming an existing user called 'camunda-app' with the privileges described in 2.1 | ||
authentication: | ||
username: camunda-app | ||
password: camunda123 | ||
camunda: | ||
tasklist: | ||
elasticsearch: | ||
createSchema: false | ||
username: camunda-app | ||
password: camunda123 | ||
healthCheckEnabled: false | ||
zeebeElasticsearch: | ||
# Example assuming an existing user called 'camunda-app' with the privileges described in 2.1 | ||
username: camunda-app | ||
password: camunda123 | ||
archiver: | ||
ilmEnabled: false | ||
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. Please note that I removed these 3 params that were present in our test-config so that standard values are used:
|
||
ilmManagePolicy: false | ||
migration: | ||
migrationEnabled: false | ||
operate: | ||
elasticsearch: | ||
createSchema: false | ||
username: camunda-app | ||
password: camunda123 | ||
healthCheckEnabled: false | ||
zeebeElasticsearch: | ||
# Example assuming an existing user called 'camunda-app' with the privileges described in 2.1 | ||
username: camunda-app | ||
password: camunda123 | ||
archiver: | ||
ilmEnabled: false | ||
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. Please note that I removed these 3 params that were present in our test-config so that standard values are used:
|
||
migration: | ||
migrationEnabled: false | ||
``` | ||
|
||
#### 2.3 Start the application with the above configuration | ||
|
||
#### Starting the application from the JAR file | ||
|
||
Start the Java application `camunda` (or `camunda.bat` for Windows) provided in the `bin` folder of the delivered JAR file. | ||
Assuming the configuration above was saved in a file named `application-custom.yaml`, you can start the application with the following command: | ||
|
||
``` | ||
SPRING_CONFIG_ADDITIONALLOCATION=/path/to/application-custom.yaml ./bin/camunda | ||
``` | ||
|
||
#### Starting the application using Helm charts | ||
|
||
##### Case 1: Auto-generated app config by Helm chart | ||
|
||
[Spring Boot convention](https://docs.spring.io/spring-boot/reference/features/external-config.html#features.external-config.typesafe-configuration-properties.relaxed-binding.environment-variables) environment variables can be used to override configuration. | ||
|
||
These are the Helm values needed to disable the schema manager in the Camunda apps. | ||
|
||
``` | ||
# Helm chart values file. | ||
zeebe: | ||
env: | ||
- name: ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_INDEX_CREATETEMPLATE | ||
value: "false" | ||
- name: ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_RETENTION_ENABLED | ||
value: "false" | ||
- name: ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_RETENTION_MANAGEPOLICY | ||
value: "false" | ||
|
||
tasklist: | ||
env: | ||
- name: CAMUNDA_TASKLIST_ELASTICSEARCH_CREATESCHEMA | ||
value: "false" | ||
- name: CAMUNDA_TASKLIST_ELASTICSEARCH_HEALTHCHECKENABLED | ||
value: "false" | ||
- name: CAMUNDA_TASKLIST_ARCHIVER_ILMENABLED | ||
value: "false" | ||
- name: CAMUNDA_TASKLIST_ARCHIVER_ILMMANAGEPOLICY | ||
value: "false" | ||
- name: CAMUNDA_TASKLIST_MIGRATION_MIGRATIONENABLED | ||
value: "false" | ||
|
||
operate: | ||
env: | ||
- name: CAMUNDA_OPERATE_ELASTICSEARCH_CREATESCHEMA | ||
value: "false" | ||
- name: CAMUNDA_OPERATE_ELASTICSEARCH_HEALTHCHECKENABLED | ||
value: "false" | ||
- name: CAMUNDA_OPERATE_ARCHIVER_ILMENABLED | ||
value: "false" | ||
- name: CAMUNDA_OPERATE_MIGRATION_MIGRATIONENABLED | ||
value: "false" | ||
``` | ||
|
||
##### Case 2: Manually-managed app config by the user | ||
|
||
If the application configurations are managed directly and do not rely on the Helm chart auto-generated configuration. | ||
|
||
``` | ||
# Helm chart values file. | ||
|
||
zeebe: | ||
configuration | | ||
[...] # Any other custom config. | ||
zeebe.broker.exporters.elasticsearch: | ||
className: io.camunda.zeebe.exporter.ElasticsearchExporter | ||
args: | ||
index: | ||
createTemplate: false | ||
retention: | ||
enabled: false | ||
managePolicy: false | ||
[...] # Any other custom config. | ||
|
||
tasklist: | ||
configuration | | ||
[...] # Any other custom config. | ||
camunda.tasklist: | ||
elasticsearch: | ||
createSchema: false | ||
healthCheckEnabled: false | ||
archiver: | ||
ilmEnabled: false | ||
ilmManagePolicy: false | ||
migration: | ||
migrationEnabled: false | ||
[...] # Any other custom config. | ||
|
||
operate: | ||
configuration | | ||
[...] # Any other custom config. | ||
camunda.operate: | ||
grlimacan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
elasticsearch: | ||
createSchema: false | ||
healthCheckEnabled: false | ||
archiver: | ||
ilmEnabled: false | ||
migration: | ||
migrationEnabled: false | ||
[...] # Any other custom config. | ||
``` | ||
|
||
## Limitations | ||
|
||
- This feature is only available for the Camunda `8.6.10` version and above. | ||
- This feature only works for installations using Elasticsearch. | ||
- Camunda Optimize cannot be executed with this setup. |
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.
🔧 I would omit the sentence
The schema manager solely creates all necessary Elasticsearch Indices
. I think it just leads to confusion (since it actually does more than this anyway), and gives unnecessary details. We can leave it at that the application creates the necessary schema for C8 to run afterwards without cluster privileges.🔧 Similarly, we use
elevated privileges
andcluster privileges
interchangeably, and I don;'t know if that's true? I would pick one, likelycluster level privileges
, and just stick to it.