-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.tf
48 lines (46 loc) · 1.17 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
resource "local_file" "profiles" {
for_each = { for profile in var.profiles : profile.namespace => profile.email }
content = <<EOT
apiVersion: kubeflow.org/v1
kind: Profile
metadata:
name: ${each.key}
spec:
owner:
kind: User
name: ${each.value}
EOT
filename = "${path.root}/${var.argocd.path}/profiles/profile-${each.key}.yaml"
}
resource "local_file" "profile_application" {
content = yamlencode({
"apiVersion" = "argoproj.io/v1alpha1"
"kind" = "Application"
"metadata" = {
"name" = "profile"
"namespace" = var.argocd.namespace
}
"spec" = {
"destination" = {
"namespace" = "kubeflow"
"server" = "https://kubernetes.default.svc"
}
"project" = "default"
"source" = {
"repoURL" = var.argocd.repository
"targetRevision" = var.argocd.branch
"path" = "${var.argocd.full_path}/profiles"
}
"syncPolicy" = {
"syncOptions" = [
"CreateNamespace=false"
]
"automated" = {
"prune" = true
"selfHeal" = true
}
}
}
})
filename = "${path.root}/${var.argocd.path}/profile.yaml"
}