Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-21128

Rethink how Kubernetes interfaces with our docker image

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              wangyang0918 Yang Wang
              chesnay Chesnay Schepler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: