Skip to content

Commit a5e2027

Browse files
docs: Document JSON Patch
1 parent d7ff3a4 commit a5e2027

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

docs/modules/opensearch/pages/usage-guide/configuration-environment-overrides.adoc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The cluster definition also supports overriding configuration properties, enviro
44
either per role or per role group, where the more specific override (role group) has precedence over
55
the less specific one (role).
66

7-
IMPORTANT: Overriding certain properties which are set by the operator (such as the `network.host`) can interfere with the operator and can lead to problems.
7+
CAUTION: Overriding certain properties which are set by the operator (such as the `network.host`) can interfere with the operator and can lead to problems.
88

99
== Configuration Properties
1010

@@ -36,7 +36,7 @@ nodes:
3636
----
3737

3838
Property values must be strings when defined as key-value pairs.
39-
To override properties using other types or nested structures, use a JSON merge patch by placing the properties under `jsonMergePatch`:
39+
To override properties using other types or nested structures, use a JSON Merge Patch by placing the properties under `jsonMergePatch`:
4040

4141
[source,yaml]
4242
----
@@ -50,6 +50,26 @@ nodes:
5050
- CN=opensearch-admin-certificate
5151
----
5252

53+
NOTE: A JSON Merge Patch is the recommended method for overriding configuration settings.
54+
55+
Use a JSON Patch when you need finer-grained control, e.g. to remove a setting.
56+
Define a JSON Patch using the `jsonPatch` property, which accepts a list of operations:
57+
58+
[source,yaml]
59+
----
60+
nodes:
61+
configOverrides:
62+
opensearch.yml:
63+
jsonPatch:
64+
- op: add
65+
path: /plugins.security.authcz.admin_dn
66+
value: CN=opensearch-admin-certificate
67+
- op: remove
68+
path: /plugins.security.allow_default_init_securityindex
69+
----
70+
71+
CAUTION: The operator only logs a warning if the JSON Patch could not be applied and continues with the unpatched configuration.
72+
5373
The entire configuration file can be replaced using the `userProvided` property:
5474

5575
[source,yaml]
@@ -61,7 +81,7 @@ nodes:
6181
plugins.security.restapi.roles_enabled: all_access
6282
----
6383

64-
NOTE: Replacing the entire configuration file is not recommended, as all properties normally managed by the operator must be explicitly provided to obtain a working OpenSearch cluster.
84+
WARNING: Replacing the entire configuration file is not recommended, as all properties normally managed by the operator must be explicitly provided to obtain a working OpenSearch cluster.
6585

6686
For a list of configuration options, we refer to the
6787
https://docs.opensearch.org/docs/latest/install-and-configure/configuring-opensearch/index/[Configuring OpenSearch{external-link-icon}^] section in the OpenSearch documentation.

0 commit comments

Comments
 (0)