Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Tweak List and Git generator docs (#333)
Browse files Browse the repository at this point in the history
* Update generator docs
  • Loading branch information
jgwest authored Aug 9, 2021
1 parent 7f3b4e0 commit ac37636
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docs/Generators-Git.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ As with other generators, clusters *must* already be defined within Argo CD, in

### Exclude directories

The Git directory generator will automatically exclude folders that begin with `.` (such as `.git`).

The Git directory generator also supports an `exclude` option in order to exclude directories in the repository from being scanned by the ApplicationSet controller:

```yaml
Expand Down
64 changes: 41 additions & 23 deletions docs/Generators-List.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
# List Generator

The List generator generates parameters based on any list of key/value pairs as long as the values are string values. In this example, we're targeting a local cluster named `engineering-dev`:
The List generator generates parameters based on an arbitrary list of key/value pairs (as long as the values are string values). In this example, we're targeting a local cluster named `engineering-dev`:
```yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: guestbook
name: guestbook
spec:
generators:
- list:
elements:
- cluster: engineering-dev
url: https://kubernetes.default.svc
# - cluster: engineering-prod
# url: https://kubernetes.default.svc
# foo: bar
template:
metadata:
name: '{{cluster}}-guestbook'
spec:
project: default
source:
repoURL: https://github.com/argoproj-labs/applicationset.git
targetRevision: HEAD
path: examples/list-generator/guestbook/{{cluster}}
destination:
server: '{{url}}'
namespace: guestbook
generators:
- list:
elements:
- cluster: engineering-dev
url: https://kubernetes.default.svc
# - cluster: engineering-prod
# url: https://kubernetes.default.svc
# foo: bar
template:
metadata:
name: '{{cluster}}-guestbook'
spec:
project: default
source:
repoURL: https://github.com/argoproj-labs/applicationset.git
targetRevision: HEAD
path: examples/list-generator/guestbook/{{cluster}}
destination:
server: '{{url}}'
namespace: guestbook
```
(*The full example can be found [here](https://github.com/argoproj-labs/applicationset/tree/master/examples/list-generator).*)
The List generator passes the `url` and `cluster` fields as parameters into the template. In this example, if one wanted to add a second element, we could uncomment the second element and the ApplicationSet controller would automatically target it with the defined application.
In this example, the List generator passes the `url` and `cluster` fields as parameters into the template. If we wanted to add a second environment, we could uncomment the second element and the ApplicationSet controller would automatically target it with the defined application.

With the ApplicationSet v0.1.0 release, one could *only* specify `url` and `cluster` element fields (plus arbitrary `values`). As of ApplicationSet v0.2.0, any key/value `element` pair is supported (which is also fully backwards compatible with the v0.1.0 form):
```yaml
spec:
generators:
- list:
elements:
# v0.1.0 form - requires cluster/url keys:
- cluster: engineering-dev
url: https://kubernetes.default.svc
values:
additional: value
# v0.2.0+ form - does not require cluster/URL keys
# (but they are still supported).
- staging: "true"
gitRepo: https://kubernetes.default.svc
# (...)
```

!!! note "Clusters must be predefined in Argo CD"
These clusters *must* already be defined within Argo CD, in order to generate applications for these values. The ApplicationSet controller does not create clusters within Argo CD (for instance, it does not have the credentials to do so).
2 changes: 1 addition & 1 deletion docs/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ How it works:
- [Documentation for the `master`-branch-based developer builds](https://argocd-applicationset.readthedocs.io/en/master/) is available from Read the Docs.

!!! warning
Development builds contain newer features and bug fixes, but are more likely to be unstable, as compared to release drivers.
Development builds contain newer features and bug fixes, but are more likely to be unstable, as compared to release builds.

See the `master` branch [Read the Docs](https://argocd-applicationset.readthedocs.io/en/master/) page for documentation on post-release features.

Expand Down

0 comments on commit ac37636

Please sign in to comment.