Skip to content

Conversation

@dateutli
Copy link
Contributor

@dateutli dateutli commented Jan 7, 2026

Description
Currently, bootstrap command only generates topic configs with a placement strategy of any. A better default value would be cross-rack as it aligns with what Kafka does when topics are created using its tooling.

In the given case that this placement strategy is not the desired one, I've updated the bootstrap command to add support for placement-strategy-overwrite flag. It defaults to the proposed cross-rack strategy if not provided but gives the opportunity to change it to any of the other strategies.

Testing
$ topicctl bootstrap topic-static --cluster-config="examples/local-cluster/cluster.yaml"

meta:
  cluster: local-cluster
  description: Bootstrapped via topicctl bootstrap
  environment: local-env
  labels: null
  name: topic-static
  region: local-region
spec:
  partitions: 10
  placement:
    strategy: cross-rack
  replicationFactor: 2
  retentionMinutes: 290

$ topicctl bootstrap topic-static --cluster-config="examples/local-cluster/cluster.yaml" --placement-strategy-overwrite="any"

meta:
  cluster: local-cluster
  description: Bootstrapped via topicctl bootstrap
  environment: local-env
  labels: null
  name: topic-static
  region: local-region
spec:
  partitions: 10
  placement:
    strategy: any
  replicationFactor: 2
  retentionMinutes: 290

@dateutli dateutli requested a review from petedannemann January 7, 2026 00:03
@dateutli dateutli requested a review from a team as a code owner January 7, 2026 00:03
petedannemann
petedannemann previously approved these changes Jan 7, 2026
@hhahn-tw
Copy link
Contributor

hhahn-tw commented Jan 7, 2026

Any reason not to use --placement-strategy rather than --placement-strategy-overwrite? The "-overwrite" part seems unnecessary.

@dateutli
Copy link
Contributor Author

dateutli commented Jan 7, 2026

Any reason not to use --placement-strategy rather than --placement-strategy-overwrite? The "-overwrite" part seems unnecessary.

Thanks for the suggestion, I've updated the PR accordingly.

@dateutli dateutli merged commit 66e0162 into master Jan 7, 2026
13 of 14 checks passed
@dateutli dateutli deleted the feat/default-to-cross-rack-topic-placement branch January 7, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants