-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Install AWS EKS Add-on #167
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
######################################### | ||
# OIDC stuff for VPC CNI | ||
######################################### | ||
data "tls_certificate" "vpc_cni" { | ||
url = module.eks.cluster_oidc_issuer_url | ||
} | ||
|
||
resource "aws_eks_addon" "vpc_cni" { | ||
depends_on = [ | ||
module.eks, | ||
aws_iam_openid_connect_provider.eks, | ||
aws_iam_role_policy_attachment.vpc_cni | ||
] | ||
|
||
addon_name = "vpc-cni" | ||
addon_version = "v1.13.0-eksbuild.1" | ||
cluster_name = var.namespace | ||
preserve = false | ||
resolve_conflicts = "OVERWRITE" | ||
service_account_role_arn = aws_iam_role.node.arn | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this change have any impact on existing workloads? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should not have any impact at all. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
resource "aws_iam_role" "node" { | ||
name = "${var.namespace}-node" | ||
assume_role_policy = data.aws_iam_policy_document.node_assume.json | ||
|
||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,36 +4,14 @@ locals { | |
mysql_port = 3306 | ||
redis_port = 6379 | ||
encrypt_ebs_volume = true | ||
} | ||
|
||
|
||
resource "aws_eks_addon" "eks" { | ||
cluster_name = var.namespace | ||
addon_name = "aws-ebs-csi-driver" | ||
depends_on = [ | ||
module.eks | ||
] | ||
} | ||
|
||
resource "aws_eks_addon" "efs" { | ||
cluster_name = module.eks.cluster_id | ||
addon_name = "aws-efs-csi-driver" | ||
addon_version = "v1.7.1-eksbuild.1" # Ensure this version is compatible | ||
resolve_conflicts = "OVERWRITE" | ||
depends_on = [ | ||
module.eks | ||
] | ||
managed_policy_arns = concat([ | ||
"arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", | ||
"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", | ||
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", | ||
], var.eks_policy_arns) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where does this get used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remember when we did all the work on the IAM policy documents? (https://github.com/wandb/terraform-aws-wandb/pull/101/files). I think we determined we have to pass these here as well or the policies aren't attached to the node or the cluster. I'm not sure which. But if you're asking about the policy specific to the CNI driver, that gets used for anything involving networking in EKS, so grabbing elastic ips, setting up container networking, etc. |
||
} | ||
|
||
# removed due to conflict with | ||
# AWS Load Balancer Controller | ||
# being installed with Helm. | ||
# See: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.6/ | ||
#resource "aws_eks_addon" "vpc_cni" { | ||
# cluster_name = var.namespace | ||
# addon_name = "vpc-cni" | ||
# depends_on = [module.eks] | ||
#} | ||
|
||
module "eks" { | ||
source = "terraform-aws-modules/eks/aws" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version is different than the deleted one, just wanna make sure this is the right one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. One of the things that can be used to differentiate the self-managed plugin vs. the EKS add-on are the version numbers. This particular version is the next "in line" -- most of our clusters, if not all, are running v.1.12 of the plugin, and I'm gunning for keeping the AWS recommendation of upgrading the CNI one minor version at a time.