Skip to content
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

feat: added kafka-topic provisioner #150

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

astromechza
Copy link
Member

@astromechza astromechza commented Jun 5, 2024

See the newly added example in examples/13-kafka-topic. This provisions a 3-partition kafka topic on a random host.

$ go run ../../cmd/score-compose resources list
dns.default#hello-world.dns
kafka-topic.default#hello-world.bus
route.default#hello-world.route

$ go run ../../cmd/score-compose resources get-outputs 'kafka-topic.default#hello-world.bus'
{"host":"kafka-e9KQfd","name":"topic-lTppsn","num_partitions":3,"port":"9092"}

You can see in the example screenshot that the redpanda console can connect to it successfully:

Screenshot 2024-06-05 at 16 36 41

Fixes #149

@astromechza astromechza linked an issue Jun 5, 2024 that may be closed by this pull request
@astromechza astromechza added the enhancement New feature or request label Jun 5, 2024
interval: 2s
timeout: 2s
retries: 10
{{ $publishPort := (dig "annotations" "compose.score.dev/publish-port" "0" .Metadata | atoi) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with kakfa at all, but is the publishPort really optional? Should we just add this port anyway without having this as an annotation in Score?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathieu-benoit this is about publishing the port outside of docker. It's already available for services to call within the docker network. The reason to make it optional is that it may conflict with other ports open on the host so we need the users concent to start listening on this.

internal/command/default.provisioners.yaml Outdated Show resolved Hide resolved
@astromechza astromechza force-pushed the 149-feature-request-kafka-topic-provisioner branch from 7f4f360 to 430b2cd Compare June 6, 2024 10:15
@astromechza astromechza force-pushed the 149-feature-request-kafka-topic-provisioner branch from 430b2cd to e7b5766 Compare June 6, 2024 10:16
Copy link
Contributor

@mathieu-benoit mathieu-benoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@astromechza astromechza merged commit d02dd75 into main Jun 6, 2024
3 checks passed
@astromechza astromechza deleted the 149-feature-request-kafka-topic-provisioner branch June 6, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] kafka-topic provisioner
2 participants