banzaicloud / terraform-provider-k8s

Kubernetes Terraform provider with support for raw manifests
https://registry.terraform.io/providers/banzaicloud/k8s
MIT License
135 stars 30 forks source link

Error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1" #88

Closed diseku closed 2 years ago

diseku commented 2 years ago

Describe the bug

Error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1"

terraform version: 1.1.7 kubernetes version: 1.21 k8s provider version: 0.9.1

Steps to reproduce the issue: Set the api_version to client.authentication.k8s.io/v1 instead of deprecated v1beta1 in the provider configuration.

provider "kubernetes" {
  host     = module.k8s_init.k8s_config["host"]
  insecure = module.k8s_init.k8s_config["insecure"]
  exec {
    api_version = "client.authentication.k8s.io/v1"
    command     = module.k8s_init.k8s_config["command"]
    args        = module.k8s_init.k8s_config["args"]
    env         = module.k8s_init.k8s_config["env"]
  }
}

provider "k8s" {
  host     = module.k8s_init.k8s_config["host"]
  insecure = module.k8s_init.k8s_config["insecure"]
  exec {
    api_version = "client.authentication.k8s.io/v1"
    command     = module.k8s_init.k8s_config["command"]
    args        = module.k8s_init.k8s_config["args"]
    env         = module.k8s_init.k8s_config["env"]
  }
}

hashicorp/kubernetes provider: no issues

banzaicloud/k8s fails with:

│ Error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1"
│ 
│   with provider["registry.terraform.io/banzaicloud/k8s"],
│   on main.tf line 36, in provider "k8s":
│   36: provider "k8s" {
│ 
╵

Expected behavior Functional with the graduated to stable client.authentication.k8s.io/v1

Additional context Blocker for users who are preparing to upgrade EKS to 1.22, since v1beta1 is deprecated

diseku commented 2 years ago

Did an upgrade to 1.22 on a test cluster: at the end EKS specific. aws-iam-authenticator still defaults to client.authentication.k8s.io/vbeta1 for exec.

AWS lacks proper documentation, compatibility matrix explained can be found in this PR