rancher / terraform-provider-rke

Terraform provider plugin for deploy kubernetes cluster by RKE(Rancher Kubernetes Engine)
Mozilla Public License 2.0
340 stars 152 forks source link

[v1.6] Bump Go to 1.22 and RKE to 1.6.2 #462

Closed jiaqiluo closed 1 month ago

jiaqiluo commented 1 month ago

https://github.com/rancher/terraform-provider-rke/issues/460

This PR includes the following updates:

Testing

Since there is no CI available to run tests on the PR, all tests are executed locally using make test.

The basic functionality has also been verified.

Below is the Terraform configuration file used to create a one-node RKE cluster with all roles. Note that Terraform is configured to use the binary built from the PR:

# main.tf

terraform {
  required_providers {
    rke = {
      source = "rancher/rke"
      version = "1.4.4"
    }
  }
}

# Configure the RKE provider
provider "rke" {
  debug = true
  log_file = "./logfile.txt"
}
resource rke_cluster "cluster" {
  enable_cri_dockerd = "true"
  kubernetes_version = "v1.30.4-rancher1-1"
  nodes {
    address = "x.xx.x.x"
    internal_address = "x.xx.x.x"
    user    = "root"
    role    = ["controlplane", "etcd", "worker"]
  }

resource "local_file" "kube_cluster_yaml" {
  filename = "${path.root}/kube_config_cluster.yml"
  content  = rke_cluster.cluster.kube_config_yaml
}