use of io.strimzi.api.kafka.model.ClientTls in project strimzi-kafka-operator 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 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-kafka-operator 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;
}
Aggregations