-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Set default EKS to 1.26; install vpc-cni add-on (#207)
* add AWS EKS add-ons * amendments * example version * add EFS, role for vpc-cni * add coredns * amendment * change names * Update modules/app_eks/add-ons.tf Co-authored-by: Justin Brooks <[email protected]> * Update modules/app_eks/add-ons.tf Co-authored-by: Justin Brooks <[email protected]> * Update modules/app_eks/add-ons.tf Co-authored-by: Justin Brooks <[email protected]> * Update modules/app_eks/add-ons.tf Co-authored-by: Justin Brooks <[email protected]> --------- Co-authored-by: Justin Brooks <[email protected]>
- Loading branch information
Showing
3 changed files
with
81 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
### IAM policy and role for vpc-cni | ||
data "aws_iam_policy_document" "oidc_assume_role" { | ||
statement { | ||
actions = ["sts:AssumeRoleWithWebIdentity"] | ||
effect = "Allow" | ||
|
||
condition { | ||
test = "StringEquals" | ||
variable = "${replace(module.eks.cluster_oidc_issuer_url, "https://", "")}:sub" | ||
values = ["system:serviceaccount:kube-system:aws-node"] | ||
} | ||
|
||
principals { | ||
identifiers = [aws_iam_openid_connect_provider.eks.arn] | ||
type = "Federated" | ||
} | ||
} | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "eks_oidc" { | ||
policy_arn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy" | ||
role = aws_iam_role.oidc.name | ||
} | ||
|
||
resource "aws_iam_role" "oidc" { | ||
name = join("-", [var.namespace, "oidc"]) | ||
assume_role_policy = data.aws_iam_policy_document.oidc_assume_role.json | ||
} | ||
|
||
|
||
|
||
### add-ons | ||
resource "aws_eks_addon" "aws_efs_csi_driver" { | ||
depends_on = [ | ||
aws_eks_addon.vpc-cni | ||
] | ||
cluster_name = var.namespace | ||
addon_name = "aws-efs-csi-driver" | ||
addon_version = "v1.7.7-eksbuild.1" | ||
resolve_conflicts = "OVERWRITE" | ||
} | ||
|
||
resource "aws_eks_addon" "aws_ebs_csi_driver" { | ||
depends_on = [ | ||
aws_eks_addon.vpc_cni | ||
] | ||
cluster_name = var.namespace | ||
addon_name = "aws-ebs-csi-driver" | ||
addon_version = "v1.25.0-eksbuild.1" | ||
resolve_conflicts = "OVERWRITE" | ||
} | ||
|
||
resource "aws_eks_addon" "coredns" { | ||
depends_on = [ | ||
aws_eks_addon.vpc_cni | ||
] | ||
cluster_name = var.namespace | ||
addon_name = "coredns" | ||
addon_version = "v1.9.3-eksbuild.11" | ||
resolve_conflicts = "OVERWRITE" | ||
} | ||
|
||
resource "aws_eks_addon" "kube_proxy" { | ||
depends_on = [ | ||
aws_eks_addon.vpc_cni | ||
] | ||
cluster_name = var.namespace | ||
addon_name = "kube-proxy" | ||
addon_version = "v1.25.14-eksbuild.2" | ||
resolve_conflicts = "OVERWRITE" | ||
} | ||
|
||
resource "aws_eks_addon" "vpc_cni" { | ||
cluster_name = var.namespace | ||
addon_name = "vpc-cni" | ||
addon_version = "v1.18.0-eksbuild.1" | ||
resolve_conflicts = "OVERWRITE" | ||
service_account_role_arn = aws_iam_role.oidc.arn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters