[jira] [Created] (FLINK-21128) Rethink how Kubernetes interfaces with our docker image

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-21128) Rethink how Kubernetes interfaces with our docker image

Shang Yuanchun (Jira)
Chesnay Schepler created FLINK-21128:
----------------------------------------

             Summary: Rethink how Kubernetes interfaces with our docker image
                 Key: FLINK-21128
                 URL: https://issues.apache.org/jira/browse/FLINK-21128
             Project: Flink
          Issue Type: Improvement
          Components: Deployment / Kubernetes, Deployment / Scripts
            Reporter: Chesnay Schepler
             Fix For: 1.13.0


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

{code}
# Set the Flink related environments
export _FLINK_HOME_DETERMINED=true
. $FLINK_HOME/bin/config.sh
export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS"
{code}

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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)