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

operator v1: create internal kafka api port #205

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

birdayz
Copy link
Contributor

@birdayz birdayz commented Aug 29, 2024

currently in cloud, we use the full list of brokers and pass it around to various service making use of it, e.g. kafka connect.

however, this is completely ignoring the service discovery feature of the kafka api: bootstrap servers.

there is already a ClusterIP service for this purpose. However, it does not include kafka API. this patch adds kafka API to the ClusterIP service.

internal usage can now be done via the $name-cluster service on port 9092, if configured. tested on a cloud cluster.

the new usage internally is:

  • Use $name-cluster ClusterIP service for Service Discovery. This improves stability a lot, because k8s networking will quickly remove "gone" pods from this service's endpoints slice.
  • After discovering brokers via seed ClusterIP service, connections to brokers are performed directly as usual, via headless service => pod.

(From debug pod in same namespace):

root@ubuntu:/# export REDPANDA_BROKERS="rp-cr81n8j008pdnihh1ohg-cluster:9092"
root@ubuntu:/#   
export REDPANDA_SASL_MECHANISM="SCRAM-SHA-256"
export REDPANDA_SASL_USERNAME="abcdef"
export REDPANDA_SASL_PASSWORD="abcdef"
root@ubuntu:/# rpk topic list
NAME                          PARTITIONS  REPLICAS
__redpanda.connect.logs       1           3
__redpanda.connect.status     1           3
__redpanda.connectors_logs    1           3
_internal_connectors_configs  1           3
_internal_connectors_offsets  25          3
_internal_connectors_status   5           3
_redpanda.audit_log           12          3
_redpanda_e2e_probe           3           3
_schemas                      1           3
root@ubuntu:/# rpk cluster metadata
CLUSTER
=======
redpanda.rp-cr81n8j008pdnihh1ohg

BROKERS
=======
ID    HOST                                                                           PORT  RACK
0*    rp-cr81n8j008pdnihh1ohg-0.rp-cr81n8j008pdnihh1ohg.redpanda.svc.cluster.local.  9092  europe-west1-b
1     rp-cr81n8j008pdnihh1ohg-1.rp-cr81n8j008pdnihh1ohg.redpanda.svc.cluster.local.  9092  europe-west1-b
2     rp-cr81n8j008pdnihh1ohg-2.rp-cr81n8j008pdnihh1ohg.redpanda.svc.cluster.local.  9092  europe-west1-b

@birdayz birdayz force-pushed the jb/opv1-bootstrap-service branch from 82cc099 to 93b6bdf Compare August 29, 2024 09:22
@birdayz birdayz force-pushed the jb/opv1-bootstrap-service branch from 93b6bdf to fb779df Compare August 29, 2024 11:07
@birdayz birdayz force-pushed the jb/opv1-bootstrap-service branch from 39bb6d1 to 3cd3d31 Compare August 30, 2024 12:47
@birdayz birdayz enabled auto-merge (rebase) August 30, 2024 14:50
currently in cloud, we use the full list of brokers and pass it around
to various service making use of it, e.g. kafka connect.

however, this is completely ignoring the service discovery feature of
the kafka api: bootstrap servers.

there is already a ClusterIP service for this purpose. However, it does
not include kafka API. this patch adds kafka API to the ClusterIP
service.

internal usage can now be done via the $name-cluster service on port
9092, if configured. tested on a cloud cluster.

for reference; the same approach is also used by other operators;
including Strimzi.
@birdayz birdayz force-pushed the jb/opv1-bootstrap-service branch from 3cd3d31 to cde9275 Compare August 30, 2024 16:52
@birdayz birdayz disabled auto-merge August 30, 2024 16:52
@RafalKorepta RafalKorepta merged commit c3e4e92 into main Sep 2, 2024
4 checks passed
@RafalKorepta RafalKorepta deleted the jb/opv1-bootstrap-service branch December 2, 2024 13:27
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.

3 participants