use of io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KubernetesNetworkingTestUtils method patchNetworkResource.
@Override
public void patchNetworkResource(String name, String namespace) {
Ingress i = client.network().v1().ingresses().inNamespace(namespace).withName(name).get();
IngressStatus ingressStatus = new IngressStatusBuilder().withLoadBalancer(new LoadBalancerStatusBuilder().withIngress(new LoadBalancerIngressBuilder().withHostname(name).withIp(NetworkingTestConstants.HOST_IP).build()).build()).build();
i.setStatus(ingressStatus);
client.network().v1().ingresses().inNamespace(namespace).createOrReplace(i);
}
use of io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KubernetesNetworkingTestUtils method patchNetworkResource.
@Override
public void patchNetworkResource(String name, String namespace) {
Ingress i = client.network().v1().ingresses().inNamespace(namespace).withName(name).get();
IngressStatus ingressStatus = new IngressStatusBuilder().withLoadBalancer(new LoadBalancerStatusBuilder().withIngress(new LoadBalancerIngressBuilder().withHostname(name).withIp(NetworkingTestConstants.HOST_IP).build()).build()).build();
i.setStatus(ingressStatus);
client.network().v1().ingresses().inNamespace(namespace).createOrReplace(i);
}
use of io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder in project che-server by eclipse-che.
the class IngressServerResolverTest method createIngress.
private Ingress createIngress(String name, String machineName, Pair<String, ServerConfig> server) {
Serializer serializer = Annotations.newSerializer();
serializer.machineName(machineName);
serializer.server(server.first, server.second);
return new IngressBuilder().withNewMetadata().withName(name).withAnnotations(serializer.annotations()).endMetadata().withNewSpec().withRules(new IngressRule(null, new HTTPIngressRuleValue(singletonList(new HTTPIngressPath(new IngressBackend(null, new IngressServiceBackend(name, new ServiceBackendPort("8080", 8080))), INGRESS_PATH_PREFIX, null))))).endSpec().withNewStatus().withLoadBalancer(new LoadBalancerStatusBuilder().addNewIngress().withIp("127.0.0.1").endIngress().build()).endStatus().build();
}
use of io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder in project devspaces-images by redhat-developer.
the class IngressServerResolverTest method createIngress.
private Ingress createIngress(String name, String machineName, Pair<String, ServerConfig> server) {
Serializer serializer = Annotations.newSerializer();
serializer.machineName(machineName);
serializer.server(server.first, server.second);
return new IngressBuilder().withNewMetadata().withName(name).withAnnotations(serializer.annotations()).endMetadata().withNewSpec().withRules(new IngressRule(null, new HTTPIngressRuleValue(singletonList(new HTTPIngressPath(new IngressBackend(null, new IngressServiceBackend(name, new ServiceBackendPort("8080", 8080))), INGRESS_PATH_PREFIX, null))))).endSpec().withNewStatus().withLoadBalancer(new LoadBalancerStatusBuilder().addNewIngress().withIp("127.0.0.1").endIngress().build()).endStatus().build();
}
Aggregations