Skip to content

Commit 8483bfc

Browse files
authored
feat: support ebs driver in live migration example (#564)
* feat: support ebs driver in live migration example * fix formating
1 parent a28b950 commit 8483bfc

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

examples/eks/eks_cluster_live_migration/eks.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ module "eks" {
1818
vpc-cni = {
1919
most_recent = true
2020
}
21+
aws-ebs-csi-driver = {
22+
service_account_role_arn = module.ebs_csi_irsa_role.iam_role_arn
23+
resolve_conflicts = "OVERWRITE"
24+
}
2125
}
2226

2327
tags = var.tags
@@ -67,6 +71,21 @@ module "eks" {
6771

6872
}
6973

74+
module "ebs_csi_irsa_role" {
75+
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
76+
version = "~> 4.21.1"
77+
78+
role_name = "ebs-csi-${var.cluster_name}"
79+
attach_ebs_csi_policy = true
80+
81+
oidc_providers = {
82+
ex = {
83+
provider_arn = module.eks.oidc_provider_arn
84+
namespace_service_accounts = ["kube-system:ebs-csi-controller-sa"]
85+
}
86+
}
87+
}
88+
7089
# Example additional security group.
7190
resource "aws_security_group" "additional" {
7291
name_prefix = "${var.cluster_name}-additional"

examples/eks/eks_cluster_live_migration/versions.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ terraform {
1111
version = "~> 3.0"
1212
}
1313
aws = {
14-
source = "hashicorp/aws"
15-
version = "~> 5.0"
14+
source = "hashicorp/aws"
1615
}
1716
}
1817
required_version = ">= 1.3.2"

0 commit comments

Comments
 (0)