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());
}
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);
}
Aggregations