use of io.fabric8.kubernetes.api.model.networking.v1.IngressBackend in project jkube by eclipse.
the class NetworkingV1IngressGenerator method getIngressBackend.
private static IngressBackend getIngressBackend(IngressRulePathConfig ingressRulePathConfig) {
IngressBackendBuilder ingressBackendBuilder = new IngressBackendBuilder();
if (ingressRulePathConfig.getResource() != null) {
IngressRulePathResourceConfig resource = ingressRulePathConfig.getResource();
ingressBackendBuilder.withNewResource(resource.getApiGroup(), resource.getKind(), resource.getName());
}
ingressBackendBuilder.withService(getIngressServiceBackend(ingressRulePathConfig.getServiceName(), ingressRulePathConfig.getServicePort()));
return ingressBackendBuilder.build();
}
use of io.fabric8.kubernetes.api.model.networking.v1.IngressBackend in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KubernetesNetworkingService method buildIngress.
private Ingress buildIngress(BridgeIngress bridgeIngress, Service service) {
Ingress ingress = templateProvider.loadBridgeIngressKubernetesIngressTemplate(bridgeIngress);
IngressBackend ingressBackend = new IngressBackendBuilder().withService(new IngressServiceBackendBuilder().withName(service.getMetadata().getName()).withPort(new ServiceBackendPortBuilder().withNumber(service.getSpec().getPorts().get(0).getPort()).build()).build()).build();
HTTPIngressPath httpIngressPath = new HTTPIngressPathBuilder().withBackend(ingressBackend).withPath("/" + service.getMetadata().getName() + PATH_REGEX).withPathType("Prefix").build();
IngressRule ingressRule = new IngressRuleBuilder().withHttp(new HTTPIngressRuleValueBuilder().withPaths(httpIngressPath).build()).build();
IngressSpec ingressSpec = new IngressSpecBuilder().withRules(ingressRule).build();
ingress.setSpec(ingressSpec);
return ingress;
}
Aggregations