connect_client¶
Usage¶
This relation interface describes the expected behavior of any charm claiming to be able to interface with a Kafka Connect cluster as a client/integrator or a provider. For the sake of this document, client, integrator and requirer all refer to the same concept.
A Kafka Connect integrator will either require a specific connector library (which is a bundle of JAR files adhering to Kafka Connect connector interface definition) or not:
In case it requires a connector library, it should provide the URL of this resource via
plugin-urlparameter on the requirer side. All the required files should be packaged into a single Tarball and served at the provided endpoint. The only requirement here is that theplugin-urlshould be accessible by the Kafka Connect provider.In case a connector library is not required (e.g. the case of MirrorMaker integrator), the requirer should fill the
plugin-urlwith the sentinel value:NOT-REQUIRED.
This interface is implemented in the data_interfaces library of the data_platform_libs. Moreover, requirer charms can use the kafkacl library which provides reusable code for Kafka Connect integrator charms. Developers are free to provide alternative libraries as long as they fulfil the behavioural and schematic requirements described in this document.
Direction¶
flowchart LR
Requirer -- plugin-url, requested-secrets --> Provider
Provider -- "endpoints, secret-user [,secret-tls]"--> Requirer
Behavior¶
Both the Requirer and the Provider need to adhere to the following criteria, to be considered compatible with the interface.
Provider¶
The provider should download the connector plugins from the
plugin-urlpath provided by the requirer and make it available across all Kafka Connect workers. In case it encounters the sentinel valueNOT-REQUIRED, it should skip this step.Is expected to create an application
usernameandpasswordinside the Kafka Connect cluster after making sure the connector plugins are available on all workers.Is expected to put the credentials (
usernameandpassword) , which could be used on the Kafka Connect REST interface by the requirer, in a Juju Secret and expose the Juju Secrets URI through thesecret-userfield of the data bag.Is expected to provide the
endpointsfield with a comma-seperated list of Kafka Connect REST endpoints. Each value in this list also includes the protocol which could behttporhttps.If using HTTPS for REST endpoints, is expected to provide the CA chain in the
tls-cafield of a Juju Secret and share the TLS Juju Secret URI through thesecret-tlsfield of the databag.Is expected to delete an application
usernameandpasswordfrom the Kafka Connect cluster when the relation is removed.Is expected to cleanup all client plugin files when the relation is removed.
Requirer¶
Is expected to provide the
plugin-urlfield specifying the URL at which the connector plugin files are served as a single Tarball, or the sentinel valueNOT-REQUIREDin case it does not need a plugin.Is expected to provide
requested-secrets, which is a list of field names that are not to be exposed on the relation databag, but handled within Juju Secrets. It should be a JSON parsable array of strings, and correspond to valid Juju Secret keys (i.e. alphanumerical characters with a potential ‘-’ (dash) character). Secret fields must containusernameandpassword(andtls-cain case TLS is enabled).Is expected to manage its own connector/task(s) lifecycle by the means of Kafka Connect REST endpoints, using the data provided by the provider.
Relation Data¶
Provider¶
Provider provides credentials and REST endpoint uris. It should be placed in the application databag.
Example¶
relation-info:
- endpoint: connect_client
related-endpoint: connect_client
application-data:
endpoints: http://10.1.1.100:8083,http://10.1.1.101:8083,http://10.1.1.102:8083
secret-user: secret://59060ecc-0495-4a80-8006-5f1fc13fd783/cjqub6vubg2s77p3nio0
secret-tls: secret://59060ecc-0495-4a80-8006-5f1fc13fd783/cjqub7fubg2s77p3niog
Requirer¶
Requirer provides (and possibly serves) the plugin-url. It should be placed in the application databag.
Example¶
relation-info:
- endpoint: connect_client
related-endpoint: connect_client
application-data:
plugin-url: http://10.1.1.200:8080/route/to/plugin
requested-secrets: ["username", "password", "tls-ca"]