Skip to content

kubernetes_manifest does not address credentials properly #2134

Open
@vladimirtiukhtin

Description

@vladimirtiukhtin

Terraform Version, Provider Version and Kubernetes Version

Terraform version:
Terraform v1.4.6
on linux_amd64
Kubernetes provider version:
+ provider registry.terraform.io/hashicorp/kubernetes v2.21.1
Kubernetes version:
1.24

Affected Resource(s)

  • kubernetes_manifest

Behavior

I have two kubernetes providers defined: one (vanilla) consumes credentials from environment variables through KUBE_TOKEN, another (EKS) uses aws_eks_cluster_auth resource to obtain credentials. And it happily works with all kubernetes resources except kubernetes_manifest. It seems to grab access_token from environment variable instead of one configured in the provider definition

provider "kubernetes" {
  alias                  = "aws"
  host                   = data.aws_eks_cluster.environment_cluster.endpoint
  cluster_ca_certificate = base64decode(data.aws_eks_cluster.environment_cluster.certificate_authority.0.data)
  token                  = data.aws_eks_cluster_auth.environment_cluster.token
}

So I very much understandably get Unauthorized unless I run unset KUBE_TOKEN which is not an acceptable solution because provider one needs it

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions