forked from aws-ia/terraform-aws-eks-blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes-addons.tf
148 lines (117 loc) · 6.12 KB
/
kubernetes-addons.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
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: MIT-0
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
module "metrics_server" {
count = var.create_eks && var.metrics_server_enable ? 1 : 0
source = "./kubernetes-addons/metrics-server"
metrics_server_helm_chart = var.metrics_server_helm_chart
depends_on = [module.aws_eks]
}
module "cluster_autoscaler" {
count = var.create_eks && var.cluster_autoscaler_enable ? 1 : 0
source = "./kubernetes-addons/cluster-autoscaler"
eks_cluster_id = module.aws_eks.cluster_id
cluster_autoscaler_helm_chart = var.cluster_autoscaler_helm_chart
depends_on = [module.aws_eks]
}
module "traefik_ingress" {
count = var.create_eks && var.traefik_ingress_controller_enable ? 1 : 0
source = "./kubernetes-addons/traefik-ingress"
traefik_helm_chart = var.traefik_helm_chart
depends_on = [module.aws_eks]
}
module "prometheus" {
count = var.create_eks && var.prometheus_enable ? 1 : 0
source = "./kubernetes-addons/prometheus"
prometheus_helm_chart = var.prometheus_helm_chart
#AWS Managed Prometheus Workspace
aws_managed_prometheus_enable = var.aws_managed_prometheus_enable
amp_workspace_id = var.aws_managed_prometheus_enable ? module.aws_managed_prometheus[0].amp_workspace_id : ""
amp_ingest_role_arn = var.aws_managed_prometheus_enable ? module.aws_managed_prometheus[0].service_account_amp_ingest_role_arn : ""
service_account_amp_ingest_name = local.service_account_amp_ingest_name
depends_on = [module.aws_eks]
}
module "lb_ingress_controller" {
count = var.create_eks && var.aws_lb_ingress_controller_enable ? 1 : 0
source = "./kubernetes-addons/lb-ingress-controller"
eks_cluster_id = module.aws_eks.cluster_id
lb_ingress_controller_helm_app = var.aws_lb_ingress_controller_helm_app
eks_oidc_issuer_url = module.aws_eks.cluster_oidc_issuer_url
eks_oidc_provider_arn = module.aws_eks.oidc_provider_arn
depends_on = [module.aws_eks]
}
module "nginx_ingress" {
count = var.create_eks && var.nginx_ingress_controller_enable ? 1 : 0
source = "./kubernetes-addons/nginx-ingress"
nginx_helm_chart = var.nginx_helm_chart
depends_on = [module.aws_eks]
}
module "aws-for-fluent-bit" {
count = var.create_eks && var.aws_for_fluentbit_enable ? 1 : 0
source = "./kubernetes-addons/aws-for-fluentbit"
aws_for_fluentbit_helm_chart = var.aws_for_fluentbit_helm_chart
eks_cluster_id = module.aws_eks.cluster_id
depends_on = [module.aws_eks]
}
module "fargate_fluentbit" {
count = var.create_eks && var.fargate_fluentbit_enable ? 1 : 0
source = "./kubernetes-addons/fargate-fluentbit"
eks_cluster_id = module.aws_eks.cluster_id
fargate_fluentbit_config = var.fargate_fluentbit_config
depends_on = [module.aws_eks]
}
module "agones" {
count = var.create_eks && var.agones_enable ? 1 : 0
source = "./kubernetes-addons/agones"
agones_helm_chart = var.agones_helm_chart
eks_worker_security_group_id = module.aws_eks.worker_security_group_id
depends_on = [module.aws_eks]
}
module "spark-k8s-operator" {
count = var.create_eks && var.spark_on_k8s_operator_enable ? 1 : 0
source = "./kubernetes-addons/spark-k8s-operator"
spark_on_k8s_operator_helm_chart = var.spark_on_k8s_operator_helm_chart
depends_on = [module.aws_eks]
}
module "cert_manager" {
count = var.create_eks && (var.cert_manager_enable || var.enable_windows_support) ? 1 : 0
source = "./kubernetes-addons/cert-manager"
cert_manager_helm_chart = var.cert_manager_helm_chart
depends_on = [module.aws_eks]
}
module "windows_vpc_controllers" {
count = var.create_eks && var.enable_windows_support ? 1 : 0
source = "./kubernetes-addons/windows-vpc-controllers"
windows_vpc_controllers_helm_chart = var.windows_vpc_controllers_helm_chart
depends_on = [
module.cert_manager, module.aws_eks
]
}
module "aws_opentelemetry_collector" {
count = var.create_eks && var.aws_open_telemetry_enable ? 1 : 0
source = "./kubernetes-addons/aws-opentelemetry-eks"
aws_open_telemetry_addon = var.aws_open_telemetry_addon
aws_open_telemetry_mg_node_iam_role_arns = var.create_eks && var.enable_managed_nodegroups ? values({ for nodes in sort(keys(var.managed_node_groups)) : nodes => join(",", module.aws_eks_managed_node_groups[nodes].managed_nodegroup_iam_role_name) }) : []
aws_open_telemetry_self_mg_node_iam_role_arns = var.create_eks && var.enable_self_managed_nodegroups ? values({ for nodes in sort(keys(var.self_managed_node_groups)) : nodes => join(",", module.aws_eks_self_managed_node_groups[nodes].self_managed_node_group_iam_role_arns) }) : []
depends_on = [module.aws_eks]
}
module "argocd" {
count = var.create_eks && var.argocd_enable ? 1 : 0
source = "./kubernetes-addons/argocd"
argocd_helm_chart = var.argocd_helm_chart
depends_on = [module.aws_eks]
}