-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add support for including sidecar containers with Kafka and zookeeper pods #12121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This abstracts sidecar container creation into reusable components, introducing SidecarContainer and SidecarProbe classes to standardize sidecar configuration across Kafka components. Updates CRD definitions and documentation to reflect the new abstraction.
Signed-off-by: dinesh-murugiah <[email protected]>
scholzj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. However, as I explained in the duplicate issue you opened, this requires a proper proposal to be opened, discussed, and approved: https://github.com/strimzi/proposals. This PR also seems ot be pretty limited in terms of what is needed for a fully functional sidecars as you would likely need to be able to modify port exposured, share volumes, etc.
|
@scholzj thanks for the suggestion and feedback i have sent a proposal for review regarding:
this PR does allow exposing network ports , and there is no limitation in sharing volumes between containers of the pod |
I do not think it allows the remapping of the ports to allow integration of things such as proxies etc. In any case, if it does, please describe it in the proposal. |
|
Triaged on 27.11.2025: we should discuss the proposal first and if it makes sense to have this addition within Strimzi operator and how. So @dinesh-murugiah we'll close this PR for now, so that based on the outcome from the proposal a new one maybe will be opened. |
Type of change
Enhancement / new feature
Description
Proposal: Sidecar Container Support for Strimzi Kafka Operator
Overview
This proposal introduces native support for sidecar containers in Strimzi Kafka clusters, allowing users to deploy additional containers alongside Kafka, for monitoring, logging, security, and other operational purposes. This can also be extended to support sidecar addition for Zookeeper, and other Strimzi-managed components
Problem Statement
Currently, users who need to run sidecar containers (monitoring agents, log forwarders, security scanners, etc.) alongside Kafka components must:
Manually modify generated Pod specifications after deployment
Use external tools like admission controllers or mutating webhooks
Create custom operators or controllers
Fork and modify Strimzi code
These approaches are fragile, complex, and break the declarative nature of Kubernetes resource management.
Solution
Introduce first-class sidecar container support through the Strimzi CRD API, enabling users to:
Declaratively define sidecar containers in their Kafka/KafkaConnect/etc. specifications
Leverage Strimzi's existing container management, security, and lifecycle features
Maintain compatibility with GitOps workflows and Kubernetes-native tooling
Use Cases
Monitoring: Prometheus exporters, APM agents, custom metrics collectors
Logging: Log forwarding agents (Fluent Bit, Filebeat), log processors
Security: Vulnerability scanners, compliance agents, secret managers
Networking: Service mesh sidecars, network policy agents, traffic analyzers
Data Processing: Stream processors, data transformation agents
2. Thought Process and Justification for Model Classes
Design Philosophy
We follow Strimzi's established pattern of providing user-friendly APIs that get converted to Kubernetes-native resources. This requires two distinct model layers:
2.1 Strimzi API Models (SidecarContainer, SidecarProbe)
Purpose: User-facing API optimized for declarative configuration
Key Design Decisions:
public class SidecarContainer {
// User-friendly string-based image pull policy
private String imagePullPolicy; // "Always", "IfNotPresent", "Never"
}
public class SidecarProbe {
// String ports for user simplicity
private String httpGetPort; // "8080" or "http-port"
private String tcpSocketPort; // "9090" or "metrics"
}
This proposal provides a comprehensive, production-ready sidecar container solution that maintains Strimzi's high standards for usability, reliability, and Kubernetes integration.
Checklist
Please go through this checklist and make sure all applicable tasks have been done