Search in sources :

Example 1 with ServiceStatusBuilder

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);
}
Also used : ServicePort(io.fabric8.kubernetes.api.model.ServicePort) ServiceStatusBuilder(io.fabric8.kubernetes.api.model.ServiceStatusBuilder) LoadBalancerIngress(io.fabric8.kubernetes.api.model.LoadBalancerIngress) ServicePortBuilder(io.fabric8.kubernetes.api.model.ServicePortBuilder) ServiceStatus(io.fabric8.kubernetes.api.model.ServiceStatus) LoadBalancerStatus(io.fabric8.kubernetes.api.model.LoadBalancerStatus)

Example 2 with ServiceStatusBuilder

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);
}
Also used : ServicePort(io.fabric8.kubernetes.api.model.ServicePort) ServiceStatusBuilder(io.fabric8.kubernetes.api.model.ServiceStatusBuilder) ServicePortBuilder(io.fabric8.kubernetes.api.model.ServicePortBuilder) ServiceStatus(io.fabric8.kubernetes.api.model.ServiceStatus) LoadBalancerStatus(io.fabric8.kubernetes.api.model.LoadBalancerStatus)

Aggregations

LoadBalancerStatus (io.fabric8.kubernetes.api.model.LoadBalancerStatus)2 ServicePort (io.fabric8.kubernetes.api.model.ServicePort)2 ServicePortBuilder (io.fabric8.kubernetes.api.model.ServicePortBuilder)2 ServiceStatus (io.fabric8.kubernetes.api.model.ServiceStatus)2 ServiceStatusBuilder (io.fabric8.kubernetes.api.model.ServiceStatusBuilder)2 LoadBalancerIngress (io.fabric8.kubernetes.api.model.LoadBalancerIngress)1