-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Multiple controllers #167
Conversation
285431a
to
90bdc01
Compare
|
||
private void assertNodeIdHasRole(KafkaClusterConfig kafkaClusterConfig, int nodeId, String expectedRole) { | ||
final var config = kafkaClusterConfig.generateConfigForSpecificNode(endpointConfig, nodeId); | ||
assertThat(config.getProperties()).extracting(brokerConfig -> brokerConfig.get("process.roles")).as("nodeId: %s to have process.roles", nodeId).isEqualTo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should switch to using the kafka enums throughout in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh that is a good thought
impl/src/main/java/io/kroxylicious/testing/kafka/common/KafkaClusterFactory.java
Outdated
Show resolved
Hide resolved
impl/src/main/java/io/kroxylicious/testing/kafka/common/KafkaClusterConfig.java
Show resolved
Hide resolved
@@ -93,6 +98,11 @@ public static KafkaCluster create(KafkaClusterConfig clusterConfig) { | |||
} | |||
} | |||
|
|||
private static KafkaClusterExecutionMode getExecutionMode(KafkaClusterConfig clusterConfig) { | |||
return KafkaClusterExecutionMode.convertClusterExecutionMode(System.getenv().get(TEST_CLUSTER_EXECUTION_MODE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not part of your changes but it looks a bit dangerous that it defaults it if the string is unknown, maybe better to explode with error if the user supplies value "CONTAINDERER"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good to have all the language aligned on node/broker/controller thanks @SamBarker
Would be good to have another round on KafkaClusterConfig
to try and move away from going from the configuration straight to server properties, passing those maps down to collect protocols/listeners/etc. Maybe there's some intermediate representation missing like: TestDefinition -> Nodes -> Properties
where Nodes
describes how we want the cluster to look.
9c78f66
to
d3c045b
Compare
impl/src/main/java/io/kroxylicious/testing/kafka/testcontainers/TestcontainersKafkaCluster.java
Outdated
Show resolved
Hide resolved
We should probably update the README and the javadocs on the I also think that with this change you're not far from being able to add support for controlling whether we use combined or pure-controller nodes using some |
Yeah thats a good point.
Yeah I've questioned the use of combined mode throughout this work but I really don't want to try and tackle it as part of this PR. Partly because I wonder if at that point we want to move to a more sophisticated deployment model such as |
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
…ing comes from. Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
When the build fails archiving the container logs also failed as the previous format contained `:`. Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Extracting methods in the process. Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
…trollers in Kraft clusters. Signed-off-by: Sam Barker <[email protected]>
16bf56a
to
05d6fb6
Compare
README.md
Outdated
@@ -74,6 +74,17 @@ When multiple constraints are provided they will _all_ be satisfied. | |||
|
|||
The cluster will be provisioned using the fastest available mechanism, because your development inner loop is a precious thing. | |||
|
|||
## Provisioning topology | |||
|
|||
In kraft cluster (the default) the extension will generate nodes using the `broker, controller` roles until it reaches the desired number of brokers or controllers (which ever is lowest) at which point it will continue deploying the remaining role. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In kraft cluster
Should we introduce some term like cluster mode [kraft, zookeeper]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, my first draft locally I called it kraft mode
but thought a kraft cluster
aligned better with the use of the KraftCluster
annotation.
The mode terminology would be extension specific as Apache Kafka talks about KRaft clusters IIRC
Signed-off-by: Sam Barker <[email protected]>
Signed-off-by: Sam Barker <[email protected]>
Co-authored-by: Robert Young <[email protected]> Signed-off-by: Sam Barker <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Type of change
Description
Fixes the cluster configuration and start up so that multiple controller nodes work. Fixes: #165
Additional Context
I still see this as an intermediate step, there are kludges to detect if a node should be a controller or a broker or both. While they work it feels like we are missing a proper object model that knows what role a node has. We also lack the ability for users to control the cluster topology (i.e. they can't have nodes in controller only mode with while they they still have brokers to start)
Checklist
Please go through this checklist and make sure all applicable tasks have been done