-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathkarpenter.tf
31 lines (27 loc) · 1.06 KB
/
karpenter.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
resource "kubectl_manifest" "karpenter_provisioner" {
yaml_body = templatefile(
"${path.module}/files/karpenter/node_pool.yml.tpl",{
EKS_CLUSTER = var.cluster_name,
CAPACITY_TYPE = var.karpenter_capacity_type
INSTANCE_FAMILY = var.karpenter_instance_family
INSTANCE_SIZES = var.karpenter_instance_sizes
AVAILABILITY_ZONES = var.karpenter_availability_zones
CPU_LIMIT = var.karpenter_cpu_limit
MEMORY_LIMIT = var.karpenter_memory_limit
})
depends_on = [
helm_release.karpenter
]
}
resource "kubectl_manifest" "karpenter_template" {
yaml_body = templatefile(
"${path.module}/files/karpenter/ec2_node_class.yml.tpl",{
EKS_CLUSTER = var.cluster_name,
LAUNCH_TEMPLATE = format("%s-template", var.cluster_name)
KARPENTER_NODE_ROLE = aws_iam_role.eks_nodes_roles.name
EKS_SECURITY_GROUP = aws_eks_cluster.eks_cluster.vpc_config[0].cluster_security_group_id
})
depends_on = [
helm_release.karpenter
]
}