Dennis-Mircea commented on PR #691:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/691#issuecomment-4457782384

   
   
   
   
   > The spark operator can automatically add the "add-opens" JVM arguments 
based on the JDK version. Can Flink also automatically add these?
   > 
   > <img alt="image" width="1682" height="291" 
src="https://private-user-images.githubusercontent.com/1145830/592946830-4dd22972-c302-4e8c-bc54-9926c989217f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Nzg4Mjg4MTksIm5iZiI6MTc3ODgyODUxOSwicGF0aCI6Ii8xMTQ1ODMwLzU5Mjk0NjgzMC00ZGQyMjk3Mi1jMzAyLTRlOGMtYmM1NC05OTI2Yzk4OTIxN2YucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDUxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA1MTVUMDcwMTU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDIzMTU5YmZlNTUwMGZjNDA5NGZlMmRhZmFkZGZkZTBmMWZhZmRkY2Q4MGNkODllMTBiZTZmZGY2MTU4YWMzZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.XyasADmz8_LClr4Q7VNIjOGEusP2aViSeaPZBu5L2oY";>
   
   Hi @melin, two things, since this PR and your question are actually about 
different layers.
   
   **This PR (test-time)**: PR #691 added `--add-opens` for the Maven Surefire 
JVM via the `surefire.module.config` property, so the operator's own unit tests 
pass on JDK 17. That setup is still in place today in `pom.xml`, 
`flink-autoscaler/pom.xml`, and `flink-kubernetes-operator/pom.xml`. The only 
thing that has shifted since the PR was opened is the CI JDK baseline, which 
moved from `[11, 17]` to `[17, 21]` (`.github/workflows/ci.yml`). No automatic 
JDK detection is needed here because the build's supported JDK range is fixed 
by CI.
   
   **Your question (runtime, managed Flink jobs)**: For the JM/TM JVMs of 
managed `FlinkDeployment`s, the operator already auto-applies the JDK 17 
`--add-exports` / `--add-opens` set, keyed on the Flink version, via the 
chart's default `flink-conf.yaml` 
([conf/flink-conf.yaml#L26-L27](https://github.com/apache/flink-kubernetes-operator/blob/main/helm/flink-kubernetes-operator/conf/flink-conf.yaml#L26-L27)):
   
   ```yaml
   
kubernetes.operator.default-configuration.flink-version.v1_18.env.java.opts.all:
 ...
   
kubernetes.operator.default-configuration.flink-version.v1_19+.env.java.default-opts.all:
 ...
   ```
   
   Keying on Flink version is sufficient because each version has a fixed 
supported JDK baseline (1.18+ requires JDK 11+), so the flags are always safe 
to apply.
   
   The 1.18 vs 1.19+ split also handles user overrides cleanly:
   - 1.18 (`env.java.opts.all`) is fully overridden if the user sets their own, 
so they must re-include the flags.
   - 1.19+ (`env.java.default-opts.all`) is appended by Flink, so user-supplied 
`opts.all` keeps the defaults.
   
   The operator JVM itself uses a separate knob (`jvmArgs.operator`), empty by 
default, since the operator code runs cleanly on JDK 17 without these flags.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to