use of org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer in project che-server by eclipse-che.
the class RouteServerResolverTest method createService.
private Service createService(String name, String machineName, Integer port, Map<String, ServerConfigImpl> servers) {
Serializer serializer = Annotations.newSerializer();
serializer.machineName(machineName);
if (servers != null) {
serializer.servers(servers);
}
return new ServiceBuilder().withNewMetadata().withName(name).withAnnotations(serializer.annotations()).endMetadata().withNewSpec().withPorts(new ServicePortBuilder().withPort(port).withNewTargetPort().withIntVal(port).endTargetPort().build()).endSpec().build();
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer in project che-server by eclipse-che.
the class IngressServerResolverTest method createService.
private Service createService(String name, String machineName, Integer port, Map<String, ServerConfigImpl> servers) {
Serializer serializer = Annotations.newSerializer();
serializer.machineName(machineName);
if (servers != null) {
serializer.servers(servers);
}
return new ServiceBuilder().withNewMetadata().withName(name).withAnnotations(serializer.annotations()).endMetadata().withNewSpec().withPorts(new ServicePortBuilder().withPort(port).withNewTargetPort().withIntVal(port).endTargetPort().build()).endSpec().build();
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer in project devspaces-images by redhat-developer.
the class RouteServerResolverTest method createService.
private Service createService(String name, String machineName, Integer port, Map<String, ServerConfigImpl> servers) {
Serializer serializer = Annotations.newSerializer();
serializer.machineName(machineName);
if (servers != null) {
serializer.servers(servers);
}
return new ServiceBuilder().withNewMetadata().withName(name).withAnnotations(serializer.annotations()).endMetadata().withNewSpec().withPorts(new ServicePortBuilder().withPort(port).withNewTargetPort().withIntVal(port).endTargetPort().build()).endSpec().build();
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer 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 org.eclipse.che.workspace.infrastructure.kubernetes.Annotations.Serializer in project che-server by eclipse-che.
the class RouteServerResolverTest method createRoute.
private Route createRoute(String name, String machineName, Map<String, ServerConfigImpl> servers) {
Serializer serializer = Annotations.newSerializer();
serializer.machineName(machineName);
if (servers != null) {
serializer.servers(servers);
}
return new RouteBuilder().withNewMetadata().withName(name).withAnnotations(serializer.annotations()).endMetadata().withNewSpec().withHost(ROUTE_HOST).withNewTo().withName(name).endTo().endSpec().build();
}
Aggregations