Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add block mappings to customize volume size #67

Merged
merged 8 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions modules/karpenter/karpenter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ resource "kubernetes_manifest" "karpenter_node_template" {
subnetSelector = each.value.karpenter_subnet_selector_map
securityGroupSelector = each.value.karpenter_security_group_selector_map
amiFamily = each.value.karpenter_ami_family
blockDeviceMappings = [
{
deviceName = "/dev/xvda"
ebs = {
volumeSize = each.value.karpenter_root_volume_size
volumeType = "gp3"
encrypted = true
}
},
{
deviceName = "/dev/xvdb"
ebs = {
volumeSize = each.value.karpenter_ephemeral_volume_size
volumeType = "gp3"
encrypted = true
}
},
]

tags = each.value.karpenter_nodetemplate_tag_map
}
Expand Down
4 changes: 4 additions & 0 deletions modules/karpenter/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ variable "karpenter_nodetemplates" {
karpenter_security_group_selector_map = map(string)
karpenter_nodetemplate_tag_map = map(string)
karpenter_ami_family = string
karpenter_root_volume_size = string
karpenter_ephemeral_volume_size = string
}))
default = []
## sample below
Expand All @@ -73,6 +75,8 @@ variable "karpenter_nodetemplates" {
# karpenter_security_group_selector_map = {}
# karpenter_nodetemplate_tag_map = {}
# karpenter_ami_family = "Bottlerocket"
# karpenter_root_volume_size = "5Gi"
# karpenter_ephemeral_volume_size = "50Gi"
# }]
}

Expand Down