-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update Karpenter examples to v1 (#2017)
- Loading branch information
1 parent
5255ef6
commit c082d0e
Showing
13 changed files
with
313 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
locals { | ||
namespace = "karpenter" | ||
} | ||
|
||
################################################################################ | ||
# Controller & Node IAM roles, SQS Queue, Eventbridge Rules | ||
################################################################################ | ||
|
||
module "karpenter" { | ||
source = "terraform-aws-modules/eks/aws//modules/karpenter" | ||
version = "~> 20.24" | ||
|
||
cluster_name = module.eks.cluster_name | ||
enable_v1_permissions = true | ||
namespace = local.namespace | ||
|
||
# Name needs to match role name passed to the EC2NodeClass | ||
node_iam_role_use_name_prefix = false | ||
node_iam_role_name = local.name | ||
create_pod_identity_association = true | ||
|
||
tags = local.tags | ||
} | ||
|
||
################################################################################ | ||
# Helm charts | ||
################################################################################ | ||
|
||
resource "helm_release" "karpenter" { | ||
name = "karpenter" | ||
namespace = local.namespace | ||
create_namespace = true | ||
repository = "oci://public.ecr.aws/karpenter" | ||
repository_username = data.aws_ecrpublic_authorization_token.token.user_name | ||
repository_password = data.aws_ecrpublic_authorization_token.token.password | ||
chart = "karpenter" | ||
version = "1.0.2" | ||
wait = false | ||
|
||
values = [ | ||
<<-EOT | ||
nodeSelector: | ||
karpenter.sh/controller: 'true' | ||
settings: | ||
clusterName: ${module.eks.cluster_name} | ||
clusterEndpoint: ${module.eks.cluster_endpoint} | ||
interruptionQueue: ${module.karpenter.queue_name} | ||
tolerations: | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- key: karpenter.sh/controller | ||
operator: Exists | ||
effect: NoSchedule | ||
webhook: | ||
enabled: false | ||
EOT | ||
] | ||
|
||
lifecycle { | ||
ignore_changes = [ | ||
repository_password | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.