Skip to content

Unable to Authenticate to EKS Cluster with either provider kubeconfig options #143

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

Closed
jamiezieziula opened this issue Oct 29, 2021 · 1 comment

Comments

@jamiezieziula
Copy link

jamiezieziula commented Oct 29, 2021

I am trying to authenticate with my EKS cluster to install kustomization resources in Terraform. When providing the kubeconfig_path, the Terraform plan errors out with:

Error: provider kustomization: kubeconfig_path: open ./kubeconfig_lld-gov-eks-stg-cluster: no such file or directory

because it is searching for the file to exist prior to EKS generating that file.

When providing the kubeconfig_raw, the Terraform apply errors out with:

Error: github.com/kbst/terraform-provider-kustomize/kustomize.kustomizationResourceCreate: apiVersion: "apiextensions.k8s.io/v1", kind: "CustomResourceDefinition", namespace: "" name: "buckets.source.toolkit.fluxcd.io": timed out waiting for apiVersion: "apiextensions.k8s.io/v1", kind: "CustomResourceDefinition" to exist: Get "https://***.gr7.us-gov-west-1.eks.amazonaws.com/api?timeout=32s": getting credentials: exec: executable aws-iam-authenticator not found

 It looks like you are trying to use a client-go credential plugin that is not installed.

To learn more about this feature, consult the documentation available at:      
    https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins

Please add support for provider authentication via token, host and certificate as kubectl/kubernetes providers do.

@pst
Copy link
Member

pst commented Nov 1, 2021

If the file is written by Terraform, it won't exist during plan. Nothing I can do about that. As for the error message when using kubeconfig_raw, have you tried providing the binary that your kubeconfig specifies in the environment you run terraform in?

I don't plan on changing how the provider is configured, this has been discussed before. You can find this here: #96 Between templates and yamlencode there are enough ways in Terraform to generate a valid kubeconfig in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants