use of io.fabric8.knative.serving.v1.ServiceStatusBuilder in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KubernetesResourcePatcher method patchReadyService.
public void patchReadyService(String name, String namespace) {
// Retrieve the service
Service service = kubernetesClient.services().inNamespace(namespace).withName(name).get();
// Fail if it has not been deployed yet
assertThat(service).isNotNull();
// Patch the service - This is what k8s would do when the resource is deployed and is ready.
service.setStatus(new ServiceStatusBuilder().withLoadBalancer(new LoadBalancerStatus()).build());
kubernetesClient.services().inNamespace(namespace).withName(name).replace(service);
}
use of io.fabric8.knative.serving.v1.ServiceStatusBuilder in project flink-mirror by flink-ci.
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.knative.serving.v1.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.knative.serving.v1.ServiceStatusBuilder in project flink by splunk.
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);
}
use of io.fabric8.knative.serving.v1.ServiceStatusBuilder in project flink by splunk.
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);
}
Aggregations