-
Notifications
You must be signed in to change notification settings - Fork 44
/
helm_argocd.tf
143 lines (116 loc) · 2.65 KB
/
helm_argocd.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
resource "helm_release" "argocd" {
count = var.enable_argocd ? 1 : 0
name = "argocd"
namespace = "argocd"
create_namespace = true
repository = "https://argoproj.github.io/argo-helm"
chart = "argo-cd"
set {
name = "server.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"
value = aws_iam_role.argocd[count.index].arn
}
set {
name = "controller.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"
value = aws_iam_role.argocd[count.index].arn
}
set {
name = "server.service.type"
value = "NodePort"
}
set {
name = "server.service.nodePortHttp"
value = "31080"
}
set {
name = "server.service.nodePortHttps"
value = "31443"
}
set {
name = "server.extraArgs[0]"
value = "--insecure"
}
set {
name = "server.extensions.enabled"
value = "true"
}
set {
name = "server.enable.proxy.extension"
value = "true"
}
set {
name = "server.extensions.image.repository"
value = "quay.io/argoprojlabs/argocd-extension-installer"
}
set {
name = "server.extensions.extensionList[0].name"
value = "rollout-extension"
}
set {
name = "server.extensions.extensionList[0].env[0].name"
value = "EXTENSION_URL"
}
set {
name = "server.extensions.extensionList[0].env[0].value"
value = "https://github.com/argoproj-labs/rollout-extension/releases/download/v0.3.6/extension.tar"
}
}
resource "kubectl_manifest" "argo_gateway" {
count = var.enable_argocd ? 1 : 0
yaml_body = <<YAML
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: argocd-gateway
namespace: argocd
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- ${var.argocd_virtual_service_host}
YAML
depends_on = [
aws_eks_cluster.main,
aws_eks_node_group.main,
kubernetes_config_map.aws-auth,
helm_release.argocd,
helm_release.istio_base,
helm_release.istiod
]
}
resource "kubectl_manifest" "argocd_virtual_service" {
count = var.enable_argocd ? 1 : 0
yaml_body = <<YAML
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: argo-server
namespace: argocd
spec:
hosts:
- ${var.argocd_virtual_service_host}
gateways:
- argocd-gateway
http:
- match:
- uri:
prefix: /
route:
- destination:
host: argocd-server
port:
number: 80
YAML
depends_on = [
aws_eks_cluster.main,
aws_eks_node_group.main,
kubernetes_config_map.aws-auth,
helm_release.argocd,
helm_release.istio_base,
helm_release.istiod
]
}