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

Can not import a cluster with terraform-provider-rke V1.4.3. #432

Closed
LefterisBanos opened this issue Nov 24, 2023 · 3 comments
Closed

Can not import a cluster with terraform-provider-rke V1.4.3. #432

LefterisBanos opened this issue Nov 24, 2023 · 3 comments
Assignees
Milestone

Comments

@LefterisBanos
Copy link

Terraform: v1.5.0
RKE Terraform Provider: v1.4.3
RKE Cluster: v1.26.9-rancher1-1
RKE: 1.4.7

When importing a cluster using latest 1.4.3 version of the provider getting following error :
Error: │ ============= RKE outputs ============== │ time="2023-11-23T15:27:29+02:00" level=info msg="Creating RKE cluster..." │ │ kubernetes version v1.26.9-rancher1-1 requires enable_cri_dockerd to be set to true

Although is set: enable_cri_dockerd: true

How to reproduce:
Use a cluster.yaml file and a cluster.rkestate file for a running cluster created from RKE CLI.
At the cluster.yaml set the enable_cri_dockerd: true.

Import cluster using terraform-provider-rke:

terraform import rke_cluster.qa cluster.yml:cluster.rkestate.

Import will fail, even if enable_cri_dockerd is properly set to true

leftyb pushed a commit to leftyb/terraform-provider-rke that referenced this issue Nov 28, 2023
enable_cri_dockerd =  true
fixes rancher#432
@jiaqiluo jiaqiluo added this to the v1.4.4 milestone Nov 29, 2023
@Jono-SUSE-Rancher Jono-SUSE-Rancher modified the milestones: v1.4.4, v1.4.5 Mar 12, 2024
@jiaqiluo jiaqiluo self-assigned this Mar 18, 2024
@jiaqiluo jiaqiluo reopened this Mar 20, 2024
@jiaqiluo
Copy link
Member

Waiting for RC

@jiaqiluo
Copy link
Member

@Josh-Diamond
Copy link

Ticket # 432 - Test Results - ✅

Reproduced with RKE v1.4.7 and TFP-RKE v1.4.3:

  1. Using RKE v1.4.7 -- create a standalone RKE cluster using the following cluster.yml:
ssh_key_path: <path_to_ssh_key_here>
enable_cri_dockerd: true
kubernetes_version: v1.26.6-rancher1-1

nodes:
  - address: <REDACTED>
    internal_address: <REDACTED>
    user: ubuntu
    role: [etcd, controlplane, worker]

  - address: <REDACTED>
    internal_address: <REDACTED>
    user: ubuntu
    role: [etcd, controlplane, worker]

  - address: <REDACTED>
    internal_address: <REDACTED>
    user: ubuntu
    role: [etcd, controlplane, worker]
  1. Once cluster is up and active, create a main.tf file with the following configurations, and run terraform init:
terraform {
  required_providers {
    rke = {
      source = "rancher/rke"
      version = "1.4.3"
    }
  }
}

provider "rke" {}

resource "rke_cluster" "rke_cluster" {}
  1. Once terraform has been successfully initialized, import the standalone RKE cluster created in step 1, by running the following command:
terraform import rke_cluster.rke_cluster cluster.yml:cluster.rkestate
  1. Reproduced - kubernetes version v1.26.6-rancher1-1 requires enable_cri_dockerd to be set to true

Screenshot:
Screenshot 2024-03-26 at 10 27 25 AM


Verified with RKE v1.4.7 and TFP-RKE v1.4.5-rc1:

  1. Using RKE v1.4.7 -- create a standalone RKE cluster using the following cluster.yml:
ssh_key_path: <path_to_ssh_key_here>
enable_cri_dockerd: true
kubernetes_version: v1.26.6-rancher1-1

nodes:
  - address: <REDACTED>
    internal_address: <REDACTED>
    user: ubuntu
    role: [etcd, controlplane, worker]

  - address: <REDACTED>
    internal_address: <REDACTED>
    user: ubuntu
    role: [etcd, controlplane, worker]

  - address: <REDACTED>
    internal_address: <REDACTED>
    user: ubuntu
    role: [etcd, controlplane, worker]
  1. Once cluster is up and active, create a main.tf file with the following configurations, and run terraform init:
terraform {
  required_providers {
    rke = {
      source = "terraform.local/local/rke"
      version = "1.4.5-rc1"
    }
  }
}

provider "rke" {}

resource "rke_cluster" "rke_cluster" {}
  1. Once terraform has been successfully initialized, import the standalone RKE cluster created in step 1, by running the following command:
terraform import rke_cluster.rke_cluster cluster.yml:cluster.rkestate
  1. Verified - cluster successfully imports; as expected

Screenshot:
image(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants