-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
155 lines (146 loc) · 4.4 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
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
144
145
146
147
148
149
150
151
152
153
154
155
terraform {
backend "remote" {
hostname = "app.terraform.io"
organization = "mel-ciscolabs-com"
workspaces {
name = "dev-cpoc-fso-iks-1"
}
}
required_providers {
helm = {
source = "hashicorp/helm"
}
kubernetes = {
source = "hashicorp/kubernetes"
}
}
}
### Remote State - Import Kube Config ###
data "terraform_remote_state" "iks-1" {
backend = "remote"
config = {
organization = "mel-ciscolabs-com"
workspaces = {
name = "iks-cpoc-syd-demo-1"
}
}
}
### Decode Kube Config ###
# Assumes kube_config is passed as b64 encoded
locals {
kube_config = yamldecode(base64decode(data.terraform_remote_state.iks-1.outputs.kube_config))
}
### Providers ###
provider "kubernetes" {
# alias = "iks-k8s"
host = local.kube_config.clusters[0].cluster.server
cluster_ca_certificate = base64decode(local.kube_config.clusters[0].cluster.certificate-authority-data)
client_certificate = base64decode(local.kube_config.users[0].user.client-certificate-data)
client_key = base64decode(local.kube_config.users[0].user.client-key-data)
}
provider "helm" {
kubernetes {
host = local.kube_config.clusters[0].cluster.server
cluster_ca_certificate = base64decode(local.kube_config.clusters[0].cluster.certificate-authority-data)
client_certificate = base64decode(local.kube_config.users[0].user.client-certificate-data)
client_key = base64decode(local.kube_config.users[0].user.client-key-data)
}
}
module "fso" {
source = "github.com/cisco-apjc-cloud-se/terraform-helm-fso"
# thousandeyes = {
# enabled = true
# http_tests = {
# fso-demo-app = {
# name = "fso-demo-app"
# interval = 60
# url = "http://fso-demo-app.cisco.com"
# content_regex = ".*"
# network_measurements = true # 1
# mtu_measurements = true # 1
# bandwidth_measurements = false # 0
# bgp_measurements = true # 1
# use_public_bgp = true # 1
# num_path_traces = 0
# agents = [
# ## "Adelaide, Australia",
# # "Auckland, New Zealand",
# # "Brisbane, Australia",
# "Melbourne, Australia",
# # "Melbourne, Australia (Azure australiasoutheast)",
# # "Perth, Australia",
# "Sydney, Australia",
# # "Wellington, New Zealand"
# ]
# }
# }
# }
iwo = {
enabled = true
namespace = "iwo"
cluster_name = "iks-cpoc-syd-demo-1"
chart_url = var.iwo_chart_url # Passed from Workspace Variable
server_version = "8.5"
collector_image_version = "8.5.1"
dc_image_version = "1.0.9-110"
}
appd = {
enabled = true
kubernetes = {
namespace = "appd"
release_name = "iks-cpoc-demo-1" # o2 adds "appdynamics-operator" suffix
imageinfo = {
clusteragent = {}
operator = {}
machineagent = {
tag = "22.5.0"
}
machineagentwin = {}
netviz = {}
}
}
account = {
name = var.appd_account_name # Passed from Workspace Variable
key = var.appd_account_key # Passed from Workspace Variable
otel_api_key = var.appd_otel_api_key # Passed from Workspace Variable
username = var.appd_account_username # Passed from Workspace Variable
password = var.appd_account_password # Passed from Workspace Variable
}
metrics_server = {
install_service = true
release_name = "appd-metrics-server"
}
machine_agent = {
install_service = true
infraviz = {
enable_container_hostid = true
enable_dockerviz = true
enable_serverviz = true
enable_masters = false
stdout_logging = true
}
netviz = {
enabled = true
}
}
cluster_agent = {
install_service = true
app_name = "iks-cpoc-demo-1"
monitor_namespace_regex = "coolsox"
}
autoinstrument = {
enabled = true
namespace_regex = "coolsox"
default_appname = "coolsox-rw"
java = {
enabled = true
}
dotnetcore = {
enabled = true
}
nodejs = {
enabled = true
}
}
}
}