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