-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
105 lines (82 loc) · 2.22 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
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
terraform {
required_providers {
vagrant = {
source = "bmatcuk/vagrant"
version = "~> 4.1.0"
}
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.7.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.4.1"
}
external = {
source = "hashicorp/external"
version = ">= 2.2.0"
}
tls = {
source = "hashicorp/tls"
version = ">= 4.0.4"
}
}
}
provider "kubectl" {
load_config_file = true
}
provider "helm" {
debug = true
kubernetes {
config_path = "~/.kube/config"
}
}
module "packer-vmis" {
source = "./packer-vmis"
distribution_name = var.distribution_name
virtual_machine_image = var.virtual_machine_image
virtual_machine_image_sha = var.virtual_machine_image_sha
private_key_path = var.private_key_path
}
module "kubernetes-cluster" {
source = "./kubernetes-cluster"
virtual_machine_image = var.virtual_machine_image
private_key_path = var.private_key_path
ip_base = var.ip_base
cluster_name = var.cluster_name
master_count = var.master_count
master_cpus = var.master_cpus
master_memory = var.master_memory
worker_count = var.worker_count
worker_cpus = var.worker_cpus
worker_memory = var.worker_memory
depends_on = [module.packer-vmis]
}
resource "time_sleep" "wait-for-pods-to-initialize" {
depends_on = [module.kubernetes-cluster]
create_duration = "2m"
}
module "prometheus-stack" {
source = "./prometheus-stack"
depends_on = [module.kubernetes-cluster, time_sleep.wait-for-pods-to-initialize]
}
module "linkerd" {
source = "./linkerd-configuration"
depends_on = [module.prometheus-stack]
}
module "metallb" {
source = "./metallb-configuration"
depends_on = [module.linkerd]
}
module "kubernetes-dashboard" {
source = "./kubernetes-dashboard"
depends_on = [module.metallb]
}
module "argocd" {
source = "./argocd"
depends_on = [module.metallb]
}
module "post-provisioning" {
source = "./post-provisioning"
depends_on = [module.argocd, module.kubernetes-dashboard, module.metallb, module.linkerd, module.prometheus-stack]
}