Onboard a Developer to an LKC
Grant a developer access to a provisioned Logical Kafka Cluster
(LKC), share the connection details they need, and confirm that their
client connects and sees only this LKC’s resources. TenantAdmin
users perform Steps 1 and 2 of this procedure one time per
developer, after a platform operator has onboarded the LKC. The
developer performs Steps 3 and 4 to confirm their own access.
Prerequisites
Before you begin, ensure you have the following:
An active LKC and the
TenantAdminrole on it, assigned in Step 7 of Onboard an LKC to a Multi-Tenant Physical Kafka Cluster, and the connection details your platform operator shared in Step 8.A
KafkaRestClassin your namespace. Name itdefault, or reference it in the role binding manifest in Step 1.An existing principal (user or service account) for the developer in the shared identity provider (IdP) of the Physical Kafka Cluster (PKC), or an existing client certificate for mutual TLS (mTLS) authentication. If the developer doesn’t have one yet, coordinate with your platform operator or your organization’s IdP administrator.
At least one topic in the LKC for the developer to use. A platform operator, or a developer who already has
DeveloperManageon the LKC, creates it using a standard Kafka client, the same way you created a test topic in Step 5 of Onboard an LKC to a Multi-Tenant Physical Kafka Cluster.Optional: a second identity with no role binding on this LKC, if you want to confirm LKC isolation as described in Verify LKC isolation and quota enforcement.
Step 1: Grant the developer access through RBAC
Delegate access through role-based access control (RBAC) by creating a
ConfluentRolebinding custom resource (CR) scoped to this LKC,
using one of the standard roles. For the permissions each role grants,
see Use Predefined RBAC Roles in Confluent Platform.
Role |
Typical use |
|---|---|
|
A consumer application |
|
A producer application |
|
A developer who also creates or deletes their own topics |
A consumer needs DeveloperRead on both the topic and the consumer
group it uses, as shown in the following example manifest.
Create a manifest file named
developer-rolebinding.yaml:apiVersion: platform.confluent.io/v1beta1 kind: ConfluentRolebinding metadata: name: <developer-binding-name> namespace: <your-namespace> spec: principal: type: user name: <developer-identity> role: <role-name> kafkaClusterRef: kind: LogicalKafkaCluster name: <lkc-name> resourcePatterns: - resourceType: Topic name: <topic-name> patternType: LITERAL - resourceType: Group name: <consumer-group-name> patternType: LITERAL
Replace the placeholders with your values:
<developer-binding-name>: A name for theConfluentRolebindingCR.<your-namespace>: The namespace of the LKC’s CR.<developer-identity>: The developer’s existing identity in your shared IdP, or their service account. For an mTLS identity, use the principal derived from the certificate’s subject distinguished name (DN), based on your cluster’sssl.principal.mapping.rulesconfiguration.<role-name>:DeveloperRead,DeveloperWrite, orDeveloperManage, from the preceding table.<lkc-name>: The name of the LKC’s CR.<topic-name>: The topic to grant access to, using its LKC-local name, such asorders.<consumer-group-name>: The consumer group to grant access to. Include thisresourcePatternsentry only if the developer consumes from this topic.
Caution
Set
kafkaClusterRef.kindtoLogicalKafkaCluster, notKafka. A role binding scoped to the PKC’sKafkaCR grants the developer that same access to identically named resources in every LKC on the PKC, not only this one. Verify thekafkaClusterReffield before you apply the manifest.Apply the configuration:
kubectl apply -f developer-rolebinding.yaml
role accepts only one value per ConfluentRolebinding CR. If
the developer needs both produce and consume access, as in Step 4,
repeat this step once per role, creating a separate CR for
DeveloperWrite and another for DeveloperRead.
Step 2: Provide connection details to the developer
Share the following with the developer:
The LKC’s bootstrap URL, in the form
lkc-<id>-kafka.<domain>:<port>(the same endpoint returned in Step 5 of Onboard an LKC to a Multi-Tenant Physical Kafka Cluster):kubectl get logicalkafkacluster <lkc-name> -n <your-namespace> \ -o jsonpath='{.status.bootstrapEndpoint}'
The authentication mechanism configured on the PKC, such as Simple Authentication and Security Layer (SASL) mechanisms
SASL/PLAINandSASL/OAUTHBEARER, or mTLS, and the client configuration it requires. For more information, see Authentication in Confluent Platform and Step 3.The PKC’s TLS certificate authority (CA) certificate or truststore, so the developer’s client can validate the broker’s TLS certificate. For an mTLS identity, also share how the developer obtains their own client certificate and private key.
The topics, consumer groups, and operations you granted in Step 1.
The LKC’s quota and limit boundaries, so the developer can size their application. For more information, see Monitor and Manage Per-LKC Resource Quotas.
The Confluent Control Center URL, so that the developer can monitor their own application’s activity.
Step 3: Connect a standard Kafka client
Connect a standard Kafka client to the LKC. A multi-tenant PKC has two connection requirements:
Use the LKC’s own bootstrap URL, not the PKC’s bootstrap URL or a broker’s IP address.
Connect over TLS, using
SSLorSASL_SSL. The LKC doesn’t acceptPLAINTEXTorSASL_PLAINTEXTconnections.
Apart from your PKC’s usual TLS and authentication settings, your client doesn’t need any LKC-specific configuration.
Note
If your application uses a non-Java client, such as one built on librdkafka, confirm that it sends the LKC’s bootstrap hostname as the TLS Server Name Indication (SNI).
If your organization hasn’t set up DNS for per-LKC hostnames yet, see the routing approach you chose in the Multi-Tenancy Overview page for how clients resolve an LKC’s bootstrap URL.
Step 4: Produce and consume a test message
Using the connection details from Step 2, list topics with a standard Kafka Admin API client or command-line tool. Confirm that the list contains only the topics that you have access to in this LKC, using their LKC-local names, such as
orders. None of another LKC’s topics should appear.Produce a test message to a topic that you have
DeveloperWriteon. Forkafka-console-producerusage, see Use the command-line tools.Consume that message from the topic, using a consumer group that you have
DeveloperReadon. Forkafka-console-consumerusage, see the same command-line tools page.
Verify LKC isolation and quota enforcement
Confirm that a client with no role binding on this LKC can authenticate, but that
listTopics()returns an empty set, and that a produce or consume attempt fails with an authorization error rather than a connection failure.If the client exceeds the LKC’s configured quota, confirm that the broker throttles it instead of returning an error. The client’s throttle metrics become nonzero and its throughput levels off. For a producer, check
produce-throttle-time-avgandproduce-throttle-time-max. For a consumer, checkfetch-throttle-time-avgandfetch-throttle-time-max. For more information about how the broker enforces quotas, see Monitor and Manage Per-LKC Resource Quotas.
Troubleshooting
RBAC scope is too broad or too narrow
Too broad: If a developer can access resources in an LKC that they shouldn’t, check their
ConfluentRolebindingresources for one whosekafkaClusterRef.kindisKafkainstead ofLogicalKafkaCluster. Delete it and create a replacement scoped to the correct LKC, as described in the caution in Step 1.Too narrow, or no role binding at all: For the expected behavior of a client with no matching role binding on this LKC, see Verify LKC isolation and quota enforcement. If every produce attempt fails with
ClusterAuthorizationExceptionspecifically, notTopicAuthorizationException, the developer likely doesn’t haveDeveloperWriteon any topic in the LKC.Role binding doesn’t seem to take effect: Confirm that the LKC has finished provisioning.
Connection and authentication errors
The PKC rejects a client that connects to its own bootstrap URL,
connects to a broker’s IP address directly, or connects over
PLAINTEXT or SASL_PLAINTEXT. For more information, see
Step 3.
A client that uses a malformed or unrecognized LKC ID in its bootstrap hostname, or the ID of a deactivated LKC, can’t connect. Confirm that the bootstrap URL you shared in Step 2 exactly matches the value your platform operator retrieved when they verified the LKC, in Step 5 of Onboard an LKC to a Multi-Tenant Physical Kafka Cluster.