Search in sources :

Example 6 with KafkaSetOperator

use of io.strimzi.controller.cluster.operator.resource.KafkaSetOperator in project strimzi by strimzi.

the class Main method run.

static CompositeFuture run(Vertx vertx, KubernetesClient client, boolean isOpenShift, Map<String, String> env) {
    ClusterControllerConfig config = ClusterControllerConfig.fromMap(env);
    ServiceOperator serviceOperations = new ServiceOperator(vertx, client);
    ZookeeperSetOperator zookeeperSetOperations = new ZookeeperSetOperator(vertx, client);
    KafkaSetOperator kafkaSetOperations = new KafkaSetOperator(vertx, client);
    ConfigMapOperator configMapOperations = new ConfigMapOperator(vertx, client);
    PvcOperator pvcOperations = new PvcOperator(vertx, client);
    DeploymentOperator deploymentOperations = new DeploymentOperator(vertx, client);
    KafkaAssemblyOperator kafkaClusterOperations = new KafkaAssemblyOperator(vertx, isOpenShift, config.getOperationTimeoutMs(), configMapOperations, serviceOperations, zookeeperSetOperations, kafkaSetOperations, pvcOperations, deploymentOperations);
    KafkaConnectAssemblyOperator kafkaConnectClusterOperations = new KafkaConnectAssemblyOperator(vertx, isOpenShift, configMapOperations, deploymentOperations, serviceOperations);
    DeploymentConfigOperator deploymentConfigOperations = null;
    ImageStreamOperator imagesStreamOperations = null;
    BuildConfigOperator buildConfigOperations = null;
    KafkaConnectS2IAssemblyOperator kafkaConnectS2IClusterOperations = null;
    if (isOpenShift) {
        imagesStreamOperations = new ImageStreamOperator(vertx, client.adapt(OpenShiftClient.class));
        buildConfigOperations = new BuildConfigOperator(vertx, client.adapt(OpenShiftClient.class));
        deploymentConfigOperations = new DeploymentConfigOperator(vertx, client.adapt(OpenShiftClient.class));
        kafkaConnectS2IClusterOperations = new KafkaConnectS2IAssemblyOperator(vertx, isOpenShift, configMapOperations, deploymentConfigOperations, serviceOperations, imagesStreamOperations, buildConfigOperations);
    }
    List<Future> futures = new ArrayList<>();
    for (String namespace : config.getNamespaces()) {
        Future<String> fut = Future.future();
        futures.add(fut);
        ClusterController controller = new ClusterController(namespace, config.getReconciliationIntervalMs(), client, kafkaClusterOperations, kafkaConnectClusterOperations, kafkaConnectS2IClusterOperations);
        vertx.deployVerticle(controller, res -> {
            if (res.succeeded()) {
                log.info("Cluster Controller verticle started in namespace {}", namespace);
            } else {
                log.error("Cluster Controller verticle in namespace {} failed to start", namespace, res.cause());
                System.exit(1);
            }
            fut.completer().handle(res);
        });
    }
    return CompositeFuture.join(futures);
}
Also used : KafkaAssemblyOperator(io.strimzi.controller.cluster.operator.assembly.KafkaAssemblyOperator) ZookeeperSetOperator(io.strimzi.controller.cluster.operator.resource.ZookeeperSetOperator) KafkaConnectS2IAssemblyOperator(io.strimzi.controller.cluster.operator.assembly.KafkaConnectS2IAssemblyOperator) ArrayList(java.util.ArrayList) PvcOperator(io.strimzi.controller.cluster.operator.resource.PvcOperator) ServiceOperator(io.strimzi.controller.cluster.operator.resource.ServiceOperator) KafkaConnectAssemblyOperator(io.strimzi.controller.cluster.operator.assembly.KafkaConnectAssemblyOperator) ImageStreamOperator(io.strimzi.controller.cluster.operator.resource.ImageStreamOperator) BuildConfigOperator(io.strimzi.controller.cluster.operator.resource.BuildConfigOperator) KafkaSetOperator(io.strimzi.controller.cluster.operator.resource.KafkaSetOperator) CompositeFuture(io.vertx.core.CompositeFuture) Future(io.vertx.core.Future) ConfigMapOperator(io.strimzi.controller.cluster.operator.resource.ConfigMapOperator) DeploymentOperator(io.strimzi.controller.cluster.operator.resource.DeploymentOperator) DeploymentConfigOperator(io.strimzi.controller.cluster.operator.resource.DeploymentConfigOperator)

Aggregations

ConfigMapOperator (io.strimzi.controller.cluster.operator.resource.ConfigMapOperator)6 DeploymentOperator (io.strimzi.controller.cluster.operator.resource.DeploymentOperator)6 KafkaSetOperator (io.strimzi.controller.cluster.operator.resource.KafkaSetOperator)6 PvcOperator (io.strimzi.controller.cluster.operator.resource.PvcOperator)6 ServiceOperator (io.strimzi.controller.cluster.operator.resource.ServiceOperator)6 ZookeeperSetOperator (io.strimzi.controller.cluster.operator.resource.ZookeeperSetOperator)6 Reconciliation (io.strimzi.controller.cluster.Reconciliation)5 Async (io.vertx.ext.unit.Async)5 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)4 ConfigMap (io.fabric8.kubernetes.api.model.ConfigMap)3 KafkaCluster (io.strimzi.controller.cluster.model.KafkaCluster)3 TopicController (io.strimzi.controller.cluster.model.TopicController)3 ZookeeperCluster (io.strimzi.controller.cluster.model.ZookeeperCluster)3 HashSet (java.util.HashSet)3 Deployment (io.fabric8.kubernetes.api.model.extensions.Deployment)2 StatefulSet (io.fabric8.kubernetes.api.model.extensions.StatefulSet)2 ConfigMapBuilder (io.fabric8.kubernetes.api.model.ConfigMapBuilder)1 Service (io.fabric8.kubernetes.api.model.Service)1 Labels (io.strimzi.controller.cluster.model.Labels)1 KafkaAssemblyOperator (io.strimzi.controller.cluster.operator.assembly.KafkaAssemblyOperator)1