use of io.strimzi.api.kafka.model.storage.Storage in project strimzi by strimzi.
the class KafkaBrokerConfigurationBuilderTest method testPersistentStorageLogDirs.
@ParallelTest
public void testPersistentStorageLogDirs() {
Storage storage = new PersistentClaimStorageBuilder().withSize("1Ti").withStorageClass("aws-ebs").withDeleteClaim(true).build();
String configuration = new KafkaBrokerConfigurationBuilder(Reconciliation.DUMMY_RECONCILIATION).withLogDirs(VolumeUtils.createVolumeMounts(storage, "/var/lib/kafka", false)).build();
assertThat(configuration, isEquivalent("log.dirs=/var/lib/kafka/data/kafka-log${STRIMZI_BROKER_ID}"));
}
use of io.strimzi.api.kafka.model.storage.Storage in project strimzi by strimzi.
the class ZookeeperClusterTest method testStorageValidationAfterInitialDeployment.
@ParallelTest
public void testStorageValidationAfterInitialDeployment() {
assertThrows(InvalidResourceException.class, () -> {
Storage oldStorage = new PersistentClaimStorageBuilder().withSize("100Gi").build();
Kafka kafkaAssembly = new KafkaBuilder(ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout, jmxMetricsConfig, configurationJson, zooConfigurationJson)).editSpec().editZookeeper().withStorage(new PersistentClaimStorageBuilder().build()).endZookeeper().endSpec().build();
ZookeeperCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS, oldStorage, replicas);
});
}
use of io.strimzi.api.kafka.model.storage.Storage in project strimzi by strimzi.
the class StorageUtilsTest method testEphemeralStorage.
@ParallelTest
public void testEphemeralStorage() {
Storage notEphemeral = new PersistentClaimStorageBuilder().build();
Storage isEphemeral = new EphemeralStorageBuilder().build();
Storage includesEphemeral = new JbodStorageBuilder().withVolumes(new EphemeralStorageBuilder().withId(1).build(), new EphemeralStorageBuilder().withId(2).build()).build();
assertThat(StorageUtils.usesEphemeral(notEphemeral), is(false));
assertThat(StorageUtils.usesEphemeral(isEphemeral), is(true));
assertThat(StorageUtils.usesEphemeral(includesEphemeral), is(true));
}
use of io.strimzi.api.kafka.model.storage.Storage in project strimzi by strimzi.
the class StorageDiffTest method testSizeChanges.
@ParallelTest
public void testSizeChanges() {
Storage persistent = new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(false).withId(0).withSize("100Gi").build();
Storage persistent2 = new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(false).withId(0).withSize("1000Gi").build();
Storage persistent3 = new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(false).withId(0).withSize("10Gi").build();
assertThat(new StorageDiff(Reconciliation.DUMMY_RECONCILIATION, persistent, persistent, 3, 3).shrinkSize(), is(false));
assertThat(new StorageDiff(Reconciliation.DUMMY_RECONCILIATION, persistent, persistent2, 3, 3).shrinkSize(), is(false));
assertThat(new StorageDiff(Reconciliation.DUMMY_RECONCILIATION, persistent, persistent3, 3, 3).shrinkSize(), is(true));
}
use of io.strimzi.api.kafka.model.storage.Storage in project strimzi by strimzi.
the class StorageDiffTest method testSizeChangesInJbod.
@ParallelTest
public void testSizeChangesInJbod() {
Storage jbod = new JbodStorageBuilder().withVolumes(new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(false).withId(0).withSize("1000Gi").build(), new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(true).withId(1).withSize("1000Gi").build()).build();
Storage jbod2 = new JbodStorageBuilder().withVolumes(new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(false).withId(0).withSize("5000Gi").build(), new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(true).withId(1).withSize("1000Gi").build()).build();
Storage jbod3 = new JbodStorageBuilder().withVolumes(new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(false).withId(0).withSize("1000Gi").build(), new PersistentClaimStorageBuilder().withStorageClass("gp2-ssd").withDeleteClaim(true).withId(1).withSize("500Gi").build()).build();
assertThat(new StorageDiff(Reconciliation.DUMMY_RECONCILIATION, jbod, jbod, 3, 3).shrinkSize(), is(false));
assertThat(new StorageDiff(Reconciliation.DUMMY_RECONCILIATION, jbod, jbod2, 3, 3).shrinkSize(), is(false));
assertThat(new StorageDiff(Reconciliation.DUMMY_RECONCILIATION, jbod, jbod3, 3, 3).shrinkSize(), is(true));
}
Aggregations