-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
56 lines (47 loc) · 1.33 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
49
50
51
52
53
54
55
56
# -----------------------------------------------
# Deploy Jenkins CI with Helm Chart
# -----------------------------------------------
locals {
namespace = var.namespace
jenkins = var.apps["jenkins"]
}
terraform {
# The modules used in this example have been updated with 0.12 syntax, which means the example is no longer
# compatible with any versions below 0.12.
required_version = ">= 0.12"
}
resource helm_release jenkins {
count = local.jenkins["deploy"]
namespace = local.namespace
repository = var.repository
name = local.jenkins["name"]
version = local.jenkins["version"]
chart = local.jenkins["chart"]
force_update = local.jenkins["force_update"]
wait = local.jenkins["wait"]
recreate_pods = local.jenkins["recreate_pods"]
values = local.jenkins["values"]
set_string {
name = "labels.kubernetes\\.io/name"
value = "${local.jenkins["name"]}"
}
set_string {
name = "service.labels.kubernetes\\.io/name"
value = "${local.jenkins["name"]}"
}
depends_on = [
"kubernetes_namespace.this",
]
}
resource kubernetes_namespace this {
metadata {
name = var.namespace
labels = {
name = var.namespace
description = "continuous-integration-and-delivery"
}
}
}
output path {
value = path.module
}