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/05/06 02:23:07 UTC

[GitHub] [flink] wangyang0918 opened a new pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Travis CI to do that following [this guide](https://flink.apache.org/contributing/contribute-code.html#open-a-pull-request).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   The PR is to support application mode for the Kubernetes. The start command is very similar to Yarn integration just like following. Non-ha and HA mode both should work as expected.
   ```
   flink run-application -t kubernetes-application \
       -Dkubernetes.cluster-id=${CLUSTER_ID} \
       -Dkubernetes.container.image=${FLINK_IMAGE_NAME} \
       -Djobmanager.memory.process.size=2048m \
       -Dkubernetes.jobmanager.cpu=1 \
       -Dkubernetes.taskmanager.cpu=1 \
       -Dkubernetes.rest-service.exposed.type=NodePort \
       local:///opt/flink/examples/streaming/WindowJoin.jar
   ```
   
   How to specify user jar and classpath?
   In native K8s application, when the jobmanager is launched, all the user jar and dependencies have already existed(e.g. built in the image, or downloaded by init-container). 
   
   The user jar should be specified with schema `local://`, which means it exists in the jobmanager side.
   
   For the dependencies, users could put it in the `$FLINK_HOME/usrlib` directory, the jars located in the usrlib will be automatically added to the user classpath. They could also specify the user classpath via `-C/--classpath` of `flink run-application` command.
   
   
   
   ## Brief change log
   
   * Make flink run-application could support local schema
   * Support application mode for kubernetes
   * Add e2e tests for Kubernetes application mode
   * Set log4j for Kubernetes cli
   
   
   ## Verifying this change
   * The changes is covered by new added UT and e2e test(`test_kubernetes_application.sh`)
   * Manually test in a real K8s cluster for the non-HA and HA mode
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (**yes** / no / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (**yes** / no)
     - If yes, how is the feature documented? (will update the doc in a separate ticket)
   


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57b669055ef7388e1a70ed54263e9fca1b2f9fc8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   Rebase the latest master to enable e2e test for k8s application mode `test_kubernetes_application.sh`.


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @kl0u I am afraid that we could reuse`jarsOnClasspath` because it means the jar is located in the classpath. However, for K8s application, user could specify an arbitrary jar anywhere in the image. Maybe in the future we could remove `jarsOnClassPath` since we do not call `setJarsOnClassPath` in the production code.
   
    For `YarnApplicationClusterEntryPoint`, `KubernetesApplicationClusterEntrypoint `, `StandaloneJobClusterEntrypoint`, they have some similar logics about `getPackagedProgram` and `getPackagedProgramRetriever`. I agree with you that we could deduplicate them in the follow-ups.
   
   @zhengcanbin I also find this issue when i test the K8s application mode. After add i small sleep(or any other command) via `kubernetes.container-start-command-template`. It could work. I think it because the `PID` 1 is not the java process and will not make response to the `SIGTERM`.
   
   We need to create a new follow-up ticket for this issue and find a proper solution.


----------------------------------------------------------------
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] kl0u commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
kl0u commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625131324


   Thanks @wangyang0918 , I am having a look right now.


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 068f558f4deeb9ddbb4cb0ea8013bbe099e912cd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658) 
   * e4018f5fcffebdab1398266c65de191385554859 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 068f558f4deeb9ddbb4cb0ea8013bbe099e912cd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e4018f5fcffebdab1398266c65de191385554859 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667) 
   * 2cc10767854d49f63c6677e7f9217f2c89b8b306 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2cc10767854d49f63c6677e7f9217f2c89b8b306 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] wangyang0918 edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @kl0u I am afraid that we could reuse`jarsOnClasspath` because it means the jar is located in the classpath. However, for K8s application, user could specify an arbitrary jar anywhere in the image. Maybe in the future we could remove `jarsOnClassPath` since we do not call `setJarsOnClassPath` in the production code.
   
    For `YarnApplicationClusterEntryPoint`, `KubernetesApplicationClusterEntrypoint `, `StandaloneJobClusterEntrypoint`, they have some similar logics about `getPackagedProgram` and `getPackagedProgramRetriever`. I agree with you that we could deduplicate them in the follow-ups.


----------------------------------------------------------------
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] kl0u commented on a change in pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
kl0u commented on a change in pull request #12003:
URL: https://github.com/apache/flink/pull/12003#discussion_r421490583



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
##########
@@ -222,6 +223,25 @@
 		Never
 	}
 
+	/**
+	 * The deployment target names for Kubernetes.

Review comment:
       I have a branch with the proposed change here https://github.com/kl0u/flink/commit/c575102f3c3659885a7176def196666bd046e50f :)




----------------------------------------------------------------
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] wangyang0918 edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @zhengcanbin I also find this issue when i test the K8s application mode. After adding small `sleep`(or any other command) via `kubernetes.container-start-command-template`. It could work. I think it because the `PID` 1 is not the java process and will not respond to the `SIGTERM`.
   
   We need to create a new follow-up ticket for this issue and find a proper solution.


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   The e2e tests failed because of a known issue FLINK-17416(Flink-kubernetes doesn't work on java 8 8u252).


----------------------------------------------------------------
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] kl0u closed pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
kl0u closed pull request #12003:
URL: https://github.com/apache/flink/pull/12003


   


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 068f558f4deeb9ddbb4cb0ea8013bbe099e912cd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e4018f5fcffebdab1398266c65de191385554859 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667) 
   * 2cc10767854d49f63c6677e7f9217f2c89b8b306 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] zhengcanbin commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625621280


   Thanks for raising this PR, @wangyang0918 @kl0u!
   I glanced at this PR quickly and a question comes to mind: is there an automatic way to clean up the K8s resources once the Application finishes?


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e4018f5fcffebdab1398266c65de191385554859 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4488730c9004250063a6d26ae980ad8816a62999",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797",
       "triggerID" : "4488730c9004250063a6d26ae980ad8816a62999",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57b669055ef7388e1a70ed54263e9fca1b2f9fc8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713) 
   * 42d28bc43d900c8f13a6cdee75146739cebd3260 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792) 
   * 4488730c9004250063a6d26ae980ad8816a62999 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 068f558f4deeb9ddbb4cb0ea8013bbe099e912cd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658) 
   * e4018f5fcffebdab1398266c65de191385554859 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4488730c9004250063a6d26ae980ad8816a62999",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797",
       "triggerID" : "4488730c9004250063a6d26ae980ad8816a62999",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4488730c9004250063a6d26ae980ad8816a62999 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624411858


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 068f558f4deeb9ddbb4cb0ea8013bbe099e912cd (Wed May 06 02:34:19 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @kl0u I have addressed the comments and 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] wangyang0918 commented on a change in pull request #12003: [FLINK-10934] Support application mode for kubernetes

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



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java
##########
@@ -146,8 +148,38 @@ public String getClusterDescription() {
 	@Override
 	public ClusterClientProvider<String> deployApplicationCluster(
 			final ClusterSpecification clusterSpecification,
-			final ApplicationConfiguration applicationConfiguration) {
-		throw new UnsupportedOperationException("Application Mode not supported by Active Kubernetes deployments.");
+			final ApplicationConfiguration applicationConfiguration) throws ClusterDeploymentException {
+		if (client.getRestService(clusterId).isPresent()) {
+			throw new ClusterDeploymentException("The Flink cluster " + clusterId + " already exists.");
+		}
+
+		checkNotNull(clusterSpecification);
+		checkNotNull(applicationConfiguration);
+
+		final String deploymentTarget = flinkConfig.get(DeploymentOptions.TARGET);
+
+		if (!KubernetesConfigOptions.DeploymentTargetNames.APPLICATION.getName().equalsIgnoreCase(deploymentTarget)) {
+			throw new ClusterDeploymentException(
+				"Couldn't deploy Kubernetes Application Cluster." +
+					" Expected deployment.target=" + KubernetesConfigOptions.DeploymentTargetNames.APPLICATION.getName() +
+					" but actual one was \"" + deploymentTarget + "\"");
+		}
+
+		applicationConfiguration.applyToConfiguration(flinkConfig);
+		KubernetesUtils.checkJarFileForApplicationMode(flinkConfig);

Review comment:
       Yes, it is a sanity check and to make the submission could fail fast. I will also use `Preconditions.checkArgument` to check only one jar is returned just like in the `KubernetesApplicationClusterEntrypoint`.




----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4488730c9004250063a6d26ae980ad8816a62999",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797",
       "triggerID" : "4488730c9004250063a6d26ae980ad8816a62999",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7dc5c774f8cf7c35ac3c63b0193f82510f88b45e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7dc5c774f8cf7c35ac3c63b0193f82510f88b45e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4488730c9004250063a6d26ae980ad8816a62999 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797) 
   * 7dc5c774f8cf7c35ac3c63b0193f82510f88b45e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @zhengcanbin I also find this issue when i test the K8s application mode. After add i small sleep(or any other command) via `kubernetes.container-start-command-template`. It could work. I think it because the `PID` 1 is not the java process and will not make response to the `SIGTERM`.
   
   We need to create a new follow-up ticket for this issue and find a proper solution.


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @kl0u I have integrated your comments and force pushed. Also i disable the new added application test(`test_kubernetes_application.sh`), which could pass except java 8u252. Until FLINK-17416 resolved, it could be enabled again.
   
   Please have a 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] kl0u commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
kl0u commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625190375


   Sounds good @wangyang0918 !


----------------------------------------------------------------
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] kl0u commented on a change in pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
kl0u commented on a change in pull request #12003:
URL: https://github.com/apache/flink/pull/12003#discussion_r421475927



##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/ClassPathPackagedProgramRetriever.java
##########
@@ -75,16 +75,21 @@
 	@Nullable
 	private final File userLibDirectory;
 
+	@Nullable
+	private final File jarFile;
+

Review comment:
       Although unrelated to this PR, I think we should annotate this class as `@Internal`. 

##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/utils/KubernetesUtils.java
##########
@@ -179,6 +187,22 @@ public static String getCommonStartCommand(
 		return BootstrapTools.getStartCommand(commandTemplate, startCommandValues);
 	}
 
+	public static File checkJarFileForApplicationMode(Configuration configuration) {

Review comment:
       I think here we can return the whole list, and check for the size later, in the `KubernetesApplicationClusterEntrypoint.getPackagedProgramRetriever()` as there it is the relevant place for the check. Here this method can remain general enough. 
   
   So this can become:
   ```
   public static List<File> checkJarFileForApplicationMode(Configuration configuration) {
   		return configuration.get(PipelineOptions.JARS).stream().map(
   			FunctionUtils.uncheckedFunction(
   				uri -> {
   					final URI jarURI = PackagedProgramUtils.resolveURI(uri);
   					if (jarURI.getScheme().equals("local") && jarURI.isAbsolute()) {
   						return new File(jarURI.getPath());
   					}
   					throw new IllegalArgumentException("Only support local schema for application mode. \"local\" means the " +
   						"jar is located in the image, not Flink client. e.g. local:///opt/flink/examples/streaming/WindowJoin.jar");
   				})
   		).collect(Collectors.toList());
   	}
   ```
   
   and in the `entrypoint` we can have:
   
   ```
   final List<File> pipelineJars = KubernetesUtils.checkJarFileForApplicationMode(configuration);
   Preconditions.checkArgument(pipelineJars.size() == 1, "Should only have one jar");
   ```

##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java
##########
@@ -146,8 +148,38 @@ public String getClusterDescription() {
 	@Override
 	public ClusterClientProvider<String> deployApplicationCluster(
 			final ClusterSpecification clusterSpecification,
-			final ApplicationConfiguration applicationConfiguration) {
-		throw new UnsupportedOperationException("Application Mode not supported by Active Kubernetes deployments.");
+			final ApplicationConfiguration applicationConfiguration) throws ClusterDeploymentException {
+		if (client.getRestService(clusterId).isPresent()) {
+			throw new ClusterDeploymentException("The Flink cluster " + clusterId + " already exists.");
+		}
+
+		checkNotNull(clusterSpecification);
+		checkNotNull(applicationConfiguration);
+
+		final String deploymentTarget = flinkConfig.get(DeploymentOptions.TARGET);
+
+		if (!KubernetesConfigOptions.DeploymentTargetNames.APPLICATION.getName().equalsIgnoreCase(deploymentTarget)) {
+			throw new ClusterDeploymentException(
+				"Couldn't deploy Kubernetes Application Cluster." +
+					" Expected deployment.target=" + KubernetesConfigOptions.DeploymentTargetNames.APPLICATION.getName() +
+					" but actual one was \"" + deploymentTarget + "\"");
+		}
+
+		applicationConfiguration.applyToConfiguration(flinkConfig);
+		KubernetesUtils.checkJarFileForApplicationMode(flinkConfig);

Review comment:
       Why do we do this here if we ignore the result? Is it for a sanity check to fail early? Either way we call it also later.

##########
File path: flink-dist/src/main/flink-bin/conf/log4j-cli.properties
##########
@@ -38,6 +38,9 @@ logger.yarncli.appenderRef.console.ref = ConsoleAppender
 logger.hadoop.name = org.apache.hadoop
 logger.hadoop.level = INFO
 logger.hadoop.appenderRef.console.ref = ConsoleAppender
+logger.kubernetes.name = org.apache.flink.kubernetes

Review comment:
       Probably add a comment:
   ```
   # Log output from org.apache.flink.kubernetes to the console.
   ```
   as it is done above for Yarn.

##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
##########
@@ -222,6 +223,25 @@
 		Never
 	}
 
+	/**
+	 * The deployment target names for Kubernetes.

Review comment:
       I would move this to a separate class like the `KubernetesDeploymentTarget` with some additional functionality. I think having all the options somewhere can help later if we want to generate help messages. The class could look like the `YarnDeploymentTarget` and also make the related chagnes in the:
   
   * `KubernetesSessionClusterExecutor`
   * `KubernetesClusterClientFactory`
   * `KubernetesClusterDescriptor` 




----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   I will have a look the failed e2e tests on azure. It seems timed out waiting for the deployment ready.
   
   `ClassPathPackagedProgramRetriever` is trying to build the `PackagedProgram` from a class on the class path. However, it is a little different for the K8s application mode. The user could put the jar in an arbitrary directory and then use `flink run-application` to submit the Flink job. I will try to update the `ClassPathPackagedProgramRetriever` to also support specifying a user jar file.


----------------------------------------------------------------
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] zhengcanbin commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625639474


   > @zhengcanbin Thanks for chiming in and give your suggestion. When the application finished, the K8s resources will be destroyed automatically via `KubernetesResourceManager#internalDeregisterApplication`. It is the same behavior with Yarn deployment.
   
   There's a chance that the K8s resources couldn't be cleaned up except that the replica of the Deployment scales down to 0. This is due to the fabric8 SDK implementation on how to delete a Deployment. It split the procedure into three steps as follows:
   1.  Scales down the replica to 0
   2. Wait until the scaling down succeed
   3. Delete the ReplicaSet
   After step2, the JobManager process may already exit, and step3 could never be executed anymore thus leaving all the K8s resources not cleaned up.


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   The e2e tests failed yesterday because of resource cleap up, i have fixed it in this PR. However, they failed today because the azure jdk version has upgraded from 8u242 to 8u252. Whatever, i will try to fix it asap.
   
   @flinkbot run azure


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2cc10767854d49f63c6677e7f9217f2c89b8b306 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672) 
   * 57b669055ef7388e1a70ed54263e9fca1b2f9fc8 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] wangyang0918 commented on a change in pull request #12003: [FLINK-10934] Support application mode for kubernetes

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



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/utils/KubernetesUtils.java
##########
@@ -179,6 +187,22 @@ public static String getCommonStartCommand(
 		return BootstrapTools.getStartCommand(commandTemplate, startCommandValues);
 	}
 
+	public static File checkJarFileForApplicationMode(Configuration configuration) {

Review comment:
       Nice suggestion.




----------------------------------------------------------------
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] zhengcanbin edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
zhengcanbin edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625639474


   > @zhengcanbin Thanks for chiming in and give your suggestion. When the application finished, the K8s resources will be destroyed automatically via `KubernetesResourceManager#internalDeregisterApplication`. It is the same behavior with Yarn deployment.
   
   There's a chance that the K8s resources couldn't be cleaned up except that the replica of the Deployment scales down to 0. This may be due to the fabric8 SDK implementation on how to delete a Deployment. It split the procedure into three steps as follows:
   1.  Scales down the replica to 0
   2. Wait until the scaling down succeed
   3. Delete the ReplicaSet
   
   After step2, the JobManager process may already exit, and step3 could never be executed anymore thus leaving all the K8s resources not cleaned up.


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   cc @kl0u could you help to review the Kubernetes application mode at your convenience?


----------------------------------------------------------------
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] wangyang0918 commented on a change in pull request #12003: [FLINK-10934] Support application mode for kubernetes

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



##########
File path: flink-clients/src/main/java/org/apache/flink/client/deployment/application/ClassPathPackagedProgramRetriever.java
##########
@@ -75,16 +75,21 @@
 	@Nullable
 	private final File userLibDirectory;
 
+	@Nullable
+	private final File jarFile;
+

Review comment:
       Make sense. I will fix it.




----------------------------------------------------------------
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] wangyang0918 commented on a change in pull request #12003: [FLINK-10934] Support application mode for kubernetes

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



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
##########
@@ -222,6 +223,25 @@
 		Never
 	}
 
+	/**
+	 * The deployment target names for Kubernetes.

Review comment:
       I will integrate your commits to keep consistent with Yarn.




----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 068f558f4deeb9ddbb4cb0ea8013bbe099e912cd Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658) 
   * e4018f5fcffebdab1398266c65de191385554859 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4488730c9004250063a6d26ae980ad8816a62999",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797",
       "triggerID" : "4488730c9004250063a6d26ae980ad8816a62999",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7dc5c774f8cf7c35ac3c63b0193f82510f88b45e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=996",
       "triggerID" : "7dc5c774f8cf7c35ac3c63b0193f82510f88b45e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4488730c9004250063a6d26ae980ad8816a62999 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797) 
   * 7dc5c774f8cf7c35ac3c63b0193f82510f88b45e Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=996) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4488730c9004250063a6d26ae980ad8816a62999",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797",
       "triggerID" : "4488730c9004250063a6d26ae980ad8816a62999",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 42d28bc43d900c8f13a6cdee75146739cebd3260 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792) 
   * 4488730c9004250063a6d26ae980ad8816a62999 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=797) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] kl0u commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
kl0u commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624661576


   Ok the e2e test passed locally. It was a problem on my set-up. But it failed on Azure, so it worth investigating.


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @zhengcanbin Thanks for chiming in and give your suggestion. When the application finished, the K8s resources will be destroyed automatically via `KubernetesResourceManager#internalDeregisterApplication`. It is the same behavior with Yarn deployment.


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57b669055ef7388e1a70ed54263e9fca1b2f9fc8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713) 
   * 42d28bc43d900c8f13a6cdee75146739cebd3260 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] wangyang0918 commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

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


   @zhengcanbin Sounds great. Let's move the discussion there.


----------------------------------------------------------------
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] zhengcanbin commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625650308


   > @zhengcanbin I also find this issue when i test the K8s application mode. After adding small `sleep`(or any other command) via `kubernetes.container-start-command-template`. It could work. I think it because the `PID` 1 is not the java process and will not respond to the `SIGTERM`.
   > 
   > We need to create a new follow-up ticket for this issue and find a proper solution.
   
   We already met this problem in production and I filed a ticket [FLINK-17566](https://issues.apache.org/jira/browse/FLINK-17566) to track this issue.


----------------------------------------------------------------
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] wangyang0918 commented on a change in pull request #12003: [FLINK-10934] Support application mode for kubernetes

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



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/utils/KubernetesUtils.java
##########
@@ -179,6 +187,22 @@ public static String getCommonStartCommand(
 		return BootstrapTools.getStartCommand(commandTemplate, startCommandValues);
 	}
 
+	public static File checkJarFileForApplicationMode(Configuration configuration) {

Review comment:
       Nice suggestion. I will create a new class `ApplicationUtils` and move `resolveURI` and `checkLocalJarFilesForApplicationMode` in since they could be used by other deployment(e.g. Yarn application).




----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57b669055ef7388e1a70ed54263e9fca1b2f9fc8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713) 
   * 42d28bc43d900c8f13a6cdee75146739cebd3260 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] zhengcanbin edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
zhengcanbin edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625639474


   > @zhengcanbin Thanks for chiming in and give your suggestion. When the application finished, the K8s resources will be destroyed automatically via `KubernetesResourceManager#internalDeregisterApplication`. It is the same behavior with Yarn deployment.
   
   There's a chance that the K8s resources couldn't be cleaned up except that the replica of the Deployment scales down to 0. This is due to the fabric8 SDK implementation on how to delete a Deployment. It split the procedure into three steps as follows:
   1.  Scales down the replica to 0
   2. Wait until the scaling down succeed
   3. Delete the ReplicaSet
   
   After step2, the JobManager process may already exit, and step3 could never be executed anymore thus leaving all the K8s resources not cleaned up.


----------------------------------------------------------------
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] kl0u commented on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
kl0u commented on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-625141582


   ok, JIRA seems to be down so I cannot see the issue @wangyang0918 but I think that the other Kubernetes tests were passing, right?


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2cc10767854d49f63c6677e7f9217f2c89b8b306 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672) 
   * 57b669055ef7388e1a70ed54263e9fca1b2f9fc8 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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] flinkbot edited a comment on pull request #12003: [FLINK-10934] Support application mode for kubernetes

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12003:
URL: https://github.com/apache/flink/pull/12003#issuecomment-624416714


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=658",
       "triggerID" : "068f558f4deeb9ddbb4cb0ea8013bbe099e912cd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e4018f5fcffebdab1398266c65de191385554859",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=667",
       "triggerID" : "e4018f5fcffebdab1398266c65de191385554859",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=672",
       "triggerID" : "2cc10767854d49f63c6677e7f9217f2c89b8b306",
       "triggerType" : "PUSH"
     }, {
       "hash" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713",
       "triggerID" : "57b669055ef7388e1a70ed54263e9fca1b2f9fc8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792",
       "triggerID" : "42d28bc43d900c8f13a6cdee75146739cebd3260",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4488730c9004250063a6d26ae980ad8816a62999",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4488730c9004250063a6d26ae980ad8816a62999",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 57b669055ef7388e1a70ed54263e9fca1b2f9fc8 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=713) 
   * 42d28bc43d900c8f13a6cdee75146739cebd3260 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=792) 
   * 4488730c9004250063a6d26ae980ad8816a62999 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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