Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Our native Kubernetes integration assembles a java command that is passed to the docker-script, which first does some magical stuff to create the classpath
# Set the Flink related environments export _FLINK_HOME_DETERMINED=true . $FLINK_HOME/bin/config.sh export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS"
and then evaluates the given java command.
This magical stuff is a bit problematic for a few reasons:
1) it is only required for Kubernetes to work; it should not be executed in any other case
2) it appears to be required for running anything in Flink that is not part of the docker-entrypoint API (e.g., jobmanager) when it isn't.
3) it unnecessarily spreads kubernetes-specific logic across the flink and flink-docker repositories.
A simple change would be to introduce dedicated Kubernetes scripts into the distribution, which for starters will just import config.sh, export FLINK_CLASSPATH and evaluate the given command.
In the long-run it would be good if we would not create a java command but instead relied on the existing scripts which do exactly that already.
As is stands we're duplicating code across the distribution and the Kubernetes module, which already caused troubles when we did the log4j2 migration.
Ideally we find a way to reuse the existing code in the Kubernetes module for generating these commands in the existing scripts, e.g., by moving them to the BashJavaUtils.
Attachments
Issue Links
- causes
-
FLINK-24334 Configuration kubernetes.flink.log.dir not working
- Closed
-
FLINK-24353 Bash scripts do not respect dynamic configurations when calculating memory sizes
- Closed
- is depended upon by
-
FLINK-21554 Remove the magical classpath setting stuff in docker-entrypoint.sh
- Closed
- links to