Skip to content

Commit 26ccbda

Browse files
sbernaueradwk67maltesander
authored
Add concepts page on JVM argument overrides (#697)
* Add concepts page on JVM argument overrides * Apply suggestions from code review Co-authored-by: Andrew Kenworthy <1712947+adwk67@users.noreply.github.com> Co-authored-by: Malte Sander <malte.sander.it@gmail.com> * Reword merge mechanism * Update modules/concepts/pages/overrides.adoc --------- Co-authored-by: Andrew Kenworthy <1712947+adwk67@users.noreply.github.com> Co-authored-by: Malte Sander <malte.sander.it@gmail.com>
1 parent c318eb9 commit 26ccbda

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

modules/concepts/pages/overrides.adoc

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,72 @@ The `podOverrides` will be merged onto the following resources the operators dep
150150
They will *not* be applied to:
151151

152152
* Jobs, that are used to setup systems the product depends on e.g. create a database schema for Superset or Airflow.
153+
154+
[#jvm-argument-overrides]
155+
== JVM argument overrides
156+
157+
You can configure the JVM arguments used by JVM based tools.
158+
This is often needed to e.g. configure a HTTP proxy or other network settings.
159+
160+
As with other overrides, the operator generates a set of JVM arguments that are needed to run the tool. You can specify additional arguments which are merged on top of the ones the operator generated.
161+
As some JVM arguments are mutually exclusive (think of `-Xmx123m` and `-Xmx456m`), you also have the option to remove JVM arguments - either by specifying the exact argument or a regex.
162+
163+
The merging mechanism is applied <operator generated> <- <role user specified> <- <rolegroup user specified> and works as follows:
164+
165+
1. All arguments listed in user specified `remove` are removed from operator generated
166+
2. All arguments matching any regex from user removeRegex are removed from operator generated.
167+
The regex needs to match the entire argument, not only a substring
168+
3. All arguments from user specified `add` are added to operator
169+
170+
You can check the resulting effective JVM arguments by looking at the ConfigMap containing the config for the roleGroup (although some tools read the JVM arguments from environmental variables).
171+
172+
=== Simple example
173+
174+
One simple usage of this functionality is to add some JVM arguments, in this case needed for a special network setup:
175+
176+
[source,yaml]
177+
----
178+
kind: NifiCluster
179+
spec:
180+
# ...
181+
nodes:
182+
jvmArgumentOverrides:
183+
add: # Add some networking arguments
184+
- -Dhttps.proxyHost=proxy.my.corp
185+
- -Dhttps.proxyPort=8080
186+
- -Djava.net.preferIPv4Stack=true
187+
----
188+
189+
=== Advanced example
190+
191+
The following more advanced setups shows how the garbage collector can be changed, the JVM memory configs can be changed and how roleGroups can override roles.
192+
193+
[source,yaml]
194+
----
195+
kind: NifiCluster
196+
spec:
197+
# ...
198+
nodes:
199+
config:
200+
resources:
201+
memory:
202+
limit: 42Gi # We define some memory config, so that we can override it further down
203+
jvmArgumentOverrides:
204+
remove:
205+
- -XX:+UseG1GC # Remove argument generated by operator
206+
add: # Add some networking arguments
207+
- -Dhttps.proxyHost=proxy.my.corp
208+
- -Dhttps.proxyPort=8080
209+
- -Djava.net.preferIPv4Stack=true
210+
roleGroups:
211+
default:
212+
replicas: 1
213+
jvmArgumentOverrides:
214+
# We need more memory!
215+
removeRegex: # They need to match the entire string, not only a part!
216+
- -Xmx.* # So this will match "-Xmx123m", but not "-foo-Xmx123m"
217+
- -Dhttps.proxyPort=.* # Remove arguments from the role, so that we can override it
218+
add: # After we removed some arguments we can add the correct ones
219+
- -Xmx40000m
220+
- -Dhttps.proxyPort=1234 # Override arguments from the role
221+
----

0 commit comments

Comments
 (0)