feat: add named component templates for pipeline sources, transforms, and sinks#223
feat: add named component templates for pipeline sources, transforms, and sinks#223sakateka wants to merge 1 commit into
Conversation
|
Hi @sakateka! |
Fair question. The motivation originally came from the fact that each of our users has their own chart and has to define a VectorPipeline themselves. Since the VectorPipeline resource is quite large, this led to a lot of duplication across application charts. However, I now realize that this does not prevent us from solving the problem through templating at the Helm chart level, for example by using a chart dependency that provides the shared VectorPipeline template. At this point, I think that approach is the right one, so I’m leaning toward dropping this PR. Thanks for pointing me in that direction! |
Hi! Thanks for the great project - we use it actively. As the number of pipelines grows, managing configs becomes painful: changing a shared default (e.g. a sink) means editing every pipeline.
I explored a templating approach - not sure it’s the best possible design, but I don’t see a cleaner option yet. Would love your feedback.
Proposal: named component templates on the Vector CR
Platform admins define reusable component bodies once on
Vector/VectorAggregatorviaspec.agent.componentTemplates(also available on aggregators throughVectorCommon):sources,transforms,sinks- maps of template name -> Gotext/templatebodyPipelines reference a template explicitly:
sourceTemplate/transformTemplate/sinkTemplate:{ name, params }{{ .paramName }}with strict policy missing key => errortype: …) or templated - both together is rejectedinputsfrom the pipeline override whatever the template renderedExample - platform defines the sink once (batching, headers, encoding):
Each pipeline only passes what actually differs:
Change batch size, TLS, headers, or compression once on the Vector CR - all pipelines pick it up on the next reconcile. Pipelines without template refs behave unchanged.
Applied during config build for both agent and aggregator paths.
I haven’t used this code in production or on a test/staging environment yet.