wangyang0918 commented on a change in pull request #14692:
URL: https://github.com/apache/flink/pull/14692#discussion_r561516683



##########
File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java
##########
@@ -112,18 +112,27 @@ public String getClusterDescription() {
                 return new RestClusterClient<>(
                         configuration,
                         clusterId,
-                        new StandaloneClientHAServices(
-                                
HighAvailabilityServicesUtils.getWebMonitorAddress(
-                                        configuration,
-                                        
HighAvailabilityServicesUtils.AddressResolution
-                                                .TRY_ADDRESS_RESOLUTION)));
+                        new 
StandaloneClientHAServices(getWebMonitorAddress(configuration)));
             } catch (Exception e) {
                 throw new RuntimeException(
                         new ClusterRetrieveException("Could not create the 
RestClusterClient.", e));
             }
         };
     }
 
+    private String getWebMonitorAddress(Configuration configuration) throws 
Exception {
+        HighAvailabilityServicesUtils.AddressResolution resolution =
+                
HighAvailabilityServicesUtils.AddressResolution.TRY_ADDRESS_RESOLUTION;
+        if 
(configuration.get(KubernetesConfigOptions.REST_SERVICE_EXPOSED_TYPE)
+                == KubernetesConfigOptions.ServiceExposedType.ClusterIP) {
+            resolution = 
HighAvailabilityServicesUtils.AddressResolution.NO_ADDRESS_RESOLUTION;
+            LOG.warn(
+                    "Please note that Flink client operation(e.g. cancel, 
list, stop,"
+                            + " savepoint, etc.) won't work from outside the 
Kubernetes cluster.");

Review comment:
       This log only shows up when the having chosen `ClusterIP`. So I do not 
add this information here.
   
   But I also think it is harmless to show more information.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to