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/01/29 07:29:20 UTC

[GitHub] [flink] zhengcanbin opened a new pull request #10956: [FLINK-15646][client]Configurable K8s context support.

zhengcanbin opened a new pull request #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956
 
 
   ## What is the purpose of the change
   
   One would be forced to firstly use kubectl config use-context <context> to switch to the desired context if working with multiple K8S clusters or having multiple K8S "users" for interacting with the specified cluster,  so it is an important improvement to add an option(kubernetes.context) for configuring arbitrary contexts when deploying a Flink cluster. If that option is not specified, then the current context in the config file would be used.
   
   ## 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, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (**yes** / no)
     - If yes, how is the feature documented? (not applicable / **docs** / JavaDocs / not documented)
   

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


With regards,
Apache Git Services

[GitHub] [flink] TisonKun commented on a change in pull request #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
TisonKun commented on a change in pull request #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#discussion_r377378601
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
 ##########
 @@ -29,6 +29,14 @@
 @PublicEvolving
 public class KubernetesConfigOptions {
 
+	public static final ConfigOption<String> CONTEXT =
+		key("kubernetes.context")
+		.stringType()
+		.noDefaultValue()
+		.withDescription("The desired context from your K8s config file used to configure the K8s client for " +
 
 Review comment:
   and here s/K8s/Kubernetes/

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


With regards,
Apache Git Services

[GitHub] [flink] TisonKun closed pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
TisonKun closed pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956
 
 
   

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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/146544363 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/146544363) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/146544363 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/146544363) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] wangyang0918 commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-581769583
 
 
   @zhengcanbin The changes looks really good to me. I just have some minor comments.
   1. The module in the commit title should be `k8s` or `kubernetes`. Maybe "[FLINK-15646][k8s] Make kubernetes context configurable" is better.
   2. Even the abbreviation `k8s` is reasonable in the commit title to leave more characters for other useful information. I suggest to avoid in the code, documentation. This is not forced, and you could leave it as you want.
   
   @TisonKun could you take another look and help to merge?

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


With regards,
Apache Git Services

[GitHub] [flink] TisonKun commented on a change in pull request #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
TisonKun commented on a change in pull request #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#discussion_r377378491
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/KubeClientFactory.java
 ##########
 @@ -42,18 +42,23 @@ public static FlinkKubeClient fromConfiguration(Configuration flinkConfig) {
 
 		final Config config;
 
+		final String kubeContext = flinkConfig.getString(KubernetesConfigOptions.CONTEXT);
+		if (kubeContext != null) {
+			LOG.info("Configuring K8S client using context {}.", kubeContext);
 
 Review comment:
   I agree to use "Kubernetes" in logging & document as @wangyang0918 suggested.

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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/146544363 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/148388315 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/146544363) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645) 
   * 6d0b595b0de03139adec41e44240add277c21379 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/148388315) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062) 
   * 9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 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


With regards,
Apache Git Services

[GitHub] [flink] zhengcanbin commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-580066018
 
 
   cc @wangyang0918 @TisonKun 

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


With regards,
Apache Git Services

[GitHub] [flink] zhengcanbin commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-582210778
 
 
   > @zhengcanbin The changes looks really good to me. I just have some minor comments.
   > 
   >     1. The module in the commit title should be `k8s` or `kubernetes`. Maybe "[FLINK-15646][k8s] Make kubernetes context configurable" is better.
   > 
   >     2. Even the abbreviation `k8s` is reasonable in the commit title to leave more characters for other useful information. I suggest to avoid in the code, documentation. This is not forced, and you could leave it as you want.
   > 
   k8s is more shorthand and used commonly in an informal context, sounds reasonable for the commit 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


With regards,
Apache Git Services

[GitHub] [flink] zhengcanbin commented on a change in pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on a change in pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#discussion_r377669971
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
 ##########
 @@ -29,6 +29,14 @@
 @PublicEvolving
 public class KubernetesConfigOptions {
 
+	public static final ConfigOption<String> CONTEXT =
+		key("kubernetes.context")
+		.stringType()
+		.noDefaultValue()
+		.withDescription("The desired context from your K8s config file used to configure the K8s client for " +
 
 Review comment:
   Done

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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579631002
 
 
   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 b8552e9bdb85a747491fec61f7f74284bd4ebf53 (Wed Jan 29 07:31:11 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-15646).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] zhengcanbin commented on a change in pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on a change in pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#discussion_r377670198
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/KubeClientFactory.java
 ##########
 @@ -42,18 +42,23 @@ public static FlinkKubeClient fromConfiguration(Configuration flinkConfig) {
 
 		final Config config;
 
+		final String kubeContext = flinkConfig.getString(KubernetesConfigOptions.CONTEXT);
+		if (kubeContext != null) {
+			LOG.info("Configuring K8S client using context {}.", kubeContext);
+		}
+
 		final String kubeConfigFile = flinkConfig.getString(KubernetesConfigOptions.KUBE_CONFIG_FILE);
 		if (kubeConfigFile != null) {
 			LOG.debug("Trying to load kubernetes config from file: {}.", kubeConfigFile);
 			try {
-				config = Config.fromKubeconfig(KubernetesUtils.getContentFromFile(kubeConfigFile));
+				config = Config.fromKubeconfig(kubeContext, KubernetesUtils.getContentFromFile(kubeConfigFile), null);
 			} catch (IOException e) {
 				throw new KubernetesClientException("Load kubernetes config failed.", e);
 			}
 		} else {
 			LOG.debug("Trying to load default kubernetes config.");
 			// Null means load from default context
 
 Review comment:
   Done

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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/146544363 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:CANCELED URL:https://travis-ci.com/flink-ci/flink/builds/148388315 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/148395447 TriggerType:PUSH TriggerID:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702
   Hash:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5065 TriggerType:PUSH TriggerID:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/146544363) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645) 
   * 6d0b595b0de03139adec41e44240add277c21379 Travis: [CANCELED](https://travis-ci.com/flink-ci/flink/builds/148388315) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062) 
   * 9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/148395447) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5065) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] zhengcanbin commented on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-584665639
 
 
   > Thanks for your contribution @zhengcanbin . I left some comments.
   > 
   > Beside, Azure fails on a known issue https://issues.apache.org/jira/browse/FLINK-15811. I'd suggest you rebase on nightly master and retest.
   
   Thanks, @TisonKun ! Another commit was pushed to fix 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


With regards,
Apache Git Services

[GitHub] [flink] TisonKun commented on a change in pull request #10956: [FLINK-15646][client]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
TisonKun commented on a change in pull request #10956: [FLINK-15646][client]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#discussion_r377378089
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/KubeClientFactory.java
 ##########
 @@ -42,18 +42,23 @@ public static FlinkKubeClient fromConfiguration(Configuration flinkConfig) {
 
 		final Config config;
 
+		final String kubeContext = flinkConfig.getString(KubernetesConfigOptions.CONTEXT);
+		if (kubeContext != null) {
+			LOG.info("Configuring K8S client using context {}.", kubeContext);
+		}
+
 		final String kubeConfigFile = flinkConfig.getString(KubernetesConfigOptions.KUBE_CONFIG_FILE);
 		if (kubeConfigFile != null) {
 			LOG.debug("Trying to load kubernetes config from file: {}.", kubeConfigFile);
 			try {
-				config = Config.fromKubeconfig(KubernetesUtils.getContentFromFile(kubeConfigFile));
+				config = Config.fromKubeconfig(kubeContext, KubernetesUtils.getContentFromFile(kubeConfigFile), null);
 			} catch (IOException e) {
 				throw new KubernetesClientException("Load kubernetes config failed.", e);
 			}
 		} else {
 			LOG.debug("Trying to load default kubernetes config.");
 			// Null means load from default context
 
 Review comment:
   We should update the comment here.

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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/146544363 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:CANCELED URL:https://travis-ci.com/flink-ci/flink/builds/148388315 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/148395447 TriggerType:PUSH TriggerID:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702
   Hash:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Status:SUCCESS URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5065 TriggerType:PUSH TriggerID:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/146544363) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645) 
   * 6d0b595b0de03139adec41e44240add277c21379 Travis: [CANCELED](https://travis-ci.com/flink-ci/flink/builds/148388315) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062) 
   * 9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/148395447) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5065) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/146544363 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/146544363) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645) 
   * 6d0b595b0de03139adec41e44240add277c21379 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


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#issuecomment-579636254
 
 
   <!--
   Meta data
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:SUCCESS URL:https://travis-ci.com/flink-ci/flink/builds/146544363 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:b8552e9bdb85a747491fec61f7f74284bd4ebf53 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645 TriggerType:PUSH TriggerID:b8552e9bdb85a747491fec61f7f74284bd4ebf53
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:CANCELED URL:https://travis-ci.com/flink-ci/flink/builds/148388315 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:6d0b595b0de03139adec41e44240add277c21379 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062 TriggerType:PUSH TriggerID:6d0b595b0de03139adec41e44240add277c21379
   Hash:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Status:PENDING URL:https://travis-ci.com/flink-ci/flink/builds/148395447 TriggerType:PUSH TriggerID:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702
   Hash:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Status:PENDING URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5065 TriggerType:PUSH TriggerID:9e9f56a3c12ad6f8878ff2d8b52b853d718f6702
   -->
   ## CI report:
   
   * b8552e9bdb85a747491fec61f7f74284bd4ebf53 Travis: [SUCCESS](https://travis-ci.com/flink-ci/flink/builds/146544363) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4645) 
   * 6d0b595b0de03139adec41e44240add277c21379 Travis: [CANCELED](https://travis-ci.com/flink-ci/flink/builds/148388315) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5062) 
   * 9e9f56a3c12ad6f8878ff2d8b52b853d718f6702 Travis: [PENDING](https://travis-ci.com/flink-ci/flink/builds/148395447) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=5065) 
   
   <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


With regards,
Apache Git Services

[GitHub] [flink] zhengcanbin commented on a change in pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.

Posted by GitBox <gi...@apache.org>.
zhengcanbin commented on a change in pull request #10956: [FLINK-15646][K8s]Configurable K8s context support.
URL: https://github.com/apache/flink/pull/10956#discussion_r377670093
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/KubeClientFactory.java
 ##########
 @@ -42,18 +42,23 @@ public static FlinkKubeClient fromConfiguration(Configuration flinkConfig) {
 
 		final Config config;
 
+		final String kubeContext = flinkConfig.getString(KubernetesConfigOptions.CONTEXT);
+		if (kubeContext != null) {
+			LOG.info("Configuring K8S client using context {}.", kubeContext);
 
 Review comment:
   Done

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


With regards,
Apache Git Services