Skip to content
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

Configuration Management Plugins chaining #13088

Open
clementnuss opened this issue Apr 3, 2023 · 1 comment
Open

Configuration Management Plugins chaining #13088

clementnuss opened this issue Apr 3, 2023 · 1 comment
Labels
component:cmp Config Management Plugin related issues enhancement New feature or request

Comments

@clementnuss
Copy link

Summary

It should be possible to chain configuration management plugins (CMP).
That would allow for workflows where a plugin templates some fields in the source manifests (e.g. ytt or a simpler envsubst-like plugin), before another plugin (e.g. Helm or kustomize) does the rendering.

source repository -> CMP plugin #1 (modifier) -> ... -> CMP plugin #n (renderer) -> stdout

Motivation

This would permits more advanced use cases for CMP, and could also greatly increase adoption rate of CMP.
Indeed, it might well be that I want to template some fields of the values.yaml (e.g. to do a DNS lookup, or to concatenate some variables and text together), but that I also need to render the templated values.yaml with Helm.
Currently, no solution to this approach exist, except maybe for my argocd-cmp-ytt plugin where I manually template with ytt before rendering with Helm (from within the config management plugin itself).

Proposal

When defining the plugins in an application spec, we would need a way to specify the order in which to apply plugins.

Also and more importantly, we would need a way to transmit the templated files/repository to the next plugin in the chain, as currently CMP's only output is the rendered manifests.

there might then be plugins of two sorts: modifier plugins, which edit a repository and produce a tar archive, and rendering plugins, which end the chain and render the manifests to stdout

@clementnuss clementnuss added the enhancement New feature or request label Apr 3, 2023
@crenshaw-dev
Copy link
Member

Ideally I'd like to make this even more generic than chaining plugins: it would be nice to be able to chain arbitrary sources.

@gczuczy wrote a PR allowing sources to reference other sources' pre-rendered files as plain old directories. #12508

I think the next logical step would be to let sources reference other sources post-rendered contents as a manifests.yaml file.

Aside: I haven't tried it myself, but I understand argocd-lovely-plugin provides a mechanism for chaining plugins. https://github.com/crumbhole/argocd-lovely-plugin

@jgwest jgwest added the component:cmp Config Management Plugin related issues label Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:cmp Config Management Plugin related issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants