From 7d39596ab4f172de3745ef19e4ae823b00a7898b Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Fri, 31 May 2024 14:51:08 -0700 Subject: [PATCH] Create an EKS access entry --- modules/k8s-node-autoscaler/main.tf | 7 +++++++ modules/k8s-node-autoscaler/provider.tf | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/k8s-node-autoscaler/main.tf b/modules/k8s-node-autoscaler/main.tf index 6873249b..74e7e52b 100644 --- a/modules/k8s-node-autoscaler/main.tf +++ b/modules/k8s-node-autoscaler/main.tf @@ -61,6 +61,13 @@ resource "aws_iam_instance_profile" "profile" { role = aws_iam_role.work_profile_iam_role.name } +resource "aws_eks_access_entry" "example" { + cluster_name = var.cluster_name + principal_arn = aws_iam_instance_profile.profile.arn + kubernetes_groups = ["system:nodes"] + type = "EC2_LINUX" +} + module "ocean-aws-k8s" { source = "spotinst/ocean-aws-k8s/spotinst" version = "1.2.0" diff --git a/modules/k8s-node-autoscaler/provider.tf b/modules/k8s-node-autoscaler/provider.tf index 48b4405d..36f44424 100644 --- a/modules/k8s-node-autoscaler/provider.tf +++ b/modules/k8s-node-autoscaler/provider.tf @@ -13,9 +13,3 @@ provider "kubernetes" { cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data) token = data.aws_eks_cluster_auth.cluster.token } - -# provider "helm" { -# kubernetes { -# config_path = var.kube_config_path -# } -# }