Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
578d2c7
Add agent-binary as workspace member
labrenbe Sep 24, 2026
2a1fae0
deploy the agent if spec.platformAcces.enabled is configured
labrenbe Sep 24, 2026
f15777c
add agent image and cluster role to Helm chart
labrenbe Sep 24, 2026
ed51b0e
build a separate agent image
labrenbe Sep 24, 2026
f01e5ce
Merge remote-tracking branch 'origin/main' into feat/kafka-agent
labrenbe Sep 24, 2026
9507079
run ghs build for matrix of operator and agent
labrenbe Sep 24, 2026
177cfb1
move staged framework code to operator-rs
labrenbe Oct 1, 2026
7f6d5a1
fix issues identified by Claude
labrenbe Oct 2, 2026
e5f431b
add support for anonymous access via operator-rs
labrenbe Oct 6, 2026
18a4ff2
use versioned for platform access CRD fragments
labrenbe Oct 13, 2026
c26dc42
add kafka admin client managing topics, topic config and partition count
labrenbe Oct 16, 2026
c65a16c
add shared crate with shared constants and client security enum
labrenbe Oct 13, 2026
41db2c7
add KafkaTopic CRD
labrenbe Oct 13, 2026
fe5203f
add necessary envs and volumes to agent pod
labrenbe Oct 14, 2026
9ba595d
reject zookeeper-mode when platformAccess is configured
labrenbe Oct 16, 2026
2c730ca
add config to agent: bootstrap servers from discovery cm, security mo…
labrenbe Oct 15, 2026
5463640
add stackable-kafka-adminto workspace dependencies
labrenbe Oct 16, 2026
87a5479
add support for list_partition_reassignments
labrenbe Oct 16, 2026
6a8e1b9
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 16, 2026
798619e
replace kafka_error with semantic error checks in the kafka admin client
labrenbe Oct 16, 2026
e7d4248
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 16, 2026
d0a7abb
remove is retryable checks for kafka errors
labrenbe Oct 16, 2026
c02eeb5
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 16, 2026
95581f0
simplify kafka error handling
labrenbe Oct 16, 2026
559fb04
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 16, 2026
69ed88e
add a flag for topic already exists errors
labrenbe Oct 20, 2026
248c918
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 20, 2026
e61fcdb
add kafka controller
labrenbe Oct 21, 2026
773d3bd
use the recreate strategy for the agent deployment
labrenbe Oct 21, 2026
679a24a
ship agent binary in operator image
labrenbe Oct 21, 2026
0a9ce61
Merge remote-tracking branch 'origin/main' into feat/kafka-agent
labrenbe Oct 21, 2026
85716c9
cleanup & only watch deployments with agent labels
labrenbe Oct 21, 2026
8241cb3
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 21, 2026
58e3393
use BrokerAddress in more places and remove awaiting_response
labrenbe Oct 21, 2026
198e800
fix flaky unit test
labrenbe Oct 21, 2026
ccf2fff
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 21, 2026
81a49a1
wip: add kuttl tests
labrenbe Oct 23, 2026
668119f
return the created topic and all configs with their source from the k…
labrenbe Oct 23, 2026
146602d
set fsGroup on the agent pod so it can read secret-operator volumes
labrenbe Oct 23, 2026
dec1799
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 23, 2026
60f0123
align CRD and validation with operator-rs and decision outcome
labrenbe Oct 23, 2026
1d68476
configure the agent's connection to Kafka via a shared contract crate
labrenbe Oct 23, 2026
75eb776
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 23, 2026
ce1c926
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 23, 2026
87a290e
use AgentResourceNames from operator-rs
labrenbe Oct 26, 2026
b95fb0a
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 26, 2026
469caf2
Merge branch 'main' into feat/kafka-agent
labrenbe Oct 26, 2026
bdc7e9f
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 26, 2026
f094a23
update the CRD to reflect operator-rs changes and the CRD decision
labrenbe Oct 26, 2026
d028aa2
rewrite the topic agent for the new KafkaTopic CRD
labrenbe Oct 26, 2026
61b1005
update operator-rs
labrenbe Oct 27, 2026
e0e76ed
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 27, 2026
bed3c7f
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 27, 2026
66bf00b
replace hard-coded selectors on agent deployment with util from opera…
labrenbe Oct 27, 2026
51e863a
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 27, 2026
4994c9f
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 27, 2026
624bebd
add topic_controller to operator for cleaning up after agents
labrenbe Oct 27, 2026
14f9ee8
use headless service to connect to bootstrap servers
labrenbe Oct 27, 2026
cbde956
rename cb_agent to container_builder_agent
labrenbe Oct 27, 2026
e5e54fd
add deref tests for new constants
labrenbe Oct 27, 2026
9549489
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 27, 2026
6ae37ee
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 27, 2026
ac90b9f
read bootstrap servers from KAFKA_BOOTSTRAP_SERVERS in the agent and …
labrenbe Oct 27, 2026
3fb16de
skip planning while the KafkaTopic reconciliation is paused
labrenbe Oct 27, 2026
b3e247d
watch only the KafkaTopics of the agent's cluster via a field selector
labrenbe Oct 27, 2026
6b93004
reject topic names starting with __ (internal topics)
labrenbe Oct 27, 2026
57b853b
fix topic name immutability validation
labrenbe Oct 27, 2026
42d02bf
regenerate-nix
labrenbe Oct 27, 2026
e7d2299
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 27, 2026
150886f
return only topic-level config and no source
labrenbe Oct 27, 2026
56b9894
document source of magic kafka numbers
labrenbe Oct 27, 2026
1aee2b0
use ApiKey enum
labrenbe Oct 27, 2026
5941693
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 27, 2026
41f8b37
change controller and CRD to use status.config without source
labrenbe Oct 28, 2026
f1946f7
add grace period before operator takes over topic status
labrenbe Oct 28, 2026
8b8934c
add docs and changelog entry
labrenbe Oct 28, 2026
bdda9d0
bump operator-rs
labrenbe Oct 28, 2026
b435ce4
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 28, 2026
2e92a9e
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 28, 2026
3fab703
regenerate nix
labrenbe Oct 28, 2026
0c7956b
test correct namespace deletion
labrenbe Oct 28, 2026
0d1d0ac
add OPA to management access test
labrenbe Oct 28, 2026
a89b5db
regenerate nix
labrenbe Oct 28, 2026
2f23562
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 28, 2026
e780967
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 28, 2026
43657d4
regenerate nix
labrenbe Oct 28, 2026
cb10888
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 28, 2026
7da2ba8
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 28, 2026
f539947
remove OPA from docs and test
labrenbe Oct 28, 2026
0f39003
write status if failing during finalizer reconciliation
labrenbe Oct 28, 2026
d4cb53a
improve docs on deletion
labrenbe Oct 28, 2026
c0f9338
report a stopped Kafka cluster as unavailable
labrenbe Oct 28, 2026
08c6a41
derive the topic configs from the applied changes
labrenbe Oct 28, 2026
b5be3c1
add pull secret to docs
labrenbe Oct 28, 2026
77eb95a
remove the unreachable throttle filter from the planned config changes
labrenbe Oct 28, 2026
af91710
clarify the test-support feature of the shared crate
labrenbe Oct 28, 2026
45b8a8c
document that the admin client serializes the Kafka requests
labrenbe Oct 28, 2026
a326d59
retry broken connection requests immediatly with a new connection
labrenbe Oct 28, 2026
2229bec
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 28, 2026
f579456
update operator-rs
labrenbe Oct 29, 2026
048ff91
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 29, 2026
28efc85
improve broker address Display impl
labrenbe Oct 29, 2026
82f8950
build the tls config once instead of per-server
labrenbe Oct 29, 2026
1937b53
keep the connection if only the version check fails
labrenbe Oct 29, 2026
b00fe65
rename helpers and doc comments to be more descriptive
labrenbe Oct 29, 2026
c4422a6
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 30, 2026
c475bdb
trim kuttl tests
labrenbe Oct 30, 2026
45d37f3
add keep environment util to topic test
labrenbe Oct 30, 2026
8b7c86d
Merge remote-tracking branch 'origin/main' into feat/kafka-agent
labrenbe Oct 30, 2026
8ec0341
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Oct 30, 2026
bdf8353
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Oct 30, 2026
78c0344
Merge remote-tracking branch 'origin/main' into feat/kafka-agent
labrenbe Nov 3, 2026
cc89f97
use stackable-operator 0.122.0
labrenbe Nov 3, 2026
f14c358
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Nov 3, 2026
a28ec57
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Nov 3, 2026
efb02c4
add readiness and liveness probes
labrenbe Nov 3, 2026
6735148
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Nov 3, 2026
b4111e0
fix Cargo.toml
labrenbe Nov 3, 2026
c2272bd
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Nov 3, 2026
aab52d9
regenerate nix
labrenbe Nov 4, 2026
d5eeca9
Try every address of a bootstrap server when connecting
labrenbe Nov 4, 2026
187fe58
Skip connecting for 30 s after all bootstrap servers failed
labrenbe Nov 4, 2026
67d52a5
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Nov 4, 2026
b9b1582
Compare declared topic names without parsing them in the store scans
labrenbe Nov 5, 2026
de63aa7
Reconcile one KafkaTopic at a time in the agent
labrenbe Nov 5, 2026
4dd7893
Leave KafkaTopics to a running agent whatever the cluster state
labrenbe Nov 5, 2026
4ae14d9
Report the agent not ready while it cannot list its KafkaTopics
labrenbe Nov 5, 2026
d6513af
Reconcile at most four KafkaTopics at a time in the operator
labrenbe Nov 5, 2026
08facc7
Limit configOverrides to 64 entries with values of up to 1024 characters
labrenbe Nov 5, 2026
616e4e6
Document that a topic is retained when its owner and successor are bo…
labrenbe Nov 5, 2026
153a4f1
Name the length limit when metadata.name is not a valid topic name
labrenbe Nov 5, 2026
132bde5
Merge remote-tracking branch 'origin/main' into feat/kafka-agent
labrenbe Nov 5, 2026
53c0e8a
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Nov 5, 2026
bcca0a6
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Nov 5, 2026
d4046de
Document the topic count the default resources are sized for
labrenbe Nov 5, 2026
f8fe3c8
Start the connect cooldown only after a slow failure
labrenbe Nov 5, 2026
4994153
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Nov 5, 2026
e60b478
update serde-saphyr to 2.1.1. 2.1.0 was yanked
labrenbe Nov 6, 2026
0bb764a
Merge branch 'feat/kafka-agent' into feat/kafka-admin
labrenbe Nov 6, 2026
55fa30b
Merge branch 'feat/kafka-admin' into feat/kafka-topic
labrenbe Nov 6, 2026
d7355f8
Merge remote-tracking branch 'origin/main' into feat/kafka-topic
labrenbe Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ All notable changes to this project will be documented in this file.
- Support for Kafka 4.3.1 ([#1022]).
- Add `/ready` endpoint to the operator Deployment, which reports the CRD installation status ([#1029]).
- Brokers now have a default affinity to the OPA Pods when OPA authorization is configured ([#1035]).
- Add management access via `spec.clusterConfig.managementAccess`. When enabled, the operator
deploys an agent per KafkaCluster, which authenticates anonymously or with a TLS client
certificate ([#1028]).
- Add the KafkaTopic CRD to manage topics declaratively. The agent creates and adopts topics,
replaces their configs with `configOverrides`, increases their partitions and optionally deletes
them. The operator removes the finalizers of KafkaTopics whose KafkaCluster is deleted ([#1050]).
- The OPA authorizer is now also configured on KRaft controllers. Previously, requests that brokers
forward to the controllers (e.g. creating or deleting topics) were not authorized at all.
The Kafka nodes are now configured as super users, so that traffic between them does not hit OPA.
Expand Down Expand Up @@ -57,6 +63,9 @@ All notable changes to this project will be documented in this file.
- Support Vector 0.58.0 ([#1039], [#1044], [#1046]).
- test: Update OPA to 1.20.2 in integration tests and docs example ([#1042]).
- The operator Deployment runs with a restricted security context and a read-only root filesystem, so it can be deployed into namespaces that enforce the `restricted` Pod Security Standard ([#1049]).
- The `/ready` endpoint of the operator now also waits for the KafkaTopic CRD. If the CRDs are not
maintained by the operator (`maintenance.customResourceDefinitions.maintain: false`), install the
KafkaTopic CRD together with the KafkaCluster CRD ([#1050]).

### Fixed

Expand Down Expand Up @@ -93,6 +102,7 @@ All notable changes to this project will be documented in this file.
[#1021]: https://github.com/stackabletech/kafka-operator/pull/1021
[#1022]: https://github.com/stackabletech/kafka-operator/pull/1022
[#1024]: https://github.com/stackabletech/kafka-operator/pull/1024
[#1028]: https://github.com/stackabletech/kafka-operator/pull/1028
[#1029]: https://github.com/stackabletech/kafka-operator/pull/1029
[#1034]: https://github.com/stackabletech/kafka-operator/pull/1034
[#1035]: https://github.com/stackabletech/kafka-operator/pull/1035
Expand All @@ -104,6 +114,7 @@ All notable changes to this project will be documented in this file.
[#1046]: https://github.com/stackabletech/kafka-operator/pull/1046
[#1047]: https://github.com/stackabletech/kafka-operator/pull/1047
[#1049]: https://github.com/stackabletech/kafka-operator/pull/1049
[#1050]: https://github.com/stackabletech/kafka-operator/pull/1050
[#1051]: https://github.com/stackabletech/kafka-operator/pull/1051
[#1052]: https://github.com/stackabletech/kafka-operator/pull/1052

Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 51 additions & 1 deletion Cargo.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repository = "https://github.com/stackabletech/kafka-operator"

[workspace.dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.122.0", features = ["agent", "crds", "webhook"] }
stackable-kafka-admin = { path = "rust/kafka-admin" }
stackable-kafka-shared = { path = "rust/shared" }

anyhow = "1.0"
Expand All @@ -23,6 +24,7 @@ const_format = "0.2"
futures = "0.3"
indoc = "2.0"
kafka-protocol = { version = "0.18", default-features = false, features = ["broker", "client"] }
regex = "1.13"
rstest = "0.28"
rustls = { version = "0.23", default-features = false, features = ["logging", "ring", "std", "tls12"] }
semver = "1.0"
Expand Down
5 changes: 5 additions & 0 deletions deploy/helm/kafka-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ annotations:
name: kafkaclusters.kafka.stackable.tech
displayName: KafkaCluster
description: A Kafka cluster stacklet. This resource is managed by the Stackable operator for Apache Kafka.
- kind: KafkaTopic
version: v1alpha1
name: kafkatopics.kafka.stackable.tech
displayName: KafkaTopic
description: A Kafka topic, created and updated by the agent of the referenced Kafka cluster.
24 changes: 24 additions & 0 deletions deploy/helm/kafka-operator/templates/clusterrole-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ metadata:
labels:
{{- include "kafka-operator.labels" . | nindent 4 }}
rules:
# KafkaTopics of the agent's cluster: watched, and their finalizer added and removed.
- apiGroups:
- {{ include "kafka-operator.name" . }}.stackable.tech
resources:
- kafkatopics
verbs:
- get
- list
- watch
- patch
- apiGroups:
- {{ include "kafka-operator.name" . }}.stackable.tech
resources:
- kafkatopics/status
verbs:
- patch
# Required to report reconciliation errors as events on the KafkaTopic objects.
- apiGroups:
- events.k8s.io
resources:
- events
verbs:
- create
- patch
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
# On OpenShift, the agent pod must be allowed to use the nonroot-v2 SCC
- apiGroups:
Expand Down
18 changes: 18 additions & 0 deletions deploy/helm/kafka-operator/templates/clusterrole-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ rules:
- {{ include "kafka-operator.name" . }}clusters/status
verbs:
- patch
# KafkaTopics: watched to take over while no agent is available, and their finalizer removed
# once the KafkaCluster is gone.
- apiGroups:
- {{ include "kafka-operator.name" . }}.stackable.tech
resources:
- kafkatopics
verbs:
- get
- list
- watch
- patch
# Status subresource: conditions set while the agent is unavailable.
- apiGroups:
- {{ include "kafka-operator.name" . }}.stackable.tech
resources:
- kafkatopics/status
verbs:
- patch
# Read authentication class configuration referenced in the KafkaCluster spec.
- apiGroups:
- authentication.stackable.tech
Expand Down
2 changes: 2 additions & 0 deletions docs/modules/kafka/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:github: https://github.com/stackabletech/kafka-operator/
:crd: {crd-ref}{crd-ref-release}&operator=kafka-operator
:crd-kafkacluster: {crd-ref}/kafka.stackable.tech/v1alpha1/kafkacluster{crd-ref-release}
:crd-kafkatopic: {crd-ref}/kafka.stackable.tech/v1alpha1/kafkatopic{crd-ref-release}
:feature-tracker: https://features.stackable.tech/unified
:metadata-quorum: https://cwiki.apache.org/confluence/display/KAFKA/KIP-500%3A+Replace+ZooKeeper+with+a+Self-Managed+Metadata+Quorum
:pegelonline: https://www.pegelonline.wsv.de/webservice/ueberblick
Expand Down Expand Up @@ -75,3 +76,4 @@ include::partial$supported-versions.adoc[]
* The {github}[kafka-operator {external-link-icon}^] GitHub repository
* The operator feature overview in the {feature-tracker}[feature tracker {external-link-icon}^]
* The {crd-kafkacluster}[KafkaCluster {external-link-icon}^] CRD documentation
* The {crd-kafkatopic}[KafkaTopic {external-link-icon}^] CRD documentation
132 changes: 132 additions & 0 deletions docs/modules/kafka/pages/usage-guide/management-access.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
= Management access
:description: Let the Stackable Operator for Apache Kafka manage resources inside a Kafka cluster, such as topics, through a per-cluster agent.

Management access allows the Stackable Data Platform (SDP) to manage resources inside an Apache Kafka cluster, such as xref:usage-guide/topics.adoc[topics].

== Agents

The agent is an optional Deployment next to the Kafka cluster that manages resources inside Kafka, such as topics.
The operator deploys it when management access is enabled.

The agent runs the image of the operator, pulled with the pull secrets of the Kafka image in `spec.image.pullSecrets`.
If the operator image is not public, these pull secrets must grant access to its registry as well, or the Deployment of the agent gets its own pull secrets with <<agent-resources,object overrides>>.

== Limitations

Management access is not available for all clusters:

* Clusters that use ZooKeeper are not supported, only clusters in xref:usage-guide/kraft-controller.adoc[KRaft mode].
* Clusters with Kerberos authentication are not supported.

== Configuration

Enable management access with `spec.clusterConfig.managementAccess` and choose how the agent authenticates to Kafka:

[source,yaml]
----
apiVersion: kafka.stackable.tech/v1alpha1
kind: KafkaCluster
metadata:
name: simple-kafka
spec:
image:
productVersion: 4.3.1
clusterConfig:
metadataManager: KRaft
tls:
serverSecretClass: tls
authentication:
- authenticationClass: kafka-client-tls
managementAccess:
enabled: true # <1>
authentication:
userProvided:
tls:
secretClassName: kafka-client-auth-secret # <2>
controllers:
roleGroups:
default:
replicas: 3
brokers:
roleGroups:
default:
replicas: 3
----
<1> Deploys the agent. Setting it to `false` removes the agent again.
<2> The SecretClass that provisions the client certificate of the agent, here the same SecretClass that the brokers use to verify client certificates, see xref:usage-guide/security.adoc[Security].

The agent supports the following authentication methods:

`anonymous: {}`:: The agent connects without a client certificate.
This is only possible if the cluster does not require client authentication.
`tls.secretClassName`:: A client certificate provisioned by the xref:secret-operator:index.adoc[Secret Operator] from the given SecretClass.
`tls.secretName`:: A static Secret holding the client certificate in the keys `tls.crt` and `tls.key` (PEM), for example a Secret of type `kubernetes.io/tls`.

The agent verifies the brokers with the CA of the SecretClass used by the client listener, that is `spec.clusterConfig.tls.serverSecretClass` or the `clientCertSecretClass` of the TLS AuthenticationClass.

== Authorization

The principal of the agent must be allowed to manage topics in Kafka.
The principal is derived from the subject of the client certificate.
The agent needs the following permissions:

[cols="2,3", options="header"]
|===
| Kafka API | Operation

| Metadata | `DESCRIBE` on the topic
| CreateTopics | `CREATE` on the cluster or the topic, and `DESCRIBE_CONFIGS` on the topic
| CreatePartitions | `ALTER` on the topic
| DescribeConfigs | `DESCRIBE_CONFIGS` on the topic
| IncrementalAlterConfigs | `ALTER_CONFIGS` on the topic
| DeleteTopics | `DELETE` on the topic
| ListPartitionReassignments | `DESCRIBE` on the cluster
|===

NOTE: Without `DESCRIBE_CONFIGS`, Kafka still creates a topic, but the agent cannot observe it.
The KafkaTopic then reports `KafkaRejected`.

== Network

The agent connects to the headless Services of the broker role groups, which resolve to the broker Pods.
The traffic of the agent therefore stays within the Kubernetes cluster, regardless of the xref:usage-guide/listenerclass.adoc[ListenerClasses] of the cluster.

[[agent-resources]]
== Agent resources

The operator creates the following resources for the agent, named after the KafkaCluster:

* A Deployment `<cluster>-agent` with a single replica, limited to 500m CPU and 128Mi memory by default.
* A ServiceAccount `<cluster>-agent`.
* A RoleBinding `<cluster>-agent`, which binds the ClusterRole `kafka-agent-clusterrole` deployed by the Helm chart.

The agent reports not ready while it cannot list the KafkaTopics of its cluster, and the operator then reports `AgentUnavailable` after a minute.

The Deployment can be adjusted with xref:concepts:overrides.adoc#object-overrides[object overrides], for example to change the resources of the agent:

[source,yaml]
----
spec:
objectOverrides:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-kafka-agent
spec:
template:
spec:
containers:
- name: agent
resources:
limits:
memory: 256Mi
----

The default resources of the agent are sufficient for a few thousand topics.
The operator keeps all KafkaTopics of all clusters it watches in memory and reconciles them whenever it starts, so with many thousands of topics, increase its CPU and memory in the Helm values of the operator.

== Disabling management access

Setting `enabled` to `false` or removing `managementAccess` removes the agent.
The KafkaTopics and the topics in Kafka stay as they are.
While no agent is available, the operator reports `AgentUnavailable` in the conditions of the KafkaTopics of the cluster, see xref:usage-guide/topics.adoc#deletion[Deletion] for the effect on deleted KafkaTopics.
Loading
Loading