Skip to content

Instantly share code, notes, and snippets.

@tarrantro
Created August 13, 2022 03:11
Show Gist options
  • Save tarrantro/6c6bfa1e114e4ca4762a5facaeb0c355 to your computer and use it in GitHub Desktop.
Save tarrantro/6c6bfa1e114e4ca4762a5facaeb0c355 to your computer and use it in GitHub Desktop.
gpu_launchtemplate.hcl
resource "aws_launch_template" "gpu" {
name = "karpenter-gpu-${local.cluster_name}"
block_device_mappings {
device_name = "/dev/xvda"
ebs {
volume_size = 120
}
}
iam_instance_profile {
name = aws_iam_instance_profile.karpenter.name
}
tag_specifications {
resource_type = "instance"
tags = {
"karpenter.sh/discovery" = local.cluster_name
"jina.ai/node-type" = "gpu"
}
}
image_id = data.aws_ami.eks_node_gpu.image_id
instance_initiated_shutdown_behavior = "terminate"
update_default_version = true
# key_name = "${local.cluster_name}-sshkey"
metadata_options {
http_endpoint = "enabled"
http_tokens = "optional"
http_put_response_hop_limit = 2
}
vpc_security_group_ids = [module.eks.node_security_group_id]
user_data = base64encode(templatefile("${path.module}/customized_bootstraps.sh", { cluster_name = "${local.cluster_name}" }))
tags = {
"karpenter.sh/discovery" = local.cluster_name
"node-type" = "gpu"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment