Class OcpKafkaController
java.lang.Object
io.debezium.testing.system.tools.kafka.OcpKafkaController
- All Implemented Interfaces:
KafkaController
This class provides control over Kafka instance deployed in OpenShift
- Author:
- Jakub Cechacek
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate io.strimzi.api.kafka.model.Kafkaprivate static final org.slf4j.Loggerprivate final Stringprivate final io.fabric8.openshift.client.OpenShiftClientprivate final StrimziOperatorControllerprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionOcpKafkaController(io.strimzi.api.kafka.model.Kafka kafka, StrimziOperatorController operatorController, io.fabric8.openshift.client.OpenShiftClient ocp) -
Method Summary
Modifier and TypeMethodDescriptionio.strimzi.api.kafka.model.KafkaTopicdeployTopic(String yamlPath) Deploy kafka topic from given CRThe Bootstrap address returned by this method may not be reachable form arbitrary network.private FileReturns bootstrap to be used by KC.The Bootstrap address returned by this method must be reachable form arbitrary network.private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.Kafka,io.strimzi.api.kafka.KafkaList, io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.Kafka>> private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.KafkaTopic,io.strimzi.api.kafka.KafkaTopicList, io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.KafkaTopic>> booleanundeploy()Undeploy this Kafka clustervoidWaits for cluster to be availableprivate io.strimzi.api.kafka.model.KafkaTopicwaitForKafkaTopic(String name) Waits until topic is properly deployed.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ocp
private final io.fabric8.openshift.client.OpenShiftClient ocp -
project
-
name
-
operatorController
-
kafka
private io.strimzi.api.kafka.model.Kafka kafka
-
-
Constructor Details
-
OcpKafkaController
public OcpKafkaController(io.strimzi.api.kafka.model.Kafka kafka, StrimziOperatorController operatorController, io.fabric8.openshift.client.OpenShiftClient ocp)
-
-
Method Details
-
getPublicBootstrapAddress
Description copied from interface:KafkaControllerThe Bootstrap address returned by this method must be reachable form arbitrary network.- Specified by:
getPublicBootstrapAddressin interfaceKafkaController- Returns:
- Publicly reachable Kafka Bootstrap Server address
-
getBootstrapAddress
Description copied from interface:KafkaControllerThe Bootstrap address returned by this method may not be reachable form arbitrary network.- Specified by:
getBootstrapAddressin interfaceKafkaController- Returns:
- Kafka Bootstrap Server address
-
getTlsBootstrapAddress
- Specified by:
getTlsBootstrapAddressin interfaceKafkaController
-
getLocalBootstrapAddress
Returns bootstrap to be used by KC. The address is local.- Returns:
- bootstrap
-
deployTopic
public io.strimzi.api.kafka.model.KafkaTopic deployTopic(String yamlPath) throws InterruptedException Deploy kafka topic from given CR- Parameters:
yamlPath- path to yaml descript- Returns:
- created topic
- Throws:
InterruptedException
-
undeploy
public boolean undeploy()Description copied from interface:KafkaControllerUndeploy this Kafka cluster- Specified by:
undeployin interfaceKafkaController- Returns:
- true on operation success
-
waitForCluster
Description copied from interface:KafkaControllerWaits for cluster to be available- Specified by:
waitForClusterin interfaceKafkaController- Throws:
InterruptedException
-
waitForKafkaTopic
private io.strimzi.api.kafka.model.KafkaTopic waitForKafkaTopic(String name) throws InterruptedException Waits until topic is properly deployed.- Parameters:
name- name of the topic- Throws:
InterruptedException- on wait errorIllegalArgumentException- when deployment doesn't use custom resources
-
topicOperation
private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.KafkaTopic,io.strimzi.api.kafka.KafkaTopicList, topicOperation()io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.KafkaTopic>> -
kafkaOperation
private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.Kafka,io.strimzi.api.kafka.KafkaList, kafkaOperation()io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.Kafka>> -
getDefaultConsumerProperties
- Specified by:
getDefaultConsumerPropertiesin interfaceKafkaController- Returns:
- default kafka consumer configuration
-
getKafkaCaCertificate
- Throws:
IOException
-