Closed freeone3000 closed 1 year ago
For kubectl > 1.24 or aws-cli > 2.7.0 you should use api_version = "client.authentication.k8s.io/v1beta1"
This works with EKS - Kubernetes 1.23
provider "kubectl" {
host = data.terraform_remote_state.eks.outputs.cluster_endpoint
cluster_ca_certificate = base64decode(data.terraform_remote_state.eks.outputs.cluster_certificate_authority_data)
load_config_file = false
exec {
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", "${data.terraform_remote_state.eks.outputs.cluster_id}"]
command = "aws"
}
}
I had the same error. v1.24.8-eks-ffeb93d
will use
api_version = "client.authentication.k8s.io/v1beta1"
to solve this isssue.
With the following block:
Versions of relevant items:
I get the following error:
This happened after switching to the exec plugin for kubectl, and I fear there is an incompatibility with this cluster version and this kubectl version. Is there any advice on fixing this issue?