Terraform-provider-kubernetes: Compatibility with terraform 0.12

Created on 14 Jan 2019  路  7Comments  路  Source: hashicorp/terraform-provider-kubernetes

I tried out terraform 0.12alpha4 as a preview today and found that the kubernetes provider isn't compatible. Is there any workaround available, or does this require a ton of new work to be done?

Terraform Version

$ terraform version
Terraform v0.12.0-alpha4 (2c36829d3265661d8edbd5014de8090ea7e2a076)
+ provider.google v1.19.1-3-g59efc8b9-dev
+ provider.kubernetes v1.4.0

Terraform Configuration Files

provider "kubernetes" {}

Expected Behavior

What should have happened?

$ terraform apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Actual Behavior

What actually happened?

$ terraform apply

Error: Failed to instantiate provider "kubernetes" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]

Most helpful comment

Anything new? I'm tired of the misfeatures of 0.11 =/

All 7 comments

The provider needs to be built for TF 0.12 specifically. I'm in the process of doing that. You can follow the progress in the tf-012 branch.

This includes bumping the Terraform SDK to current master (or as recent as possible), like @shaneramey explained above.
However, some code changes are necessary in the provider to accommodate for some differences with Go 1.11.x. I will put up a PR as soon as it tests correctly.

Actually the issues are mostly with the acceptance test configurations, which need to be adapted for TF 0.12 syntax.

Thanks for the update @alexsomesan. I'll happily be your first tester if you provide a release candidate, if that's helpful.

Anything new? I'm tired of the misfeatures of 0.11 =/

Not sure if this issue is present in the stable versions, but I'm having some issues with the kubernetes_cluster_role_binding resource -

My tf looks like this:

resource "kubernetes_cluster_role_binding" "tiller" {
  metadata {
    name = "tiller"
  }
  role_ref = {
    api_group = "rbac.authorization.k8s.io"
    kind = "ClusterRole"
    name = "cluster-admin"
  }
  subject {
    api_group = "rbac.authorization.k8s.io"
    kind = "ServiceAccount"
    name = "tiller"
    namespace = "kube-system"
  }
}

When running this I always get an error like this one:
subjects[0].apiGroup: Unsupported value: "rbac.authorization.k8s.io": supported values: ""

This happens if I omit subject.api_group althogether, or if I set it to an empty string.

Also, you'll notice that I have an equal sign to set role_ref - that is because without that, it throws 2 errors:

Error: Unsupported block type

  on rancher_cluster/main.tf line 29, in resource "kubernetes_cluster_role_binding" "tiller":
  29:   role_ref {

Blocks of type "role_ref" are not expected here. Did you mean to define
argument "role_ref"? If so, use the equals sign to assign it a value.


Error: Missing required argument

  on rancher_cluster/main.tf line 23, in resource "kubernetes_cluster_role_binding" "tiller":
  23: resource "kubernetes_cluster_role_binding" "tiller" {

The argument "role_ref" is required, but no definition was found.

This provider should now be compatible with 0.12 as per the previous release of 1.6.2 (https://github.com/terraform-providers/terraform-provider-kubernetes/blob/master/CHANGELOG.md#162-april-18-2019)

@drpebcak If you are still experiencing an issue with with the latest releases of this provider & Terraform, it鈥檚 probably worth creating a new issue for visibility.

Nope, it鈥檚 all good now!

Was this page helpful?
0 / 5 - 0 ratings