ionos-cloud/terraform-provider-ionoscloud

ionoscloud_k8s_cluster.k8s_version can not be upgraded

MalteJoe opened this issue · 4 comments

Description

Changing the value of ionoscloud_k8s_cluster.k8s_version from "1.24.6" to "1.24.8" doesn't have an effect during terraform plan and terraform apply

Expected behavior

It's possible to upgrade k8s_version through terraform just like it is in DCD.

Environment

$ terraform -version
Terraform v1.3.5
on linux_amd64
+ provider registry.terraform.io/ionos-cloud/ionoscloud v6.3.3

How to Reproduce

Steps to reproduce the behavior:

  1. Create a main.tf
    terraform {
      required_version = ">= 1.0.1"
    
      required_providers {
        ionoscloud = {
          source  = "ionos-cloud/ionoscloud"
          version = "~> 6.3.3"
        }
      }
    }
    
    provider "ionoscloud" {
      token = "XXX"
    }
    
    resource "ionoscloud_k8s_cluster" "reproduction" {
      name        = "reproduction"
      k8s_version = "1.24.6"
    }
    
  2. Replace XXX with a valid token
  3. Run terraform init and terraform apply
  4. Observe that in the DCD Kubernetes Manager the Version 1.24.6 is shown for the cluster
  5. Change the k8s_version to 1.24.8
  6. Run terraform apply (or plan) again
  7. Observe Terraform reporting no changes

Error and Debug Output

$ terraform apply
ionoscloud_k8s_cluster.reproduction: Refreshing state... [id=e6435546-f160-4f0a-8ab9-47a1e40eb438]

No changes. Your infrastructure matches the configuration.

We ignore changes at patch level for nodepools and clusters. More info here
It's mentioned in the docs, but we should probably also trigger a logging message when someone tries to do it.

So it is expected that the version is already the latest patch version? This doesn't seem to be visible in the Kubernetes Manager either, as it is still reported as 1.24.6. And there was definitely a maintenance window since 1.24.8 was available in the Manager.

Hi, from the k8s team. The upgrade only happens if the currently used version is no longer offered. The docs will be improved to mention that.
If you wish that your cluster is upgraded before that, as a workaround I would suggest upgrading the version from kubernetes manager.

I see, thanks for the clarification. I understand that patch updates cannot be performed via terraform.