Search in sources :

Example 1 with LoadBalancerStatusBuilder

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);
}
Also used : IngressStatusBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressStatusBuilder) IngressStatus(io.fabric8.kubernetes.api.model.networking.v1.IngressStatus) Ingress(io.fabric8.kubernetes.api.model.networking.v1.Ingress) LoadBalancerIngressBuilder(io.fabric8.kubernetes.api.model.LoadBalancerIngressBuilder) LoadBalancerStatusBuilder(io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder)

Example 2 with LoadBalancerStatusBuilder

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);
}
Also used : IngressStatusBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressStatusBuilder) IngressStatus(io.fabric8.kubernetes.api.model.networking.v1.IngressStatus) Ingress(io.fabric8.kubernetes.api.model.networking.v1.Ingress) LoadBalancerIngressBuilder(io.fabric8.kubernetes.api.model.LoadBalancerIngressBuilder) LoadBalancerStatusBuilder(io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder)

Example 3 with LoadBalancerStatusBuilder

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();
}
Also used : IngressBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder) ServiceBackendPort(io.fabric8.kubernetes.api.model.networking.v1.ServiceBackendPort) IngressRule(io.fabric8.kubernetes.api.model.networking.v1.IngressRule) HTTPIngressRuleValue(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValue) HTTPIngressPath(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPath) IngressBackend(io.fabric8.kubernetes.api.model.networking.v1.IngressBackend) LoadBalancerStatusBuilder(io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder) Serializer(org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer) IngressServiceBackend(io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackend)

Example 4 with LoadBalancerStatusBuilder

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();
}
Also used : IngressBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder) ServiceBackendPort(io.fabric8.kubernetes.api.model.networking.v1.ServiceBackendPort) IngressRule(io.fabric8.kubernetes.api.model.networking.v1.IngressRule) HTTPIngressRuleValue(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValue) HTTPIngressPath(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPath) IngressBackend(io.fabric8.kubernetes.api.model.networking.v1.IngressBackend) LoadBalancerStatusBuilder(io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder) Serializer(org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer) IngressServiceBackend(io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackend)

Aggregations

LoadBalancerStatusBuilder (io.fabric8.kubernetes.api.model.LoadBalancerStatusBuilder)4 LoadBalancerIngressBuilder (io.fabric8.kubernetes.api.model.LoadBalancerIngressBuilder)2 HTTPIngressPath (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPath)2 HTTPIngressRuleValue (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValue)2 Ingress (io.fabric8.kubernetes.api.model.networking.v1.Ingress)2 IngressBackend (io.fabric8.kubernetes.api.model.networking.v1.IngressBackend)2 IngressBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder)2 IngressRule (io.fabric8.kubernetes.api.model.networking.v1.IngressRule)2 IngressServiceBackend (io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackend)2 IngressStatus (io.fabric8.kubernetes.api.model.networking.v1.IngressStatus)2 IngressStatusBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressStatusBuilder)2 ServiceBackendPort (io.fabric8.kubernetes.api.model.networking.v1.ServiceBackendPort)2 Serializer (org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer)2