Skip to content

Commit

Permalink
Merge branch 'main' into b101
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Sep 20, 2024
2 parents df96215 + 24fe465 commit cb1545d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ec2_node_class.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ spec:

# Optional, configures detailed monitoring for the instance
detailedMonitoring: true

# Add finops tags to karpenter provisioned nodes
tags: ${tags}
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ resource "aws_iam_instance_profile" "karpenter_node_instance_profile" {
role = module.karpenter_resources.node_iam_role_name
}

# Get the default tags from the provider
data "aws_default_tags" "default_tags" {}

# SHOULD PROBABLY PUT THESE OBJECTS INTO A HELM CHART
# Create karpenter default
resource "kubectl_manifest" "karpenter_ec2_node_class" {
Expand All @@ -189,6 +192,7 @@ resource "kubectl_manifest" "karpenter_ec2_node_class" {
]
yaml_body = templatefile("${path.module}/ec2_node_class.yaml.tpl", {
cluster_name = var.cluster_name
tags = jsonencode(data.aws_default_tags.default_tags.tags)
amd_ami_family = "Bottlerocket"
amd_ami_alias = "bottlerocket"
})
Expand Down

0 comments on commit cb1545d

Please sign in to comment.