You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/08/10 08:58:04 UTC

[GitHub] [flink-docker] wangyang0918 opened a new pull request #37: [FLINK-15793] Support native K8s mode

wangyang0918 opened a new pull request #37:
URL: https://github.com/apache/flink-docker/pull/37


   This PR will integrate flink`kubernetes-entry.sh` into the unified flink-docker `docker-entrypoint.sh`. After then users can enable build-in plugins much more easily. This is a prerequisite to remove `kubernetes-entry.sh` from Flink.
   
   # How to verify this PR?
   Update Flink code
   * Use `docker-entrypoint.sh` as entrypoint of JobManager and TaskManager pod
   * Add `native-k8s` as an argument
   
   Then run a Flink native K8s session or application, it should deploy successfully just as before.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] rmetzger merged pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
rmetzger merged pull request #37:
URL: https://github.com/apache/flink-docker/pull/37


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] wangyang0918 edited a comment on pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
wangyang0918 edited a comment on pull request #37:
URL: https://github.com/apache/flink-docker/pull/37#issuecomment-671774008


   @rmetzger I have added a `fixup` commit to address the comments. Please have another look.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] wangyang0918 commented on a change in pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #37:
URL: https://github.com/apache/flink-docker/pull/37#discussion_r468373814



##########
File path: docker-entrypoint.sh
##########
@@ -120,6 +120,16 @@ elif [ "$1" = "taskmanager" ]; then
     envsubst < "${CONF_FILE}" > "${CONF_FILE}.tmp" && mv "${CONF_FILE}.tmp" "${CONF_FILE}"
 
     exec $(drop_privs_cmd) "$FLINK_HOME/bin/taskmanager.sh" start-foreground "$@"
+elif [ "$1" = "native-k8s" ]; then
+    shift 1
+    copy_plugins_if_required
+
+    export _FLINK_HOME_DETERMINED=true
+    . $FLINK_HOME/bin/config.sh
+    export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS"
+    # Start commands for jobmanager and taskmanager are generated by Flink internally.
+    echo "Start command: $*"
+    exec bash -c "$@"

Review comment:
       I am just keeping the same behavior with `kubernetes-entry.sh`. I think you are right. We need to do `drop_privs_cmd` just like other commands.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] rmetzger commented on pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #37:
URL: https://github.com/apache/flink-docker/pull/37#issuecomment-671822539


   Thanks. The change looks good!
   
   Merging ...


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] wangyang0918 commented on pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #37:
URL: https://github.com/apache/flink-docker/pull/37#issuecomment-671246064


   cc @rmetzger Could help with the review?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] rmetzger commented on a change in pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
rmetzger commented on a change in pull request #37:
URL: https://github.com/apache/flink-docker/pull/37#discussion_r467971622



##########
File path: docker-entrypoint.sh
##########
@@ -120,6 +120,16 @@ elif [ "$1" = "taskmanager" ]; then
     envsubst < "${CONF_FILE}" > "${CONF_FILE}.tmp" && mv "${CONF_FILE}.tmp" "${CONF_FILE}"
 
     exec $(drop_privs_cmd) "$FLINK_HOME/bin/taskmanager.sh" start-foreground "$@"
+elif [ "$1" = "native-k8s" ]; then
+    shift 1
+    copy_plugins_if_required
+
+    export _FLINK_HOME_DETERMINED=true
+    . $FLINK_HOME/bin/config.sh
+    export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS"
+    # Start commands for jobmanager and taskmanager are generated by Flink internally.
+    echo "Start command: $*"
+    exec bash -c "$@"

Review comment:
       Any reason why you are not using `drop_privs_cmd` like the other commands?
   Many enterprise k8s environments require non-root container support, and it seems easy to support for us.

##########
File path: docker-entrypoint.sh
##########
@@ -120,6 +120,16 @@ elif [ "$1" = "taskmanager" ]; then
     envsubst < "${CONF_FILE}" > "${CONF_FILE}.tmp" && mv "${CONF_FILE}.tmp" "${CONF_FILE}"
 
     exec $(drop_privs_cmd) "$FLINK_HOME/bin/taskmanager.sh" start-foreground "$@"
+elif [ "$1" = "native-k8s" ]; then

Review comment:
       Why are did you not add this command to the output of the "help" command?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] wangyang0918 commented on a change in pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #37:
URL: https://github.com/apache/flink-docker/pull/37#discussion_r468373956



##########
File path: docker-entrypoint.sh
##########
@@ -120,6 +120,16 @@ elif [ "$1" = "taskmanager" ]; then
     envsubst < "${CONF_FILE}" > "${CONF_FILE}.tmp" && mv "${CONF_FILE}.tmp" "${CONF_FILE}"
 
     exec $(drop_privs_cmd) "$FLINK_HOME/bin/taskmanager.sh" start-foreground "$@"
+elif [ "$1" = "native-k8s" ]; then

Review comment:
       Will add `native-k8s` to help message.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink-docker] wangyang0918 commented on pull request #37: [FLINK-15793] Support native K8s mode

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #37:
URL: https://github.com/apache/flink-docker/pull/37#issuecomment-671774008


   @rmetzger I have added a `fixup` commit to address the comments.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org