Skip to content

Commit 84d94c0

Browse files
authored
docs: Update plugin generator docs to include overview (argoproj#25292)
Signed-off-by: LogicalShark <maralder@google.com>
1 parent c1a28aa commit 84d94c0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/operator-manual/applicationset/Generators-Plugin.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
# Plugin Generator
22

3-
Plugins allow you to provide your own generator.
3+
The Plugin generator is a generator type which allows you to provide your own custom generator through a plugin. In contrast to other generators with predetermined logic (the [Cluster generator](Generators-Cluster.md) fetching clusters using a selector on ArgoCD secrets, [Git generator](Generators-Git.md) using a Git repository, etc.), a Plugin generator can use any custom code with input and output parameters.
44

55
- You can write in any language
66
- Simple: a plugin just responds to RPC HTTP requests.
77
- You can use it in a sidecar, or standalone deployment.
88
- You can get your plugin running today, no need to wait 3-5 months for review, approval, merge and an Argo software
99
release.
10-
- You can combine it with Matrix or Merge.
10+
- You can combine it with [Matrix generator](Generators-Matrix.md) or [Merge generator](Generators-Merge.md)
11+
12+
In general, the flow of an ApplicationSet with a Plugin generator is as follows:
13+
14+
- The ApplicationSet controller sends an HTTP POST to `baseUrl` every `requeueAfterSeconds`. The request includes `input.parameters` defined in the ApplicationSet.
15+
- Your custom plugin service receives the request, reads the input parameters and executes its custom logic to fetch any necessary data and construct a list of output parameter objects.
16+
- The plugin service returns the parameter list in a response to the ApplicationSet controller.
17+
- The ApplicationSet controller iterates through the parameter objects and uses each one to fill out the template (defined in the ApplicationSet object) to create an Application.
18+
- This allows for dynamic creation of Argo CD Applications based on custom user-created defined templates, parameters, and logic.
1119

1220
To start working on your own plugin, you can generate a new repository based on the example
1321
[applicationset-hello-plugin](https://github.com/argoproj-labs/applicationset-hello-plugin).
@@ -221,7 +229,7 @@ Some things to note here:
221229
- The input parameters are included in the request body and can be accessed using the `input.parameters` variable.
222230
- The output must always be a list of object maps nested under the `output.parameters` key in a map.
223231
- `generator.input.parameters` and `values` are reserved keys. If present in the plugin output, these keys will be overwritten by the
224-
contents of the `input.parameters` and `values` keys in the ApplicationSet's plugin generator spec.
232+
contents of the `input.parameters` and `values` keys in the ApplicationSet's Plugin generator spec.
225233

226234
## With matrix and pull request example
227235

@@ -285,7 +293,7 @@ To illustrate :
285293
286294
- The generator pullRequest would return, for example, 2 branches: `feature-branch-1` and `feature-branch-2`.
287295

288-
- The generator plugin would then perform 2 requests as follows :
296+
- The Plugin generator would then perform 2 requests as follows :
289297

290298
```shell
291299
curl http://localhost:4355/api/v1/getparams.execute -H "Authorization: Bearer strong-password" -d \

0 commit comments

Comments
 (0)