Search in sources :

Example 6 with IngressServiceBackendBuilder

use of io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackendBuilder 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;
}
Also used : IngressRuleBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressRuleBuilder) IngressSpec(io.fabric8.kubernetes.api.model.networking.v1.IngressSpec) IngressRule(io.fabric8.kubernetes.api.model.networking.v1.IngressRule) IngressBackendBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressBackendBuilder) HTTPIngressRuleValueBuilder(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValueBuilder) IngressSpecBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressSpecBuilder) IngressServiceBackendBuilder(io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackendBuilder) ServiceBackendPortBuilder(io.fabric8.kubernetes.api.model.networking.v1.ServiceBackendPortBuilder) Ingress(io.fabric8.kubernetes.api.model.networking.v1.Ingress) BridgeIngress(com.redhat.service.bridge.shard.operator.resources.BridgeIngress) HTTPIngressPathBuilder(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPathBuilder) HTTPIngressPath(io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPath) IngressBackend(io.fabric8.kubernetes.api.model.networking.v1.IngressBackend)

Aggregations

HTTPIngressPathBuilder (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPathBuilder)5 HTTPIngressRuleValueBuilder (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValueBuilder)5 IngressBackendBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressBackendBuilder)5 IngressRuleBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressRuleBuilder)5 IngressServiceBackendBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackendBuilder)5 ServiceBackendPortBuilder (io.fabric8.kubernetes.api.model.networking.v1.ServiceBackendPortBuilder)5 HTTPIngressPath (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPath)4 IngressBackend (io.fabric8.kubernetes.api.model.networking.v1.IngressBackend)4 IngressRule (io.fabric8.kubernetes.api.model.networking.v1.IngressRule)4 IngressSpec (io.fabric8.kubernetes.api.model.networking.v1.IngressSpec)4 IngressSpecBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressSpecBuilder)4 Ingress (io.fabric8.kubernetes.api.model.networking.v1.Ingress)3 IngressBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder)3 ObjectMetaBuilder (io.fabric8.kubernetes.api.model.ObjectMetaBuilder)2 HTTPIngressRuleValue (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressRuleValue)2 IngressServiceBackend (io.fabric8.kubernetes.api.model.networking.v1.IngressServiceBackend)2 HashMap (java.util.HashMap)2 BridgeIngress (com.redhat.service.bridge.shard.operator.resources.BridgeIngress)1 BridgeIngress (com.redhat.service.smartevents.shard.operator.resources.BridgeIngress)1 TargetState (com.tsystemsmms.cmcc.cmccoperator.targetstate.TargetState)1