File tree 2 files changed +48
-0
lines changed
deployment/aws-terraform/1-services
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ resource "helm_release" "fsx_csi_driver" {
2
+ namespace = " kube-system"
3
+
4
+ name = " aws-fsx-csi-driver"
5
+ repository = " https://kubernetes-sigs.github.io/aws-fsx-csi-driver/"
6
+ chart = " aws-fsx-csi-driver"
7
+ }
8
+
9
+ resource "kubernetes_storage_class_v1" "fsx_sc" {
10
+ metadata {
11
+ name = " fsx-sc"
12
+ }
13
+ storage_provisioner = " fsx.csi.aws.com"
14
+ parameters = {
15
+ subnetId = tolist (module. eks . vpc_private_subnet_ids )[0 ]
16
+ securityGroupIds = module.eks.cluster_security_group
17
+ deploymentType = " PERSISTENT_2"
18
+ }
19
+ depends_on = [ helm_release . fsx_csi_driver ]
20
+ }
Original file line number Diff line number Diff line change @@ -49,6 +49,24 @@ module "efs_csi_irsa" {
49
49
tags = local. tags
50
50
}
51
51
52
+ module "fsx_csi_irsa" {
53
+ source = " terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
54
+
55
+ role_name_prefix = " fsx-csi-${ local . cluster_name } "
56
+ attach_fsx_lustre_csi_policy = true
57
+
58
+ oidc_providers = {
59
+ main = {
60
+ provider_arn = module.eks.oidc_provider_arn
61
+ namespace_service_accounts = [
62
+ " kube-system:fsx-csi-controller-sa"
63
+ ]
64
+ }
65
+ }
66
+
67
+ tags = local. tags
68
+ }
69
+
52
70
module "efs_csi_irsa_node" {
53
71
count = local. use_efs
54
72
@@ -94,5 +112,15 @@ resource "kubernetes_annotations" "efs_csi_node_annotation" {
94
112
}
95
113
annotations = {
96
114
" eks.amazonaws.com/role-arn" : module.efs_csi_irsa_node[0 ].iam_role_arn
115
+
116
+ resource " kubernetes_annotations" " fsx_csi_controller_annotation" {
117
+ api_version = " v1"
118
+ kind = " ServiceAccount"
119
+ metadata {
120
+ name = " fsx-csi-controller-sa"
121
+ namespace = " kube-system"
122
+ }
123
+ annotations = {
124
+ " eks.amazonaws.com/role-arn" : module.fsx_csi_irsa.iam_role_arn
97
125
}
98
126
}
You can’t perform that action at this time.
0 commit comments