use of io.fabric8.annotations.External in project fabric8 by fabric8io.
the class GetServiceURL method main.
public static void main(String... args) {
if (args.length < 1) {
System.out.println("Usage nameOfService");
return;
}
try {
String name = args[0];
KubernetesClient kube = new DefaultKubernetesClient();
String namespace = kube.getNamespace();
if (Strings.isNullOrBlank(namespace)) {
namespace = "default";
}
String url = KubernetesHelper.getServiceURL(kube, name, namespace, "http", true);
System.out.println("Service " + name + " has external URL: " + url);
} catch (Exception e) {
System.out.println("FAILED: " + e);
e.printStackTrace();
}
}
Aggregations