File tree 2 files changed +49
-0
lines changed
deployment/aws-terraform/1-services
2 files changed +49
-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 @@ -27,3 +27,32 @@ resource "kubernetes_annotations" "ebs_csi_iam_annotation" {
27
27
" eks.amazonaws.com/role-arn" : module.ebs_csi_irsa.iam_role_arn
28
28
}
29
29
}
30
+ module "fsx_csi_irsa" {
31
+ source = " terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
32
+
33
+ role_name_prefix = " fsx-csi-${ local . cluster_name } "
34
+ attach_fsx_lustre_csi_policy = true
35
+
36
+ oidc_providers = {
37
+ main = {
38
+ provider_arn = module.eks.oidc_provider_arn
39
+ namespace_service_accounts = [
40
+ " kube-system:fsx-csi-controller-sa"
41
+ ]
42
+ }
43
+ }
44
+
45
+ tags = local. tags
46
+ }
47
+
48
+ resource "kubernetes_annotations" "fsx_csi_controller_annotation" {
49
+ api_version = " v1"
50
+ kind = " ServiceAccount"
51
+ metadata {
52
+ name = " fsx-csi-controller-sa"
53
+ namespace = " kube-system"
54
+ }
55
+ annotations = {
56
+ " eks.amazonaws.com/role-arn" : module.fsx_csi_irsa.iam_role_arn
57
+ }
58
+ }
You can’t perform that action at this time.
0 commit comments