Skip to content

Commit 3a79d64

Browse files
committed
Add concepts page on JVM argument overrides
1 parent f027151 commit 3a79d64

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

modules/concepts/pages/overrides.adoc

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,73 @@ 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 times 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 following:
164+
165+
Let user be the user-specified arguments and operator be the arguments generated by the operator.
166+
167+
1. All arguments listed in user `remove` are removed from operator
168+
2. All arguments matching any regex from user `removeRegex` are removed from operator
169+
3. All arguments from user `add` are added to operator
170+
171+
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 variable).
172+
173+
=== Simple example
174+
175+
One simple usage of this functionality is to add some JVM arguments, in this case needed for a special network setup:
176+
177+
[source,yaml]
178+
----
179+
kind: NifiCluster
180+
spec:
181+
# ...
182+
nodes:
183+
jvmArgumentOverrides:
184+
add: # Add some networking arguments
185+
- -Dhttps.proxyHost=proxy.my.corp
186+
- -Dhttps.proxyPort=8080
187+
- -Djava.net.preferIPv4Stack=true
188+
----
189+
190+
=== Advanced example
191+
192+
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.
193+
194+
[source,yaml]
195+
----
196+
kind: NifiCluster
197+
spec:
198+
# ...
199+
nodes:
200+
config:
201+
resources:
202+
memory:
203+
limit: 42Gi # We define some memory config, so that we can override it further down
204+
jvmArgumentOverrides:
205+
remove:
206+
- -XX:+UseG1GC # Remove argument generated by operator
207+
add: # Add some networking arguments
208+
- -Dhttps.proxyHost=proxy.my.corp
209+
- -Dhttps.proxyPort=8080
210+
- -Djava.net.preferIPv4Stack=true
211+
roleGroups:
212+
default:
213+
replicas: 1
214+
jvmArgumentOverrides:
215+
# We need more memory!
216+
removeRegex: # They need to match the entire string, not only a part!
217+
- -Xmx.* # So this will match "-Xmx123m", but not "-foo-Xmx123m"
218+
- -Dhttps.proxyPort=.* # Remove arguments from the role, so that we can override it
219+
add: # After we removed some arguments we can add the correct ones
220+
- -Xmx40000m
221+
- -Dhttps.proxyPort=1234 # Override arguments from the role
222+
----

0 commit comments

Comments
 (0)