a8a1bb9315bbb878bde20d2c3111581b14758d2d
[csit.git] / fdio.infra.terraform / 1n_nmd / main.tf
1 # For convenience in simple configurations, a child module automatically
2 # inherits default (un-aliased) provider configurations from its parent.
3 # This means that explicit provider blocks appear only in the root module,
4 # and downstream modules can simply declare resources for that provider
5 # and have them automatically associated with the root provider
6 # configurations.
7 module "alertmanager" {
8   source = "./alertmanager"
9   providers = {
10     nomad = nomad.yul1
11   }
12
13   # nomad
14   nomad_datacenters = ["yul1"]
15
16   # alertmanager
17   alertmanager_job_name    = "prod-alertmanager"
18   alertmanager_use_canary  = true
19   alertmanager_group_count = 1
20   alertmanager_vault_secret = {
21     use_vault_provider        = false,
22     vault_kv_policy_name      = "kv-secret",
23     vault_kv_path             = "secret/data/prometheus",
24     vault_kv_field_access_key = "access_key",
25     vault_kv_field_secret_key = "secret_key"
26   }
27   alertmanager_version               = "0.21.0"
28   alertmanager_cpu                   = 1000
29   alertmanager_mem                   = 1024
30   alertmanager_port                  = 9093
31   alertmanager_slack_jenkins_api_key = "TE07RD1V1/B01U1NV9HV3/hKZXJJ74g2JcISq4K3QC1eG9"
32   alertmanager_slack_jenkins_channel = "fdio-jobs-monitoring"
33   alertmanager_slack_default_api_key = "TE07RD1V1/B01UUK23B6C/hZTcCu42FUv8d6rtirHtcYIi"
34   alertmanager_slack_default_channel = "fdio-infra-monitoring"
35 }
36
37 module "grafana" {
38   source = "./grafana"
39   providers = {
40     nomad = nomad.yul1
41   }
42
43   # nomad
44   nomad_datacenters = ["yul1"]
45
46   # grafana
47   grafana_job_name    = "prod-grafana"
48   grafana_use_canary  = true
49   grafana_group_count = 1
50   grafana_vault_secret = {
51     use_vault_provider        = false,
52     vault_kv_policy_name      = "kv-secret",
53     vault_kv_path             = "secret/data/grafana",
54     vault_kv_field_access_key = "access_key",
55     vault_kv_field_secret_key = "secret_key"
56   }
57   grafana_container_image = "grafana/grafana:7.3.7"
58   grafana_cpu             = 1000
59   grafana_mem             = 2048
60   grafana_port            = 3000
61 }
62
63 module "minio" {
64   source = "./minio"
65   providers = {
66     nomad = nomad.yul1
67   }
68
69   # nomad
70   nomad_datacenters = ["yul1"]
71   nomad_host_volume = "prod-volume-data1-1"
72
73   # minio
74   minio_job_name        = "prod-minio"
75   minio_group_count     = 4
76   minio_service_name    = "storage"
77   minio_host            = "http://10.32.8.1{4...7}"
78   minio_port            = 9000
79   minio_container_image = "minio/minio:RELEASE.2021-07-27T02-40-15Z"
80   minio_vault_secret = {
81     use_vault_provider        = false,
82     vault_kv_policy_name      = "kv-secret",
83     vault_kv_path             = "secret/data/minio",
84     vault_kv_field_access_key = "access_key",
85     vault_kv_field_secret_key = "secret_key"
86   }
87   minio_data_dir        = "/data/"
88   minio_use_host_volume = true
89   minio_use_canary      = true
90   minio_envs            = ["MINIO_BROWSER=\"off\""]
91
92   # minio client
93   mc_job_name        = "prod-mc"
94   mc_container_image = "minio/mc:RELEASE.2021-07-27T02-40-15Z"
95   mc_extra_commands = [
96     "mc policy set public LOCALMINIO/logs.fd.io",
97     "mc policy set public LOCALMINIO/docs.fd.io",
98     "mc ilm add --expiry-days '180' LOCALMINIO/logs.fd.io",
99     "mc admin user add LOCALMINIO storage Storage1234",
100     "mc admin policy set LOCALMINIO writeonly user=storage"
101   ]
102   minio_buckets = ["logs.fd.io", "docs.fd.io"]
103 }
104
105 module "nginx" {
106   source = "./nginx"
107   providers = {
108     nomad = nomad.yul1
109   }
110
111   # nomad
112   nomad_datacenters = ["yul1"]
113   nomad_host_volume = "prod-volume-data1-1"
114
115   # nginx
116   nginx_job_name        = "prod-nginx"
117   nginx_use_host_volume = true
118 }
119
120 module "prometheus" {
121   source = "./prometheus"
122   providers = {
123     nomad = nomad.yul1
124   }
125
126   # nomad
127   nomad_datacenters = ["yul1"]
128   nomad_host_volume = "prod-volume-data1-1"
129
130   # prometheus
131   prometheus_job_name    = "prod-prometheus"
132   prometheus_use_canary  = true
133   prometheus_group_count = 4
134   prometheus_vault_secret = {
135     use_vault_provider        = false,
136     vault_kv_policy_name      = "kv-secret",
137     vault_kv_path             = "secret/data/prometheus",
138     vault_kv_field_access_key = "access_key",
139     vault_kv_field_secret_key = "secret_key"
140   }
141   prometheus_data_dir        = "/data/"
142   prometheus_use_host_volume = true
143   prometheus_version         = "2.28.1"
144   prometheus_cpu             = 2000
145   prometheus_mem             = 8192
146   prometheus_port            = 9090
147 }
148
149 module "vpp_device" {
150   source = "./vpp_device"
151   providers = {
152     nomad = nomad.yul1
153   }
154
155   # nomad
156   nomad_datacenters = ["yul1"]
157
158   # csit_shim
159   csit_shim_job_name      = "prod-device-csit-shim"
160   csit_shim_group_count   = "1"
161   csit_shim_cpu           = "1500"
162   csit_shim_mem           = "4096"
163   csit_shim_image_aarch64 = "fdiotools/csit_shim-ubuntu2004:2021_03_02_143938_UTC-aarch64"
164   csit_shim_image_x86_64  = "fdiotools/csit_shim-ubuntu2004:2021_03_04_142103_UTC-x86_64"
165 }