mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
* Add support for missingkey=error in ApplicationSets Signed-off-by: Radon Rosborough <[email protected]> * options for cluster generator too Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Radon Rosborough <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
# This example demonstrates a git file generator which produces its items based on one or
|
|
# more files referenced in a git repo. The referenced files would contain a json/yaml list of
|
|
# arbitrary structured objects. Each item of the list would become a set of parameters to a
|
|
# generated application.
|
|
#
|
|
# Suppose the following git directory structure:
|
|
#
|
|
# cluster-deployments
|
|
# ├── apps
|
|
# │ └── guestbook
|
|
# │ ├── v1.0
|
|
# │ │ └── install.yaml
|
|
# │ └── v2.0
|
|
# │ └── install.yaml
|
|
# └── config
|
|
# └── clusters.json
|
|
#
|
|
# In this example, the `clusters.json` file is json list of structured data:
|
|
# [
|
|
# {
|
|
# "account": "123456",
|
|
# "asset_id": "11223344",
|
|
# "cluster": {
|
|
# "owner": "[email protected]",
|
|
# "name": "engineering-dev",
|
|
# "address": "http://1.2.3.4"
|
|
# },
|
|
# "appVersions": {
|
|
# "prometheus-operator": "v0.38",
|
|
# "guestbook": "v2.0"
|
|
# }
|
|
# },
|
|
# {
|
|
# "account": "456789",
|
|
# "asset_id": "55667788",
|
|
# "cluster": {
|
|
# "owner": "[email protected]",
|
|
# "name": "engineering-prod",
|
|
# "address": "http://2.4.6.8"
|
|
# },
|
|
# "appVersions": {
|
|
# "prometheus-operator": "v0.38",
|
|
# "guestbook": "v1.0"
|
|
# }
|
|
# }
|
|
# ]
|
|
#
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: ApplicationSet
|
|
metadata:
|
|
name: guestbook
|
|
spec:
|
|
goTemplate: true
|
|
goTemplateOptions: ["missingkey=error"]
|
|
generators:
|
|
- git:
|
|
repoURL: https://github.com/infra-team/cluster-deployments.git
|
|
files:
|
|
- path: config/clusters.json
|
|
template:
|
|
metadata:
|
|
name: '{{.cluster.name}}-guestbook'
|
|
spec:
|
|
source:
|
|
repoURL: https://github.com/infra-team/cluster-deployments.git
|
|
targetRevision: HEAD
|
|
path: apps/guestbook/{{.appVersions.guestbook}}
|
|
destination:
|
|
server: http://kubernetes.default.svc
|
|
namespace: guestbook
|