Skip to content

feat: Kafka agent - #1028

Open
labrenbe wants to merge 25 commits into
mainfrom
feat/kafka-agent
Open

labrenbe wants to merge 25 commits into
mainfrom
feat/kafka-agent

Conversation

@labrenbe

@labrenbe labrenbe commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Description

Part of stackabletech/issues#888.

Depends on decisions

Depends on PRs

Deploys an agent alongside Kafka clusters which is an independent controller that reconciles and manages internal resources like KafkaTopic.

This PR only adds an empty agent shell that doesn't do anything yet.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@labrenbe labrenbe changed the title feat: Kafka agent shell feat: Kafka agent Sep 25, 2026
@labrenbe labrenbe self-assigned this Sep 25, 2026
@labrenbe labrenbe moved this to Development: In Progress in Stackable Engineering Sep 25, 2026
Comment thread rust/operator-binary/src/controller/build/resource/agent.rs
Comment thread Cargo.toml Outdated

[workspace.dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.118.0", features = ["crds", "webhook"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", branch = "feat/platform-access", features = ["crds", "webhook"] }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: revert to a tag when ready.

Comment thread rust/operator-binary/src/crd/mod.rs Outdated
.with_labels(recommended_labels_for_agent_resources(cluster))
.build(),
)
.image_pull_secrets_from_product_image(&cluster.image)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming that the agent image can use the same credentials as the product image is fine as long as they come from the same registry. If they don't, there should be an optional field platformAccess.image.pullSecrets that allows the user to specify these independently; when unset, the agent falls back to spec.image.pullSecrets as it currently does.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently following the precedence of opa-operator. If that pull secret doesn't work then objectOverrides can still be used to override it. I think it's worth a discussion how much customization we want to allow for the agent without overrides.

Comment thread rust/operator-binary/src/main.rs Outdated
Comment thread rust/operator-binary/src/controller/build/resource/agent.rs Outdated
Comment thread rust/operator-binary/src/controller/build/resource/agent.rs
Comment thread extra/crds.yaml
)
.expect("the volume name is statically defined and must not collide");
container_builder
.add_volume_mount(&*DISCOVERY_VOLUME_NAME, DISCOVERY_DIR)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question if this is intended behavior: if the address in the discovery dir is an external one (external ListenerClass), is it intended that the agent connects from outside using that external path?

Comment thread rust/operator-binary/src/main.rs Outdated
agent_config: &ValidatedAgentConfig,
) -> Deployment {
let resource_names = cluster.agent_resource_names();
let mut cb_agent = new_container_builder(&AGENT_CONTAINER_NAME);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let mut cb_agent = new_container_builder(&AGENT_CONTAINER_NAME);
let mut container_builder = new_container_builder(&AGENT_CONTAINER_NAME);

So it's consistent with the pod_builder below

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is there might be multiple containers, but a single pod. I guess we would need container_builder_agent in this case, which is quite a mouthful ;)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still prefer it over cb_agent :D would also be in line with the code style guidelines

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container_builder_agent works for me ;)

@labrenbe
labrenbe marked this pull request as ready for review October 26, 2026 13:24
@labrenbe
labrenbe requested a review from a team October 26, 2026 13:24
Comment on lines +375 to +378
ensure!(
metadata_manager == crate::crd::MetadataManager::KRaft,
ManagementAccessRequiresKraftSnafu
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty arbitrary. Can we document / comment why?

@labrenbe labrenbe Oct 27, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to focus on KRaft for the first version of the admin client as supporting clusters with zookeeper would add extra complexity. I will document that this is a current limitation of the first version of the kafka-agent. Similarly we decided not to support Kerberos for version 1 in stackabletech/issues#888.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants