Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the variable "kubernetes_version" is not usable on module beta-private-cluster and safer-cluster #1279

Closed
maximeancellin opened this issue Jun 3, 2022 · 9 comments · Fixed by #1335
Labels
bug Something isn't working P2 high priority issues

Comments

@maximeancellin
Copy link

TL;DR

Hi,

When you try to define a value in variable kubernetes_version on module safer-cluster. the value isn't used on plan.
Case tested with all type of release channel (UNSPECIFIED included).

Expected behavior

I would force to use an available version of GKE and decide when I want to upgrade the master of GKE.

I gave a specific version to do it and set the release channel to UNSPECIFIED.

Observed behavior

When I plan my configuration Terraform take the version latest of the current release channel.

Terraform Configuration

module "gke" {
  source  = "terraform-google-modules/kubernetes-engine/google//modules/safer-cluster"
  version = "21.0.0"

  kubernetes_version     = "1.21.11-gke.1100" #This value is ignored
  release_channel        = "UNSPECIFIED"

Configuration:

  • Provider: registry.terraform.io/hashicorp/google
    Version: 4.22.0
  • Provider: registry.terraform.io/hashicorp/google-beta
    Version: 4.22.0


### Terraform Version

```sh
v1.2.1

Additional information

We cannot choose the Kubernetes version we want to deploy or when we want to perform upgrade (or manually on the console but it's not a goal to do this if we use Terraform)

The issue seems similar like this one: #675

Thanks by advance for your support.

@maximeancellin maximeancellin added the bug Something isn't working label Jun 3, 2022
@maximeancellin maximeancellin changed the title the variable "kubernetes_version" is not considered on module beta-private-cluster and safer-cluster the variable "kubernetes_version" is not usable on module beta-private-cluster and safer-cluster Jun 3, 2022
@pio2pio
Copy link

pio2pio commented Jun 13, 2022

Also suffering from this issue in v21.1.0. Set CP to v1.21.x, I can see in the plan the version I want but version 1.22.x (default gcloud version) gets deployed.

@lyonsj
Copy link

lyonsj commented Jun 22, 2022

As above, ver 21.1.0, make this module unusable for my purposes.

@jawnsy
Copy link

jawnsy commented Jun 27, 2022

I ran into this problem as well, except I was using:

module "cluster" {
  source  = "terraform-google-modules/kubernetes-engine/google//modules/beta-private-cluster-update-variant"
  version = "20.0.0"

  kubernetes_version = "latest"
  release_channel    = "REGULAR"

The problem seems to be that setting release_channel results in the version being ignored:

min_master_version = var.release_channel != null ? null : local.master_version

In my case, the resulting cluster version was the default version for new clusters (1.22.8) instead of the latest available (1.23.5) as I expected:

image

@pio2pio
Copy link

pio2pio commented Jun 29, 2022

In v21.2.0 instead of using UNSPECIFIED I use release_channel = null. This has resulted of creating the control-plane with the version specified in ie. kubernetes_version = 1.21.12-gke.2200.

@kakarot291994
Copy link

By replacing the value release_channel=UNSPECIFIED with release_channel = null , I was able to set the desired version for my gke , Seems the logic on line 62 of cluster.tf min_master_version = var.release_channel != null ? null : local.master_version is the culprit for that .
After using the settings I am able to select the desired version .

Could there be any particular reason for this logic?

@bharathkkb
Copy link
Member

Thanks for the report @maximeancellin and others. I merged a fix which should recognize UNSPECIFIED allowing to set a custom version.

@jawnsy
Copy link

jawnsy commented Jul 27, 2022

@bharathkkb Awesome, thank you!

Since the UI allows us to select a channel (e.g. REGULAR) with a specific version (1.23), is it possible to do the same in the module? Or to set a minimum version constraint?

Otherwise, the only option will be to always use the oldest supported version of a given channel (or manually upgrade)

@uRhos
Copy link

uRhos commented Aug 7, 2022

@bharathkkb will there be a fix where you can select an actual release channel and the version from that channel like in the UI?

@jawnsy
Copy link

jawnsy commented Aug 8, 2022

I've created this feature to track my request as it is separate from the original issue: #1356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 high priority issues
Projects
None yet
7 participants