use of io.fabric8.kubernetes.api.model.ServiceStatusBuilder in project flink by apache.
the class KubernetesClientTestBase method buildExternalServiceWithLoadBalancer.
protected Service buildExternalServiceWithLoadBalancer(@Nullable String hostname, @Nullable String ip) {
final ServicePort servicePort = new ServicePortBuilder().withName(Constants.REST_PORT_NAME).withPort(REST_PORT).withNewTargetPort(REST_PORT).build();
final ServiceStatus serviceStatus = new ServiceStatusBuilder().withLoadBalancer(new LoadBalancerStatus(Collections.singletonList(new LoadBalancerIngress(hostname, ip, new ArrayList<>())))).build();
return buildExternalService(KubernetesConfigOptions.ServiceExposedType.LoadBalancer, servicePort, serviceStatus, false);
}
use of io.fabric8.kubernetes.api.model.ServiceStatusBuilder in project flink by apache.
the class KubernetesClientTestBase method buildExternalServiceWithNodePort.
protected Service buildExternalServiceWithNodePort() {
final ServicePort servicePort = new ServicePortBuilder().withName(Constants.REST_PORT_NAME).withPort(REST_PORT).withNodePort(NODE_PORT).withNewTargetPort(REST_PORT).build();
final ServiceStatus serviceStatus = new ServiceStatusBuilder().withLoadBalancer(new LoadBalancerStatus(Collections.emptyList())).build();
return buildExternalService(KubernetesConfigOptions.ServiceExposedType.NodePort, servicePort, serviceStatus, false);
}
Aggregations