rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
253 stars 218 forks source link

[BUG] OutdatedUbuntu image is used for DigitalOcean node templates by default #1215

Closed felipe-colussi closed 7 months ago

felipe-colussi commented 10 months ago

Note: This issue has been updated to be specifically about changing default DO image to match one in Rancher support matrix.

Rancher Server Setup

Information about the Cluster

felipe-colussi commented 10 months ago

Validation Template

Root Cause

RKE Digital ocean Image was outdated.

What was fixed, or what change have occurred

The default value of the Digital Ocean Image was changed.

Areas or cases that should be tested

What areas could experience regressions

None.

Are the repro steps accurate/minimal?

Adding the hole TF file to be easier.
OBS: This TF is configured to use a local tf, probably you will need to change the provider.

do_test.zip

Josh-Diamond commented 8 months ago

Ticket #1215 - Test Results - :x: - RE-OPENED

Verified on Rancher v2.8-5b42ca50475398112661c80ac2b9070d5bacfb24-head with tfp-rancher2 v4.0.0-rc4:

Scenario Test Case Result
1. Provision downstream DO RKE1 cluster, using default image in node template resource :x:

Scenario 1 -

  1. Fresh install of Rancher v2.8-head
  2. Using the main.tf outlined below, provision a downstream DO RKE1 node driver cluster, using tfp-rancher2 v4.0.0-rc4
  3. Veri-FAILED: Cluster fails to provision. error creating machine is encountered, the instance is torn down and a new one provisioned in its place, which then encounters the same error, and this continually repeats and loops.

Screenshot: image (39)

main.tf

terraform {
  required_providers {
    rancher2 = {
      source  = "terraform.local/local/rancher2"
      version = "4.0.0-rc4"
    }
  }
}

provider "rancher2" {
  api_url   = "<REDACTED>"
  token_key = "<REDACTED>"
  insecure  = true
}

resource "rancher2_node_template" "rancher2_node_template" {
  name = "qa-testing-jkeslar-plz-deletee"
  digitalocean_config {
    access_token  = "<REDACTED>"
    ipv6 = false
    monitoring = false
    private_networking = false
    region = "nyc3"
    size = "s-2vcpu-4gb-intel"
    ssh_key_fingerprint=    ""
    ssh_port = "22"
    ssh_user =  "root"
    tags =""
    userdata= ""
  }
}

resource "rancher2_cluster" "rancher2_cluster" {
  depends_on = [rancher2_node_template.rancher2_node_template]
  name       = "jkeslar-qa-testing-plz-deletee"
  rke_config {
    kubernetes_version = "v1.27.6-rancher1-1"
    network {
      plugin = "canal"
    }
  }
}

resource "rancher2_node_pool" "pool1" {
  depends_on       = [rancher2_cluster.rancher2_cluster]
  cluster_id       = rancher2_cluster.rancher2_cluster.id
  name             = "pool1"
  hostname_prefix  = "jkeslar-pool1-"
  node_template_id = rancher2_node_template.rancher2_node_template.id
  quantity         = 1
  control_plane    = true
  etcd             = true
  worker           = true
}
snasovich commented 7 months ago

Per offline discussions, this issue was updated to be specifically about switching default Ubuntu from 16.04 to 22.04, which should be validated as part of this issue. Note there is a known issue with Rancher (https://github.com/rancher/rancher/issues/43586) that will result in provisioning failing however new behavior is not making matters any worse than they were before the default switch and the issue will be addressed on the Rancher side not even requiring TF provider changes. Moving "To Test". FYI @Josh-Diamond

Josh-Diamond commented 7 months ago

Ticket #1215 - Test Results - ✅

Verified w/ tfp-rancher2 v4.0.0-rc5:

terraform plan

Screenshot 2023-12-12 at 4 58 00 PM

Verified - digital ocean node template image now defaults to ubuntu-22-04-x64; as expected