strimzi-kafka-operator icon indicating copy to clipboard operation
strimzi-kafka-operator copied to clipboard

Add client rack-awareness support to Strimzi Bridge pods

Open robobario opened this issue 1 year ago • 4 comments

Type of change

  • Enhancement / new feature
  • Documentation

Description

Implements #6610

If you configure a rack topologyKey for a KafkaBridge CRD then an init container will be added to the bridge pod to retrieve the value of rack.topologyKey and write it into a file in /opt/strimzi/init. This /opt/strimzi/init volume is also mounted into the bridge container so it can retrieve the rack.id at runtime and use it for consumer configuration.

There is a corresponding PR for the bridge to add the rack id to it's consumer configuration: https://github.com/strimzi/strimzi-kafka-bridge/pull/659

Why: You could configure your Kafka Bridge to prefer to consume from a broker in the same zone, potentially saving on inter-zone transfer costs. This may cost in overall message latency as you may be consuming from a follower for a topic-partition.

/opt/strimzi/init was selected as the mount because strimzi-bridge startup scripts use a STRIMZI_HOME instead of KAFKA_HOME, this keeps the configuration within /opt/strimzi instead of introducting /opt/kafka to the image.

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • [x] Write tests
  • [x] Make sure all tests pass
  • [ ] Update documentation
  • [ ] Check RBAC rights for Kubernetes / OpenShift roles
  • [ ] Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • [x] Reference relevant issue(s) and close them after merging
  • [x] Update CHANGELOG.md
  • [ ] Supply screenshots for visual changes, such as Grafana dashboards

robobario avatar Sep 16 '22 06:09 robobario

Can one of the admins verify this patch?

strimzi-ci avatar Sep 16 '22 06:09 strimzi-ci

@robobario It looks like some of your changes to the CRD were not propagated through -> that is what failed the build. This should help to fix it:

ERROR: Uncommitted changes in derived resources:
M	packaging/helm-charts/helm3/strimzi-kafka-operator/crds/046-Crd-kafkabridge.yaml
Run the following to add up-to-date resources:
  mvn clean verify -DskipTests -DskipITs \
    && make crd_install \
    && make helm_install \
    && git add packaging/install/ packaging/helm-charts/ documentation/modules/appendix_crds.adoc cluster-operator/src/main/resources/cluster-roles \
    && git commit -s -m 'Update derived resources'

scholzj avatar Sep 16 '22 10:09 scholzj

/azp run regression

scholzj avatar Sep 19 '22 14:09 scholzj

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 19 '22 14:09 azure-pipelines[bot]

@ppatierno Can you please have a look at this?

scholzj avatar Sep 22 '22 19:09 scholzj

Thanks for the PR.

scholzj avatar Sep 23 '22 22:09 scholzj