Search in sources :

Example 11 with GenericKafkaListenerConfigurationBrokerBuilder

use of io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaClusterTest method testExternalIngressClass.

@ParallelTest
public void testExternalIngressClass() {
    GenericKafkaListenerConfigurationBroker broker0 = new GenericKafkaListenerConfigurationBrokerBuilder().withHost("my-broker-kafka-0.com").withBroker(0).build();
    GenericKafkaListenerConfigurationBroker broker1 = new GenericKafkaListenerConfigurationBrokerBuilder().withHost("my-broker-kafka-1.com").withBroker(1).build();
    GenericKafkaListenerConfigurationBroker broker2 = new GenericKafkaListenerConfigurationBrokerBuilder().withHost("my-broker-kafka-2.com").withBroker(2).build();
    Kafka kafkaAssembly = new KafkaBuilder(ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout, jmxMetricsConfig, configuration, emptyMap())).editSpec().editKafka().withListeners(new GenericKafkaListenerBuilder().withName("external").withPort(9094).withType(KafkaListenerType.INGRESS).withTls(true).withNewConfiguration().withIngressClass("nginx-internal").withNewBootstrap().withHost("my-kafka-bootstrap.com").withAnnotations(Collections.singletonMap("dns-annotation", "my-kafka-bootstrap.com")).endBootstrap().withBrokers(broker0, broker1, broker2).endConfiguration().build()).endKafka().endSpec().build();
    KafkaCluster kc = KafkaCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    // Check bootstrap ingress
    Ingress bing = kc.generateExternalBootstrapIngresses().get(0);
    assertThat(bing.getSpec().getIngressClassName(), is("nginx-internal"));
    io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress bingV1Beta1 = kc.generateExternalBootstrapIngressesV1Beta1().get(0);
    assertThat(bingV1Beta1.getSpec().getIngressClassName(), is("nginx-internal"));
    // Check per pod ingress
    for (int i = 0; i < replicas; i++) {
        Ingress ing = kc.generateExternalIngresses(i).get(0);
        assertThat(ing.getSpec().getIngressClassName(), is("nginx-internal"));
        io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress ingV1Beta1 = kc.generateExternalIngressesV1Beta1(i).get(0);
        assertThat(ingV1Beta1.getSpec().getIngressClassName(), is("nginx-internal"));
    }
}
Also used : GenericKafkaListenerConfigurationBrokerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) GenericKafkaListenerConfigurationBroker(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBroker) Ingress(io.fabric8.kubernetes.api.model.networking.v1.Ingress) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) TopologySpreadConstraint(io.fabric8.kubernetes.api.model.TopologySpreadConstraint) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 12 with GenericKafkaListenerConfigurationBrokerBuilder

use of io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaClusterTest method testExternalIngress.

@ParallelTest
public void testExternalIngress() {
    GenericKafkaListenerConfigurationBroker broker0 = new GenericKafkaListenerConfigurationBrokerBuilder().withHost("my-broker-kafka-0.com").withLabels(Collections.singletonMap("label", "label-value")).withAnnotations(Collections.singletonMap("dns-annotation", "my-kafka-broker.com")).withBroker(0).build();
    GenericKafkaListenerConfigurationBroker broker1 = new GenericKafkaListenerConfigurationBrokerBuilder().withHost("my-broker-kafka-1.com").withLabels(Collections.singletonMap("label", "label-value")).withAnnotations(Collections.singletonMap("dns-annotation", "my-kafka-broker.com")).withBroker(1).build();
    GenericKafkaListenerConfigurationBroker broker2 = new GenericKafkaListenerConfigurationBrokerBuilder().withHost("my-broker-kafka-2.com").withLabels(Collections.singletonMap("label", "label-value")).withAnnotations(Collections.singletonMap("dns-annotation", "my-kafka-broker.com")).withBroker(2).build();
    Kafka kafkaAssembly = new KafkaBuilder(ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout, jmxMetricsConfig, configuration, emptyMap())).editSpec().editKafka().withListeners(new GenericKafkaListenerBuilder().withName("external").withPort(9094).withType(KafkaListenerType.INGRESS).withTls(true).withNewConfiguration().withNewBootstrap().withHost("my-kafka-bootstrap.com").withAnnotations(Collections.singletonMap("dns-annotation", "my-kafka-bootstrap.com")).withLabels(Collections.singletonMap("label", "label-value")).endBootstrap().withBrokers(broker0, broker1, broker2).endConfiguration().build()).endKafka().endSpec().build();
    KafkaCluster kc = KafkaCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    assertThat(kc.isExposedWithIngress(), is(true));
    // Check StatefulSet changes
    StatefulSet sts = kc.generateStatefulSet(true, null, null, null);
    List<ContainerPort> ports = sts.getSpec().getTemplate().getSpec().getContainers().get(0).getPorts();
    assertThat(ports.contains(kc.createContainerPort(ListenersUtils.BACKWARDS_COMPATIBLE_EXTERNAL_PORT_NAME, 9094, "TCP")), is(true));
    // Check external bootstrap service
    Service ext = kc.generateExternalBootstrapServices().get(0);
    assertThat(ext.getMetadata().getName(), is(KafkaCluster.externalBootstrapServiceName(cluster)));
    assertThat(ext.getSpec().getType(), is("ClusterIP"));
    assertThat(ext.getSpec().getSelector(), is(kc.getSelectorLabels().toMap()));
    assertThat(ext.getSpec().getPorts(), is(Collections.singletonList(kc.createServicePort(ListenersUtils.BACKWARDS_COMPATIBLE_EXTERNAL_PORT_NAME, 9094, 9094, "TCP"))));
    checkOwnerReference(kc.createOwnerReference(), ext);
    // Check per pod services
    for (int i = 0; i < replicas; i++) {
        Service srv = kc.generateExternalServices(i).get(0);
        assertThat(srv.getMetadata().getName(), is(KafkaCluster.externalServiceName(cluster, i)));
        assertThat(srv.getSpec().getType(), is("ClusterIP"));
        assertThat(srv.getSpec().getSelector().get(Labels.KUBERNETES_STATEFULSET_POD_LABEL), is(KafkaCluster.kafkaPodName(cluster, i)));
        assertThat(srv.getSpec().getPorts(), is(Collections.singletonList(kc.createServicePort(ListenersUtils.BACKWARDS_COMPATIBLE_EXTERNAL_PORT_NAME, 9094, 9094, "TCP"))));
        checkOwnerReference(kc.createOwnerReference(), srv);
    }
    // Check bootstrap ingress
    Ingress bing = kc.generateExternalBootstrapIngresses().get(0);
    assertThat(bing.getMetadata().getName(), is(KafkaCluster.serviceName(cluster)));
    assertThat(bing.getSpec().getIngressClassName(), is(nullValue()));
    assertThat(bing.getMetadata().getAnnotations().get("dns-annotation"), is("my-kafka-bootstrap.com"));
    assertThat(bing.getMetadata().getLabels().get("label"), is("label-value"));
    assertThat(bing.getSpec().getTls().size(), is(1));
    assertThat(bing.getSpec().getTls().get(0).getHosts().size(), is(1));
    assertThat(bing.getSpec().getTls().get(0).getHosts().get(0), is("my-kafka-bootstrap.com"));
    assertThat(bing.getSpec().getRules().size(), is(1));
    assertThat(bing.getSpec().getRules().get(0).getHost(), is("my-kafka-bootstrap.com"));
    assertThat(bing.getSpec().getRules().get(0).getHttp().getPaths().size(), is(1));
    assertThat(bing.getSpec().getRules().get(0).getHttp().getPaths().get(0).getPath(), is("/"));
    assertThat(bing.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getService().getName(), is(KafkaCluster.externalBootstrapServiceName(cluster)));
    assertThat(bing.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getService().getPort().getNumber(), is(9094));
    checkOwnerReference(kc.createOwnerReference(), bing);
    io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress bingV1Beta1 = kc.generateExternalBootstrapIngressesV1Beta1().get(0);
    assertThat(bingV1Beta1.getMetadata().getName(), is(KafkaCluster.serviceName(cluster)));
    assertThat(bingV1Beta1.getSpec().getIngressClassName(), is(nullValue()));
    assertThat(bingV1Beta1.getMetadata().getAnnotations().get("dns-annotation"), is("my-kafka-bootstrap.com"));
    assertThat(bingV1Beta1.getMetadata().getLabels().get("label"), is("label-value"));
    assertThat(bingV1Beta1.getSpec().getTls().size(), is(1));
    assertThat(bingV1Beta1.getSpec().getTls().get(0).getHosts().size(), is(1));
    assertThat(bingV1Beta1.getSpec().getTls().get(0).getHosts().get(0), is("my-kafka-bootstrap.com"));
    assertThat(bingV1Beta1.getSpec().getRules().size(), is(1));
    assertThat(bingV1Beta1.getSpec().getRules().get(0).getHost(), is("my-kafka-bootstrap.com"));
    assertThat(bingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().size(), is(1));
    assertThat(bingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().get(0).getPath(), is("/"));
    assertThat(bingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getServiceName(), is(KafkaCluster.externalBootstrapServiceName(cluster)));
    assertThat(bingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getServicePort(), is(new IntOrString(9094)));
    checkOwnerReference(kc.createOwnerReference(), bingV1Beta1);
    // Check per pod ingress
    for (int i = 0; i < replicas; i++) {
        Ingress ing = kc.generateExternalIngresses(i).get(0);
        assertThat(ing.getMetadata().getName(), is(KafkaCluster.externalServiceName(cluster, i)));
        assertThat(ing.getSpec().getIngressClassName(), is(nullValue()));
        assertThat(ing.getMetadata().getAnnotations().get("dns-annotation"), is("my-kafka-broker.com"));
        assertThat(ing.getMetadata().getLabels().get("label"), is("label-value"));
        assertThat(ing.getSpec().getTls().size(), is(1));
        assertThat(ing.getSpec().getTls().get(0).getHosts().size(), is(1));
        assertThat(ing.getSpec().getTls().get(0).getHosts().get(0), is(String.format("my-broker-kafka-%d.com", i)));
        assertThat(ing.getSpec().getRules().size(), is(1));
        assertThat(ing.getSpec().getRules().get(0).getHost(), is(String.format("my-broker-kafka-%d.com", i)));
        assertThat(ing.getSpec().getRules().get(0).getHttp().getPaths().size(), is(1));
        assertThat(ing.getSpec().getRules().get(0).getHttp().getPaths().get(0).getPath(), is("/"));
        assertThat(ing.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getService().getName(), is(KafkaCluster.externalServiceName(cluster, i)));
        assertThat(ing.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getService().getPort().getNumber(), is(9094));
        checkOwnerReference(kc.createOwnerReference(), ing);
        io.fabric8.kubernetes.api.model.networking.v1beta1.Ingress ingV1Beta1 = kc.generateExternalIngressesV1Beta1(i).get(0);
        assertThat(ingV1Beta1.getMetadata().getName(), is(KafkaCluster.externalServiceName(cluster, i)));
        assertThat(ingV1Beta1.getSpec().getIngressClassName(), is(nullValue()));
        assertThat(ingV1Beta1.getMetadata().getAnnotations().get("dns-annotation"), is("my-kafka-broker.com"));
        assertThat(ingV1Beta1.getMetadata().getLabels().get("label"), is("label-value"));
        assertThat(ingV1Beta1.getSpec().getTls().size(), is(1));
        assertThat(ingV1Beta1.getSpec().getTls().get(0).getHosts().size(), is(1));
        assertThat(ingV1Beta1.getSpec().getTls().get(0).getHosts().get(0), is(String.format("my-broker-kafka-%d.com", i)));
        assertThat(ingV1Beta1.getSpec().getRules().size(), is(1));
        assertThat(ingV1Beta1.getSpec().getRules().get(0).getHost(), is(String.format("my-broker-kafka-%d.com", i)));
        assertThat(ingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().size(), is(1));
        assertThat(ingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().get(0).getPath(), is("/"));
        assertThat(ingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getServiceName(), is(KafkaCluster.externalServiceName(cluster, i)));
        assertThat(ingV1Beta1.getSpec().getRules().get(0).getHttp().getPaths().get(0).getBackend().getServicePort(), is(new IntOrString(9094)));
        checkOwnerReference(kc.createOwnerReference(), ingV1Beta1);
    }
}
Also used : GenericKafkaListenerConfigurationBrokerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder) IntOrString(io.fabric8.kubernetes.api.model.IntOrString) Kafka(io.strimzi.api.kafka.model.Kafka) GenericKafkaListenerConfigurationBroker(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBroker) Service(io.fabric8.kubernetes.api.model.Service) Ingress(io.fabric8.kubernetes.api.model.networking.v1.Ingress) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) TopologySpreadConstraint(io.fabric8.kubernetes.api.model.TopologySpreadConstraint) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) ContainerPort(io.fabric8.kubernetes.api.model.ContainerPort) StatefulSet(io.fabric8.kubernetes.api.model.apps.StatefulSet) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 13 with GenericKafkaListenerConfigurationBrokerBuilder

use of io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaClusterTest method testExternalLoadBalancersWithLoadBalancerIPOverride.

@ParallelTest
public void testExternalLoadBalancersWithLoadBalancerIPOverride() {
    GenericKafkaListenerConfigurationBootstrap bootstrapConfig = new GenericKafkaListenerConfigurationBootstrapBuilder().withLoadBalancerIP("10.0.0.1").build();
    GenericKafkaListenerConfigurationBroker brokerConfig0 = new GenericKafkaListenerConfigurationBrokerBuilder().withBroker(0).withLoadBalancerIP("10.0.0.2").build();
    GenericKafkaListenerConfigurationBroker brokerConfig2 = new GenericKafkaListenerConfigurationBrokerBuilder().withBroker(2).withLoadBalancerIP("10.0.0.3").build();
    Kafka kafkaAssembly = new KafkaBuilder(ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout, jmxMetricsConfig, configuration, emptyMap())).editSpec().editKafka().withListeners(new GenericKafkaListenerBuilder().withName("external").withPort(9094).withType(KafkaListenerType.LOADBALANCER).withTls(true).withNewConfiguration().withBootstrap(bootstrapConfig).withBrokers(brokerConfig0, brokerConfig2).endConfiguration().build()).endKafka().endSpec().build();
    KafkaCluster kc = KafkaCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    // Check annotations
    assertThat(kc.generateExternalBootstrapServices().get(0).getSpec().getLoadBalancerIP(), is("10.0.0.1"));
    assertThat(kc.generateExternalServices(0).get(0).getSpec().getLoadBalancerIP(), is("10.0.0.2"));
    assertThat(kc.generateExternalServices(1).get(0).getSpec().getLoadBalancerIP(), is(nullValue()));
    assertThat(kc.generateExternalServices(2).get(0).getSpec().getLoadBalancerIP(), is("10.0.0.3"));
}
Also used : GenericKafkaListenerConfigurationBootstrapBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBootstrapBuilder) GenericKafkaListenerConfigurationBootstrap(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBootstrap) GenericKafkaListenerConfigurationBrokerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) GenericKafkaListenerConfigurationBroker(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBroker) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 14 with GenericKafkaListenerConfigurationBrokerBuilder

use of io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder in project strimzi-kafka-operator by strimzi.

the class SpecificIsolatedST method testLoadBalancerIpOverride.

@IsolatedTest("Using more tha one Kafka cluster in one namespace")
@Tag(LOADBALANCER_SUPPORTED)
@Tag(EXTERNAL_CLIENTS_USED)
void testLoadBalancerIpOverride(ExtensionContext extensionContext) {
    String bootstrapOverrideIP = "10.0.0.1";
    String brokerOverrideIP = "10.0.0.2";
    String clusterName = mapWithClusterNames.get(extensionContext.getDisplayName());
    resourceManager.createResource(extensionContext, KafkaTemplates.kafkaEphemeral(clusterName, 3, 1).editSpec().editKafka().withListeners(new GenericKafkaListenerBuilder().withName(Constants.EXTERNAL_LISTENER_DEFAULT_NAME).withPort(9094).withType(KafkaListenerType.LOADBALANCER).withTls(true).withNewConfiguration().withNewBootstrap().withLoadBalancerIP(brokerOverrideIP).endBootstrap().withBrokers(new GenericKafkaListenerConfigurationBrokerBuilder().withBroker(0).withLoadBalancerIP(brokerOverrideIP).build()).withFinalizers(LB_FINALIZERS).endConfiguration().build()).endKafka().endSpec().build());
    assertThat("Kafka External bootstrap doesn't contain correct loadBalancer address", kubeClient().getService(KafkaResources.externalBootstrapServiceName(clusterName)).getSpec().getLoadBalancerIP(), is(bootstrapOverrideIP));
    assertThat("Kafka Broker-0 service doesn't contain correct loadBalancer address", kubeClient().getService(KafkaResources.brokerSpecificService(clusterName, 0)).getSpec().getLoadBalancerIP(), is(brokerOverrideIP));
    ExternalKafkaClient externalKafkaClient = new ExternalKafkaClient.Builder().withTopicName(TOPIC_NAME).withNamespaceName(INFRA_NAMESPACE).withClusterName(clusterName).withMessageCount(MESSAGE_COUNT).withListenerName(Constants.EXTERNAL_LISTENER_DEFAULT_NAME).build();
    externalKafkaClient.verifyProducedAndConsumedMessages(externalKafkaClient.sendMessagesPlain(), externalKafkaClient.receiveMessagesPlain());
}
Also used : ExternalKafkaClient(io.strimzi.systemtest.kafkaclients.externalClients.ExternalKafkaClient) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) GenericKafkaListenerConfigurationBrokerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder) GenericKafkaListenerConfigurationBrokerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) KafkaClientsBuilder(io.strimzi.systemtest.kafkaclients.internalClients.KafkaClientsBuilder) IsolatedTest(io.strimzi.systemtest.annotations.IsolatedTest) Tag(org.junit.jupiter.api.Tag)

Example 15 with GenericKafkaListenerConfigurationBrokerBuilder

use of io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder in project strimzi-kafka-operator by strimzi.

the class ListenersValidatorTest method testRouteListener.

@ParallelTest
public void testRouteListener() {
    String name = "route";
    GenericKafkaListener listener1 = new GenericKafkaListenerBuilder().withName(name).withPort(9092).withType(KafkaListenerType.ROUTE).withTls(true).withNewConfiguration().withIngressClass("my-ingress").withUseServiceDnsDomain(true).withExternalTrafficPolicy(ExternalTrafficPolicy.LOCAL).withIpFamilyPolicy(IpFamilyPolicy.REQUIRE_DUAL_STACK).withIpFamilies(IpFamily.IPV4, IpFamily.IPV6).withPreferredNodePortAddressType(NodeAddressType.INTERNAL_DNS).withLoadBalancerSourceRanges(asList("10.0.0.0/8", "130.211.204.1/32")).withFinalizers(asList("service.kubernetes.io/load-balancer-cleanup")).withNewBootstrap().withAlternativeNames(asList("my-name-1", "my-name-2")).withLoadBalancerIP("130.211.204.1").withNodePort(32189).withHost("my-host").withAnnotations(Collections.singletonMap("dns-anno", "dns-value")).withLabels(Collections.singletonMap("label", "label-value")).endBootstrap().withBrokers(new GenericKafkaListenerConfigurationBrokerBuilder().withBroker(0).withAdvertisedHost("advertised-host").withAdvertisedPort(9092).withLoadBalancerIP("130.211.204.1").withNodePort(32189).withHost("my-host").withAnnotations(Collections.singletonMap("dns-anno", "dns-value")).withLabels(Collections.singletonMap("label", "label-value")).build(), new GenericKafkaListenerConfigurationBrokerBuilder().withBroker(1).withAdvertisedHost("advertised-host").withAdvertisedPort(9092).withLoadBalancerIP("130.211.204.1").withNodePort(32189).withHost("my-host").withAnnotations(Collections.singletonMap("dns-anno", "dns-value")).withLabels(Collections.singletonMap("label", "label-value")).build()).endConfiguration().build();
    List<GenericKafkaListener> listeners = asList(listener1);
    List<String> expectedErrors = asList("listener " + name + " cannot configure ingressClass because it is not Ingress based listener", "listener " + name + " cannot configure useServiceDnsDomain because it is not internal listener", "listener " + name + " cannot configure externalTrafficPolicy because it is not LoadBalancer or NodePort based listener", "listener " + name + " cannot configure loadBalancerSourceRanges because it is not LoadBalancer based listener", "listener " + name + " cannot configure finalizers because it is not LoadBalancer based listener", "listener " + name + " cannot configure preferredAddressType because it is not NodePort based listener", "listener " + name + " cannot configure bootstrap.loadBalancerIP because it is not LoadBalancer based listener", "listener " + name + " cannot configure bootstrap.nodePort because it is not NodePort based listener", "listener " + name + " cannot configure brokers[].loadBalancerIP because it is not LoadBalancer based listener", "listener " + name + " cannot configure brokers[].nodePort because it is not NodePort based listener");
    assertThat(ListenersValidator.validateAndGetErrorMessages(3, listeners), containsInAnyOrder(expectedErrors.toArray()));
}
Also used : GenericKafkaListener(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListener) GenericKafkaListenerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder) GenericKafkaListenerConfigurationBrokerBuilder(io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder) Matchers.containsString(org.hamcrest.Matchers.containsString) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Aggregations

GenericKafkaListenerBuilder (io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerBuilder)42 GenericKafkaListenerConfigurationBrokerBuilder (io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBrokerBuilder)42 ParallelTest (io.strimzi.test.annotations.ParallelTest)30 Kafka (io.strimzi.api.kafka.model.Kafka)20 GenericKafkaListenerConfigurationBroker (io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBroker)20 KafkaBuilder (io.strimzi.api.kafka.model.KafkaBuilder)18 GenericKafkaListener (io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListener)18 Matchers.containsString (org.hamcrest.Matchers.containsString)12 Ingress (io.fabric8.kubernetes.api.model.networking.v1.Ingress)8 Labels (io.strimzi.operator.common.model.Labels)8 GenericKafkaListenerConfigurationBootstrapBuilder (io.strimzi.api.kafka.model.listener.arraylistener.GenericKafkaListenerConfigurationBootstrapBuilder)7 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)6 StrimziPodSetList (io.strimzi.api.kafka.StrimziPodSetList)6 StrimziPodSet (io.strimzi.api.kafka.model.StrimziPodSet)6 KafkaListenerType (io.strimzi.api.kafka.model.listener.arraylistener.KafkaListenerType)6 PlatformFeaturesAvailability (io.strimzi.operator.PlatformFeaturesAvailability)6 KafkaCluster (io.strimzi.operator.cluster.model.KafkaCluster)6 ResourceOperatorSupplier (io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier)6 StatefulSetOperator (io.strimzi.operator.cluster.operator.resource.StatefulSetOperator)6 Reconciliation (io.strimzi.operator.common.Reconciliation)6