Skip to content

feat: add option to override placementStrategy for bootstrap command - #249

Merged
dateutli merged 3 commits into
masterfrom
feat/default-to-cross-rack-topic-placement
Jan 7, 2026
Merged

feat: add option to override placementStrategy for bootstrap command#249
dateutli merged 3 commits into
masterfrom
feat/default-to-cross-rack-topic-placement

Conversation

@dateutli

Copy link
Copy Markdown
Contributor

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 a team as a code ownerJanuary 7, 2026 00:03
Comment threadpkg/version/version.go
petedannemann
petedannemann previously approved these changes Jan 7, 2026
@hhahn-tw

Copy link
Copy Markdown
Contributor

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

@dateutli

Copy link
Copy Markdown
ContributorAuthor

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.

Comment threadpkg/cli/cli.go
@dateutli
dateutli merged commit 66e0162 into masterJan 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 freeto 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.

3 participants

@dateutli@hhahn-tw@petedannemann