-
Notifications
You must be signed in to change notification settings - Fork 4
/
argocd-config-maps.tf
90 lines (85 loc) · 3.23 KB
/
argocd-config-maps.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
resource "kubernetes_config_map" "argocd_redis_ha_configmap" {
metadata {
name = "argocd-redis-ha-configmap"
namespace = kubernetes_namespace.argocd_namespace.metadata.0.name
labels = merge({
"app.kubernetes.io/name" : "argocd-redis-ha"
"app.kubernetes.io/component" : "redis"
"app.kubernetes.io/part-of" : "argocd"
}, var.labels)
}
data = {
"haproxy.cfg" = templatefile("${path.module}/configuration-files/haproxy.cfg", {})
"haproxy_init.sh" = templatefile("${path.module}/configuration-files/haproxy_init.sh", {})
"init.sh" = templatefile("${path.module}/configuration-files/init.sh", {})
"redis.conf" = templatefile("${path.module}/configuration-files/redis.conf", {})
"sentinel.conf" = templatefile("${path.module}/configuration-files/sentinel.conf", {})
}
}
resource "kubernetes_config_map" "argocd_cm" {
metadata {
name = "argocd-cm"
namespace = kubernetes_namespace.argocd_namespace.metadata.0.name
labels = merge({
"app.kubernetes.io/name" : "argocd-cm"
"app.kubernetes.io/part-of" : "argocd"
}, var.labels)
}
data = {
url = "https://${var.ingress_host}${var.ingress_path}"
"oidc.config" = var.oidc_config != null ? yamlencode(local.oidc_config) : null
"repositories" = yamlencode(var.argocd_repositories),
"repository.credentials" = yamlencode(var.argocd_repository_credentials)
"resource.customizations" = templatefile("${path.module}/configuration-files/resource-customizations.yml", {})
}
}
resource "kubernetes_config_map" "argocd_gpg_keys_cm" {
metadata {
name = "argocd-gpg-keys-cm"
namespace = kubernetes_namespace.argocd_namespace.metadata.0.name
labels = merge({
"app.kubernetes.io/name" : "argocd-gpg-keys-cm"
"app.kubernetes.io/part-of" : "argocd"
}, var.labels)
}
}
resource "kubernetes_config_map" "argocd_rbac_cm" {
metadata {
name = "argocd-rbac-cm"
namespace = kubernetes_namespace.argocd_namespace.metadata.0.name
labels = merge({
"app.kubernetes.io/name" : "argocd-rbac-cm"
"app.kubernetes.io/part-of" : "argocd"
}, var.labels)
}
data = {
"policy.csv" = templatefile("${path.module}/configuration-files/policy.csv", {})
#"policy.default" = "role:readonly"
# essential to get argo to use groups for RBAC:
"scopes" = var.oidc_group_claim == null ? "[email]" : "[${var.oidc_group_claim}, email]"
}
}
resource "kubernetes_config_map" "argocd_ssh_known_hosts_cm" {
metadata {
name = "argocd-ssh-known-hosts-cm"
namespace = kubernetes_namespace.argocd_namespace.metadata.0.name
labels = merge({
"app.kubernetes.io/name" : "argocd-ssh-known-hosts-cm"
"app.kubernetes.io/part-of" : "argocd"
}, var.labels)
}
data = {
ssh_known_hosts = templatefile("${path.module}/configuration-files/ssh_known_hosts", {})
}
}
resource "kubernetes_config_map" "argocd_tls_certs_cm" {
metadata {
name = "argocd-tls-certs-cm"
namespace = kubernetes_namespace.argocd_namespace.metadata.0.name
labels = merge({
"app.kubernetes.io/name" : "argocd-tls-certs-cm"
"app.kubernetes.io/part-of" : "argocd"
}, var.labels)
}
data = null
}