You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by GitBox <gi...@apache.org> on 2022/03/11 19:03:52 UTC

[GitHub] [flink-kubernetes-operator] tweise opened a new pull request #54: Use localhost for REST API when running outside k8s

tweise opened a new pull request #54:
URL: https://github.com/apache/flink-kubernetes-operator/pull/54


   A small improvement to have a good default when running the operator outside of k8s. (I find myself switching back and forth and don't want to rely on local files.) As mentioned in the comment, this can become an operator config if we agree that this is useful.
   


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

To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org

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



[GitHub] [flink-kubernetes-operator] gyfora commented on a change in pull request #54: Use localhost for REST API when running outside k8s

Posted by GitBox <gi...@apache.org>.
gyfora commented on a change in pull request #54:
URL: https://github.com/apache/flink-kubernetes-operator/pull/54#discussion_r825442489



##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
##########
@@ -140,8 +141,13 @@ public boolean isJobManagerPortReady(Configuration config) {
         final String clusterId = config.get(KubernetesConfigOptions.CLUSTER_ID);
         final String namespace = config.get(KubernetesConfigOptions.NAMESPACE);
         final int port = config.getInteger(RestOptions.PORT);
-        final String host =
+        String host =
                 ExternalServiceDecorator.getNamespacedExternalServiceName(clusterId, namespace);
+        if (EnvUtils.get("KUBERNETES_SERVICE_HOST") == null) {
+            // not running in k8s, simplify local development
+            // TODO: make this an operator config and pass that config through

Review comment:
       If we are planning to make this configurable I suggest we do it straight away. Let's not leave TODOs for such minor additions.




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

To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org

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



[GitHub] [flink-kubernetes-operator] tweise commented on a change in pull request #54: Use localhost for REST API when running outside k8s

Posted by GitBox <gi...@apache.org>.
tweise commented on a change in pull request #54:
URL: https://github.com/apache/flink-kubernetes-operator/pull/54#discussion_r825519428



##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
##########
@@ -140,8 +141,13 @@ public boolean isJobManagerPortReady(Configuration config) {
         final String clusterId = config.get(KubernetesConfigOptions.CLUSTER_ID);
         final String namespace = config.get(KubernetesConfigOptions.NAMESPACE);
         final int port = config.getInteger(RestOptions.PORT);
-        final String host =
+        String host =
                 ExternalServiceDecorator.getNamespacedExternalServiceName(clusterId, namespace);
+        if (EnvUtils.get("KUBERNETES_SERVICE_HOST") == null) {
+            // not running in k8s, simplify local development
+            // TODO: make this an operator config and pass that config through

Review comment:
       Haha yes, that is actually what I'm planning to do if the change as such is acceptable. Will have to pass `DefaultConfig` for that, not just the effective config for Flink. But that is probably a change worthwhile doing anyways as we are likely to add more settings that govern the operator behavior going forward.




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

To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org

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



[GitHub] [flink-kubernetes-operator] morhidi commented on pull request #54: Use localhost for REST API when running outside k8s

Posted by GitBox <gi...@apache.org>.
morhidi commented on pull request #54:
URL: https://github.com/apache/flink-kubernetes-operator/pull/54#issuecomment-1065861759


   I ended up adding the namespaced rest service names (basic-example-rest.default) into the `/etc/hosts` file when running the operator locally. This fix doesn't harm though. LGTM


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

To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org

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



[GitHub] [flink-kubernetes-operator] tweise commented on pull request #54: Use localhost for REST API when running outside k8s

Posted by GitBox <gi...@apache.org>.
tweise commented on pull request #54:
URL: https://github.com/apache/flink-kubernetes-operator/pull/54#issuecomment-1067242705


   @gyfora PTAL


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

To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org

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



[GitHub] [flink-kubernetes-operator] gyfora merged pull request #54: Use localhost for REST API when running outside k8s

Posted by GitBox <gi...@apache.org>.
gyfora merged pull request #54:
URL: https://github.com/apache/flink-kubernetes-operator/pull/54


   


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

To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org

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