use of io.strimzi.api.kafka.model.ClientTls in project strimzi by strimzi.
the class KafkaMirrorMaker2Cluster method getVolumes.
@Override
protected List<Volume> getVolumes(boolean isOpenShift) {
List<Volume> volumeList = super.getVolumes(isOpenShift);
for (KafkaMirrorMaker2ClusterSpec mirrorMaker2Cluster : clusters) {
String alias = mirrorMaker2Cluster.getAlias();
ClientTls tls = mirrorMaker2Cluster.getTls();
if (tls != null) {
VolumeUtils.createSecretVolume(volumeList, tls.getTrustedCertificates(), isOpenShift, alias);
}
AuthenticationUtils.configureClientAuthenticationVolumes(mirrorMaker2Cluster.getAuthentication(), volumeList, mirrorMaker2Cluster.getAlias() + "-oauth-certs", isOpenShift, mirrorMaker2Cluster.getAlias() + '-', true);
}
return volumeList;
}
use of io.strimzi.api.kafka.model.ClientTls in project strimzi by strimzi.
the class KafkaMirrorMaker2Cluster method getClusterTrustedCerts.
private void getClusterTrustedCerts(final StringBuilder clustersTrustedCerts, KafkaMirrorMaker2ClusterSpec mirrorMaker2Cluster, String clusterAlias) {
ClientTls tls = mirrorMaker2Cluster.getTls();
if (tls != null) {
List<CertSecretSource> trustedCertificates = tls.getTrustedCertificates();
if (trustedCertificates != null && trustedCertificates.size() > 0) {
if (clustersTrustedCerts.length() > 0) {
clustersTrustedCerts.append("\n");
}
clustersTrustedCerts.append(clusterAlias);
clustersTrustedCerts.append("=");
boolean separator = false;
for (CertSecretSource certSecretSource : trustedCertificates) {
if (separator) {
clustersTrustedCerts.append(";");
}
clustersTrustedCerts.append(certSecretSource.getSecretName());
clustersTrustedCerts.append("/");
clustersTrustedCerts.append(certSecretSource.getCertificate());
separator = true;
}
}
}
}
use of io.strimzi.api.kafka.model.ClientTls in project strimzi-kafka-operator by strimzi.
the class KafkaMirrorMaker2Cluster method buildKafkaConnectSpec.
private static KafkaConnectSpec buildKafkaConnectSpec(KafkaMirrorMaker2Spec spec, KafkaMirrorMaker2ClusterSpec connectCluster) {
ClientTls connectTls = null;
ClientTls mirrorMaker2ConnectClusterTls = connectCluster.getTls();
if (mirrorMaker2ConnectClusterTls != null) {
connectTls = new ClientTls();
connectTls.setTrustedCertificates(mirrorMaker2ConnectClusterTls.getTrustedCertificates());
for (Entry<String, Object> entry : mirrorMaker2ConnectClusterTls.getAdditionalProperties().entrySet()) {
connectTls.setAdditionalProperty(entry.getKey(), entry.getValue());
}
}
return new KafkaConnectSpecBuilder().withBootstrapServers(connectCluster.getBootstrapServers()).withTls(connectTls).withAuthentication(connectCluster.getAuthentication()).withConfig(connectCluster.getConfig()).withLogging(spec.getLogging()).withReplicas(spec.getReplicas()).withVersion(spec.getVersion()).withImage(spec.getImage()).withResources(spec.getResources()).withLivenessProbe(spec.getLivenessProbe()).withReadinessProbe(spec.getReadinessProbe()).withJvmOptions(spec.getJvmOptions()).withJmxOptions(spec.getJmxOptions()).withMetricsConfig(spec.getMetricsConfig()).withTracing(spec.getTracing()).withTemplate(spec.getTemplate()).withExternalConfiguration(spec.getExternalConfiguration()).build();
}
use of io.strimzi.api.kafka.model.ClientTls in project strimzi by strimzi.
the class KafkaMirrorMaker2Cluster method getVolumeMounts.
@Override
protected List<VolumeMount> getVolumeMounts() {
List<VolumeMount> volumeMountList = super.getVolumeMounts();
for (KafkaMirrorMaker2ClusterSpec mirrorMaker2Cluster : clusters) {
String alias = mirrorMaker2Cluster.getAlias();
String tlsVolumeMountPath = buildClusterVolumeMountPath(MIRRORMAKER_2_TLS_CERTS_BASE_VOLUME_MOUNT, alias);
ClientTls kafkaMirrorMaker2Tls = mirrorMaker2Cluster.getTls();
if (kafkaMirrorMaker2Tls != null) {
VolumeUtils.createSecretVolumeMount(volumeMountList, kafkaMirrorMaker2Tls.getTrustedCertificates(), tlsVolumeMountPath, alias);
}
String passwordVolumeMountPath = buildClusterVolumeMountPath(MIRRORMAKER_2_PASSWORD_VOLUME_MOUNT, alias);
String oauthTlsVolumeMountPath = buildClusterVolumeMountPath(MIRRORMAKER_2_OAUTH_TLS_CERTS_BASE_VOLUME_MOUNT, alias);
String oauthVolumeMountPath = buildClusterVolumeMountPath(MIRRORMAKER_2_OAUTH_SECRETS_BASE_VOLUME_MOUNT, alias);
AuthenticationUtils.configureClientAuthenticationVolumeMounts(mirrorMaker2Cluster.getAuthentication(), volumeMountList, tlsVolumeMountPath, passwordVolumeMountPath, oauthTlsVolumeMountPath, mirrorMaker2Cluster.getAlias() + "-oauth-certs", mirrorMaker2Cluster.getAlias() + '-', true, oauthVolumeMountPath);
}
return volumeMountList;
}
use of io.strimzi.api.kafka.model.ClientTls in project strimzi by strimzi.
the class KafkaMirrorMaker2Cluster method buildKafkaConnectSpec.
private static KafkaConnectSpec buildKafkaConnectSpec(KafkaMirrorMaker2Spec spec, KafkaMirrorMaker2ClusterSpec connectCluster) {
ClientTls connectTls = null;
ClientTls mirrorMaker2ConnectClusterTls = connectCluster.getTls();
if (mirrorMaker2ConnectClusterTls != null) {
connectTls = new ClientTls();
connectTls.setTrustedCertificates(mirrorMaker2ConnectClusterTls.getTrustedCertificates());
for (Entry<String, Object> entry : mirrorMaker2ConnectClusterTls.getAdditionalProperties().entrySet()) {
connectTls.setAdditionalProperty(entry.getKey(), entry.getValue());
}
}
return new KafkaConnectSpecBuilder().withBootstrapServers(connectCluster.getBootstrapServers()).withTls(connectTls).withAuthentication(connectCluster.getAuthentication()).withConfig(connectCluster.getConfig()).withLogging(spec.getLogging()).withReplicas(spec.getReplicas()).withVersion(spec.getVersion()).withImage(spec.getImage()).withResources(spec.getResources()).withLivenessProbe(spec.getLivenessProbe()).withReadinessProbe(spec.getReadinessProbe()).withJvmOptions(spec.getJvmOptions()).withJmxOptions(spec.getJmxOptions()).withMetricsConfig(spec.getMetricsConfig()).withTracing(spec.getTracing()).withTemplate(spec.getTemplate()).withExternalConfiguration(spec.getExternalConfiguration()).build();
}
Aggregations