Skip to content

Commit

Permalink
chore: exporter with ops
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Oct 14, 2024
1 parent d9cb0ec commit 1eddbad
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions application_set.tf
Original file line number Diff line number Diff line change
Expand Up @@ -343,30 +343,27 @@ resource "argocd_application_set" "exporter" {
name = "exporter"
}
spec {
go_template = true
generator {
list {
elements = [
{
cluster = argocd_cluster.dev.name
url = argocd_cluster.dev.server
},
{
cluster = argocd_cluster.prod.name
url = argocd_cluster.prod.server
clusters {
selector {
match_labels = {
"argocd.argoproj.io/secret-type" = "cluster"
}
]
}
}
}
template {
metadata {
name = "exporter-{{cluster}}"
name = "exporter-{{.name}}"
labels = {
cluster = "{{cluster}}"
cluster = "{{.name}}"
env = "{{.metadata.labels.env}}"
}
}

spec {
project = argocd_project.guardian.metadata[0].name

source {
repo_url = "https://github.com/NaturalSelectionLabs/Cluster-Exporter"
target_revision = "HEAD"
Expand All @@ -379,15 +376,20 @@ resource "argocd_application_set" "exporter" {
}
env {
name = "AVP_SECRET"
value = "guardian:avp-{{cluster}}"
value = "guardian:{{.metadata.labels.secret}}"
}
}
}

destination {
server = "{{url}}"
name = "{{.name}}"
namespace = "guardian"
}

sync_policy {
sync_options = ["ServerSideApply=true"]
}

}
}

Expand Down

0 comments on commit 1eddbad

Please sign in to comment.