-
Notifications
You must be signed in to change notification settings - Fork 0
/
ebs-csi.tf
60 lines (53 loc) · 1.32 KB
/
ebs-csi.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
locals {
ebs_csi = {
name = "ebs-csi-controller"
namespace = "ebs-csi-controller"
}
}
module "ebs_csi_irsa" {
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
version = "~> 5.0"
role_name = "ebs-csi-${var.nuon_id}"
attach_ebs_csi_policy = true
oidc_providers = {
k8s = {
provider_arn = module.eks.oidc_provider_arn
namespace_service_accounts = ["${local.ebs_csi.name}:${local.ebs_csi.name}-sa"]
}
}
}
resource "helm_release" "ebs_csi" {
namespace = local.ebs_csi.namespace
create_namespace = true
name = local.ebs_csi.name
repository = "https://kubernetes-sigs.github.io/aws-ebs-csi-driver"
chart = "aws-ebs-csi-driver"
version = "2.16.0"
values = [
yamlencode({
node : {
tolerateAllTaints : true
}
controller : {
k8sTagClusterId : module.eks.cluster_name
serviceAccount : {
annotations : {
"eks.amazonaws.com/role-arn" : module.ebs_csi_irsa.iam_role_arn
}
}
tolerations : [
{
key : "CriticalAddonsOnly"
value : "true"
effect : "NoSchedule"
},
]
}
}),
]
depends_on = [
module.ebs_csi_irsa,
module.vpc,
module.eks
]
}