use of io.strimzi.certs.OpenSslCertManager in project strimzi by strimzi.
the class Main method run.
static Future<String> run(Vertx vertx, KubernetesClient client, AdminClientProvider adminClientProvider, UserOperatorConfig config) {
Util.printEnvInfo();
String dnsCacheTtl = System.getenv("STRIMZI_DNS_CACHE_TTL") == null ? "30" : System.getenv("STRIMZI_DNS_CACHE_TTL");
Security.setProperty("networkaddress.cache.ttl", dnsCacheTtl);
OpenSslCertManager certManager = new OpenSslCertManager();
SecretOperator secretOperations = new SecretOperator(vertx, client);
CrdOperator<KubernetesClient, KafkaUser, KafkaUserList> crdOperations = new CrdOperator<>(vertx, client, KafkaUser.class, KafkaUserList.class, KafkaUser.RESOURCE_KIND);
return createAdminClient(adminClientProvider, config, secretOperations).compose(adminClient -> {
SimpleAclOperator aclOperations = new SimpleAclOperator(vertx, adminClient);
ScramCredentialsOperator scramCredentialsOperator = new ScramCredentialsOperator(vertx, adminClient);
QuotasOperator quotasOperator = new QuotasOperator(vertx, adminClient);
KafkaUserOperator kafkaUserOperations = new KafkaUserOperator(vertx, certManager, crdOperations, secretOperations, scramCredentialsOperator, quotasOperator, aclOperations, config);
Promise<String> promise = Promise.promise();
UserOperator operator = new UserOperator(config.getNamespace(), config, client, kafkaUserOperations);
vertx.deployVerticle(operator, res -> {
if (res.succeeded()) {
LOGGER.info("User Operator verticle started in namespace {}", config.getNamespace());
} else {
LOGGER.error("User Operator verticle in namespace {} failed to start", config.getNamespace(), res.cause());
System.exit(1);
}
promise.handle(res);
});
return promise.future();
});
}
use of io.strimzi.certs.OpenSslCertManager in project strimzi by strimzi.
the class Main method run.
static CompositeFuture run(Vertx vertx, KubernetesClient client, PlatformFeaturesAvailability pfa, ClusterOperatorConfig config) {
Util.printEnvInfo();
ResourceOperatorSupplier resourceOperatorSupplier = new ResourceOperatorSupplier(vertx, client, pfa, config.featureGates(), config.getOperationTimeoutMs());
OpenSslCertManager certManager = new OpenSslCertManager();
PasswordGenerator passwordGenerator = new PasswordGenerator(12, "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789");
KafkaAssemblyOperator kafkaClusterOperations = new KafkaAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
KafkaConnectAssemblyOperator kafkaConnectClusterOperations = new KafkaConnectAssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
KafkaMirrorMaker2AssemblyOperator kafkaMirrorMaker2AssemblyOperator = new KafkaMirrorMaker2AssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
KafkaMirrorMakerAssemblyOperator kafkaMirrorMakerAssemblyOperator = new KafkaMirrorMakerAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
KafkaBridgeAssemblyOperator kafkaBridgeAssemblyOperator = new KafkaBridgeAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
KafkaRebalanceAssemblyOperator kafkaRebalanceAssemblyOperator = new KafkaRebalanceAssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
List<Future> futures = new ArrayList<>(config.getNamespaces().size());
for (String namespace : config.getNamespaces()) {
Promise<String> prom = Promise.promise();
futures.add(prom.future());
ClusterOperator operator = new ClusterOperator(namespace, config, client, kafkaClusterOperations, kafkaConnectClusterOperations, kafkaMirrorMakerAssemblyOperator, kafkaMirrorMaker2AssemblyOperator, kafkaBridgeAssemblyOperator, kafkaRebalanceAssemblyOperator, resourceOperatorSupplier);
vertx.deployVerticle(operator, res -> {
if (res.succeeded()) {
if (config.getCustomResourceSelector() != null) {
LOGGER.info("Cluster Operator verticle started in namespace {} with label selector {}", namespace, config.getCustomResourceSelector());
} else {
LOGGER.info("Cluster Operator verticle started in namespace {} without label selector", namespace);
}
} else {
LOGGER.error("Cluster Operator verticle in namespace {} failed to start", namespace, res.cause());
System.exit(1);
}
prom.handle(res);
});
}
return CompositeFuture.join(futures);
}
use of io.strimzi.certs.OpenSslCertManager in project strimzi by strimzi.
the class KafkaClusterTest method generateBrokerSecret.
private Secret generateBrokerSecret(Set<String> externalBootstrapAddress, Map<Integer, Set<String>> externalAddresses) {
ClusterCa clusterCa = new ClusterCa(Reconciliation.DUMMY_RECONCILIATION, new OpenSslCertManager(), new PasswordGenerator(10, "a", "a"), cluster, null, null);
clusterCa.createRenewOrReplace(namespace, cluster, emptyMap(), emptyMap(), emptyMap(), null, true);
ClientsCa clientsCa = new ClientsCa(Reconciliation.DUMMY_RECONCILIATION, new OpenSslCertManager(), new PasswordGenerator(10, "a", "a"), null, null, null, null, 365, 30, true, CertificateExpirationPolicy.RENEW_CERTIFICATE);
clientsCa.createRenewOrReplace(namespace, cluster, emptyMap(), emptyMap(), emptyMap(), null, true);
kc.generateCertificates(kafkaAssembly, clusterCa, externalBootstrapAddress, externalAddresses, true);
return kc.generateBrokersSecret(clusterCa, clientsCa);
}
use of io.strimzi.certs.OpenSslCertManager in project strimzi-kafka-operator by strimzi.
the class Main method run.
static CompositeFuture run(Vertx vertx, KubernetesClient client, PlatformFeaturesAvailability pfa, ClusterOperatorConfig config) {
Util.printEnvInfo();
ResourceOperatorSupplier resourceOperatorSupplier = new ResourceOperatorSupplier(vertx, client, pfa, config.featureGates(), config.getOperationTimeoutMs());
OpenSslCertManager certManager = new OpenSslCertManager();
PasswordGenerator passwordGenerator = new PasswordGenerator(12, "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789");
KafkaAssemblyOperator kafkaClusterOperations = new KafkaAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
KafkaConnectAssemblyOperator kafkaConnectClusterOperations = new KafkaConnectAssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
KafkaMirrorMaker2AssemblyOperator kafkaMirrorMaker2AssemblyOperator = new KafkaMirrorMaker2AssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
KafkaMirrorMakerAssemblyOperator kafkaMirrorMakerAssemblyOperator = new KafkaMirrorMakerAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
KafkaBridgeAssemblyOperator kafkaBridgeAssemblyOperator = new KafkaBridgeAssemblyOperator(vertx, pfa, certManager, passwordGenerator, resourceOperatorSupplier, config);
KafkaRebalanceAssemblyOperator kafkaRebalanceAssemblyOperator = new KafkaRebalanceAssemblyOperator(vertx, pfa, resourceOperatorSupplier, config);
List<Future> futures = new ArrayList<>(config.getNamespaces().size());
for (String namespace : config.getNamespaces()) {
Promise<String> prom = Promise.promise();
futures.add(prom.future());
ClusterOperator operator = new ClusterOperator(namespace, config, client, kafkaClusterOperations, kafkaConnectClusterOperations, kafkaMirrorMakerAssemblyOperator, kafkaMirrorMaker2AssemblyOperator, kafkaBridgeAssemblyOperator, kafkaRebalanceAssemblyOperator, resourceOperatorSupplier);
vertx.deployVerticle(operator, res -> {
if (res.succeeded()) {
if (config.getCustomResourceSelector() != null) {
LOGGER.info("Cluster Operator verticle started in namespace {} with label selector {}", namespace, config.getCustomResourceSelector());
} else {
LOGGER.info("Cluster Operator verticle started in namespace {} without label selector", namespace);
}
} else {
LOGGER.error("Cluster Operator verticle in namespace {} failed to start", namespace, res.cause());
System.exit(1);
}
prom.handle(res);
});
}
return CompositeFuture.join(futures);
}
use of io.strimzi.certs.OpenSslCertManager in project strimzi-kafka-operator by strimzi.
the class Main method run.
static Future<String> run(Vertx vertx, KubernetesClient client, AdminClientProvider adminClientProvider, UserOperatorConfig config) {
Util.printEnvInfo();
String dnsCacheTtl = System.getenv("STRIMZI_DNS_CACHE_TTL") == null ? "30" : System.getenv("STRIMZI_DNS_CACHE_TTL");
Security.setProperty("networkaddress.cache.ttl", dnsCacheTtl);
OpenSslCertManager certManager = new OpenSslCertManager();
SecretOperator secretOperations = new SecretOperator(vertx, client);
CrdOperator<KubernetesClient, KafkaUser, KafkaUserList> crdOperations = new CrdOperator<>(vertx, client, KafkaUser.class, KafkaUserList.class, KafkaUser.RESOURCE_KIND);
return createAdminClient(adminClientProvider, config, secretOperations).compose(adminClient -> {
SimpleAclOperator aclOperations = new SimpleAclOperator(vertx, adminClient);
ScramCredentialsOperator scramCredentialsOperator = new ScramCredentialsOperator(vertx, adminClient);
QuotasOperator quotasOperator = new QuotasOperator(vertx, adminClient);
KafkaUserOperator kafkaUserOperations = new KafkaUserOperator(vertx, certManager, crdOperations, secretOperations, scramCredentialsOperator, quotasOperator, aclOperations, config);
Promise<String> promise = Promise.promise();
UserOperator operator = new UserOperator(config.getNamespace(), config, client, kafkaUserOperations);
vertx.deployVerticle(operator, res -> {
if (res.succeeded()) {
LOGGER.info("User Operator verticle started in namespace {}", config.getNamespace());
} else {
LOGGER.error("User Operator verticle in namespace {} failed to start", config.getNamespace(), res.cause());
System.exit(1);
}
promise.handle(res);
});
return promise.future();
});
}
Aggregations