Giter Club home page Giter Club logo

Comments (8)

Nuru avatar Nuru commented on May 27, 2024 2

Config map access by the terraform user who makes the cluster is enabled by default, and in fact cannot be disabled. We explain in the README and in more detail in the Release Notes for v0.42.0 the various problems with authenticating to the Kubernetes cluster.

Most likely what happened to you is that Terraform got and cached the auth token from the data source, but it expired while it was in the cache and therefore authentication failed when you tried to apply the changes. With kube_exec_auth_enabled = true you get a fresh token every time you run plan or apply.

from terraform-aws-eks-cluster.

Dmitry1987 avatar Dmitry1987 commented on May 27, 2024 1

@christoffer-eide thanks for sharing. That fixed my issue when I was trying to set public_access_cidrs.

I have Public and Private endpoint set but I can only communicate via the Public endpoint. If I try to communicate with the Private endpoint (e.g. from a VM build in the same VPC like the EKS cluster) I get no response (I can resolve IP but no connectivity).

Any idea what could be wrong?

try to probe with telnet to confirm that you can reach TCP of that address, otherwise it could be just the routing tables issue (in VPC subnets) or security groups, can't think of anything else that might restrict it. unless the internal endpoint has additional mechanisms - could it restrict access over the network based on IAM role? I know it does for OpenSearch (happened when I was setting up logging earlier this year, so IAM role policy that allows access to service was mandatory, and it somehow controlled the actual networking access to the endpoint addresses, I have no idea how it works behind the scenes but it's dynamic based on IAM. Might be same with EKS then? )

from terraform-aws-eks-cluster.

jtyr avatar jtyr commented on May 27, 2024 1

Thanks @Dmitry1987, I have found out the issue. I didn't associate the default VPC SG and VPN CIDR via:

  allowed_security_group_ids = [module.vpc.vpc_default_security_group_id]
  allowed_cidr_blocks        = [module.vpc.vpc_cidr_block]

from terraform-aws-eks-cluster.

christoffer-eide avatar christoffer-eide commented on May 27, 2024

Try setting kube_exec_auth_enabled = true in your eks_cluster module

from terraform-aws-eks-cluster.

Dmitry1987 avatar Dmitry1987 commented on May 27, 2024

thank you, will try that. but why does this setting cause the error, and what else happens when i disable the exec auth flag? :octocat:

from terraform-aws-eks-cluster.

christoffer-eide avatar christoffer-eide commented on May 27, 2024

kube_exec_auth_enabled just controls if the authentication token should be fetched from the terraform data source aws_eks_cluster_auth, or by executing the command eks get-token.

I've had problems in the past where the aws_eks_cluster_auth didn't return a token when I tried to modify the cluster

from terraform-aws-eks-cluster.

jtyr avatar jtyr commented on May 27, 2024

@christoffer-eide thanks for sharing. That fixed my issue when I was trying to set public_access_cidrs.

I have Public and Private endpoint set but I can only communicate via the Public endpoint. If I try to communicate with the Private endpoint (e.g. from a VM build in the same VPC like the EKS cluster) I get no response (I can resolve IP but no connectivity).

Any idea what could be wrong?

from terraform-aws-eks-cluster.

slps970093 avatar slps970093 commented on May 27, 2024

Config map access by the terraform user who makes the cluster is enabled by default, and in fact cannot be disabled. We explain in the README and in more detail in the Release Notes for v0.42.0 the various problems with authenticating to the Kubernetes cluster.

Most likely what happened to you is that Terraform got and cached the auth token from the data source, but it expired while it was in the cache and therefore authentication failed when you tried to apply the changes. With kube_exec_auth_enabled = true you get a fresh token every time you run plan or apply.

v3.0.0 kube_exec_auth_enabled = true
The problem still exists

from terraform-aws-eks-cluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.