Skip to content

Commit

Permalink
[FLINK-26356] Directly use service name to make up rest endpoint
Browse files Browse the repository at this point in the history
This closes apache#25.
  • Loading branch information
Aitozi authored and wangyang0918 committed Feb 28, 2022
1 parent 684b459 commit a5ecd44
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.flink.configuration.RestOptions;
import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
import org.apache.flink.kubernetes.kubeclient.Fabric8FlinkKubeClient;
import org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator;
import org.apache.flink.kubernetes.operator.crd.FlinkDeployment;
import org.apache.flink.kubernetes.operator.crd.spec.JobSpec;
import org.apache.flink.kubernetes.operator.crd.spec.UpgradeMode;
Expand Down Expand Up @@ -131,8 +132,7 @@ protected ClusterClient<String> getClusterClient(Configuration config) throws Ex
final String namespace = config.get(KubernetesConfigOptions.NAMESPACE);
final int port = config.getInteger(RestOptions.PORT);
final String host =
config.getString(
RestOptions.ADDRESS, String.format("%s-rest.%s", clusterId, namespace));
ExternalServiceDecorator.getNamespacedExternalServiceName(clusterId, namespace);
final String restServerAddress = String.format("http://%s:%s", host, port);
LOG.debug("Creating RestClusterClient({})", restServerAddress);
return new RestClusterClient<>(
Expand Down

0 comments on commit a5ecd44

Please sign in to comment.