Search in sources :

Example 66 with IngressBuilder

use of io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder in project cmcc-operator by T-Systems-MMS.

the class NginxIngressBuilder method build.

@Override
public Collection<? extends HasMetadata> build() {
    ObjectMeta metadata = targetState.getResourceMetadataFor(name);
    metadata.getAnnotations().putAll(annotations);
    List<HTTPIngressPath> httpPaths = paths.stream().map(path -> withPath(new HTTPIngressPathBuilder(), path).withBackend(new IngressBackendBuilder().withService(new IngressServiceBackendBuilder().withName(path.getService()).withPort(new ServiceBackendPort("http", null)).build()).build()).build()).collect(Collectors.toList());
    return Collections.singletonList(new io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder().withMetadata(metadata).withSpec(new IngressSpecBuilder().withIngressClassName("nginx").withTls(new IngressTLSBuilder().withHosts(hostname).build()).withRules(new IngressRuleBuilder().withHost(hostname).withHttp(new HTTPIngressRuleValueBuilder().withPaths(httpPaths).build()).build()).build()).build());
}
Also used : java.util(java.util) TargetState(com.tsystemsmms.cmcc.cmccoperator.targetstate.TargetState) ObjectMeta(io.fabric8.kubernetes.api.model.ObjectMeta) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) io.fabric8.kubernetes.api.model.networking.v1(io.fabric8.kubernetes.api.model.networking.v1) Collectors(java.util.stream.Collectors) ObjectMeta(io.fabric8.kubernetes.api.model.ObjectMeta)

Example 67 with IngressBuilder

use of io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class OpenshiftNetworkingTestUtils method patchOpenshiftIngressDomain.

private void patchOpenshiftIngressDomain() {
    Ingress openshiftIngress = new IngressBuilder().withMetadata(new ObjectMetaBuilder().withName(OpenshiftNetworkingService.CLUSTER_DOMAIN_RESOURCE_NAME).build()).withSpec(new IngressSpecBuilder().withDomain("apps.openbridge-dev.fdvn.p1.openshiftapps.com").build()).build();
    this.client.config().ingresses().withName(OpenshiftNetworkingService.CLUSTER_DOMAIN_RESOURCE_NAME).create(openshiftIngress);
}
Also used : RouteIngressBuilder(io.fabric8.openshift.api.model.RouteIngressBuilder) IngressBuilder(io.fabric8.openshift.api.model.IngressBuilder) IngressSpecBuilder(io.fabric8.openshift.api.model.IngressSpecBuilder) Ingress(io.fabric8.openshift.api.model.Ingress) RouteIngress(io.fabric8.openshift.api.model.RouteIngress) ObjectMetaBuilder(io.fabric8.kubernetes.api.model.ObjectMetaBuilder)

Aggregations

IngressBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder)39 Ingress (io.fabric8.kubernetes.api.model.networking.v1.Ingress)31 Test (org.junit.jupiter.api.Test)28 IngressBuilder (io.fabric8.kubernetes.api.model.extensions.IngressBuilder)13 ArrayList (java.util.ArrayList)13 Ingress (io.fabric8.kubernetes.api.model.extensions.Ingress)11 HTTPIngressPathBuilder (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPathBuilder)11 IngressRule (io.fabric8.kubernetes.api.model.networking.v1.IngressRule)9 IngressTLSBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressTLSBuilder)9 HTTPIngressPath (io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPath)8 GenericKafkaListener (io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListener)8 Test (org.junit.Test)8 IngressRuleBuilder (io.fabric8.kubernetes.api.model.networking.v1.IngressRuleBuilder)7 IngressBuilder (io.fabric8.kubernetes.api.model.networking.v1beta1.IngressBuilder)6 ObjectMeta (io.fabric8.kubernetes.api.model.ObjectMeta)5 ObjectMetaBuilder (io.fabric8.kubernetes.api.model.ObjectMetaBuilder)5 HTTPIngressPathBuilder (io.fabric8.kubernetes.api.model.extensions.HTTPIngressPathBuilder)5 Ingress (io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress)5 HashMap (java.util.HashMap)5 HTTPIngressPath (io.fabric8.kubernetes.api.model.extensions.HTTPIngressPath)4