42 lines
988 B
Terraform
42 lines
988 B
Terraform
|
provider "helm" {
|
||
|
kubernetes {
|
||
|
host = module.eks.cluster_endpoint
|
||
|
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
|
||
|
|
||
|
exec {
|
||
|
api_version = "client.authentication.k8s.io/v1beta1"
|
||
|
command = "aws"
|
||
|
args = ["eks", "get-token", "--cluster-name", local.cluster_name]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "helm_release" "karpenter" {
|
||
|
namespace = "karpenter"
|
||
|
create_namespace = true
|
||
|
|
||
|
name = "karpenter"
|
||
|
repository = "oci://public.ecr.aws/karpenter"
|
||
|
chart = "karpenter"
|
||
|
version = "v0.18.0"
|
||
|
|
||
|
set {
|
||
|
name = "serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"
|
||
|
value = module.karpenter_irsa.iam_role_arn
|
||
|
}
|
||
|
|
||
|
set {
|
||
|
name = "clusterName"
|
||
|
value = module.eks.cluster_id
|
||
|
}
|
||
|
|
||
|
set {
|
||
|
name = "clusterEndpoint"
|
||
|
value = module.eks.cluster_endpoint
|
||
|
}
|
||
|
|
||
|
set {
|
||
|
name = "aws.defaultInstanceProfile"
|
||
|
value = aws_iam_instance_profile.karpenter.name
|
||
|
}
|
||
|
}
|