frank-at-suse/vsphere_rancher_cluster

Checking prerequisites

Closed this issue · 3 comments

Hi. Just wondering is there any requirement to copy and populate example.terraform.tfvars ahead of running:

> terraform apply -parallelism=1

Also, does this approach expect you to have a workable/compatible RKE2 vm template already on vSphere .. or does it generate one on your behalf?

Thanks for clarifying

Hi. Just wondering is there any requirement to copy and populate example.terraform.tfvars ahead of running:

> terraform apply -parallelism=1

The example.terraform.tfvars is just that - only an example to offer a bit of guidance/context on how to populate your own tfvars.

Also, does this approach expect you to have a workable/compatible RKE2 vm template already on vSphere .. or does it generate one on your behalf?

Thanks for clarifying

Yes, it does - the VM template will not be generated on your behalf - the template used by this example relies on a vanilla Ubuntu 20 Cloud Image that sits in a Content Library- nothing special/preconfigured about it beyond that.

Thanks @frank-at-suse
I've been playing around to get this to work ... adding values to terraform.tfvars file. It complained about missing cpi_chart_ver and csi_chart_ver missing from vsphere_env, so I appended these. Do these versions look right? Is there any expectation that these plugins are already in place on vSphere already?

vsphere_env = {
  cloud_image_name = "ubuntu-focal-20.04-cloudimg"
  compute_node     = "192.168.192.121"
  datacenter       = "Lab101"
  datastore        = "esxi-macbpro-001xxx"
  ds_url           = "ds:///vmfs/volumes/62796470-31d1634c-b222-000cxxxxxxx/"
  library_name     = "rancher-templates"
  server           = "192.168.192.100"
  user             = "Rancher@vsphere.local"
  vm_network       = "VM Network"
  cpi_chart_ver    = "1.2.1"
  csi_chart_ver    = "2.1.0"
}

I have rancher running locally on docker and passed https://192.168.192.62/v3 as api-url in the file .rancher-api-url, but I'm getting this problem with self-signed certs when I dry-run with terraform plan -parallelism=1. If I navigate to https://192.168.192.62/ping, I get pong. Is there any quick workaround to this? Thanks alot.

Error: Rancher is not ready: Doing get: Get "https://192.168.192.62/ping": x509: certificate signed by unknown authority
│
│   with data.rancher2_cloud_credential.auth,
│   on data.tf line 1, in data "rancher2_cloud_credential" "auth":
│    1: data "rancher2_cloud_credential" "auth" {

Thanks @frank-at-suse I've been playing around to get this to work ... adding values to terraform.tfvars file. It complained about missing cpi_chart_ver and csi_chart_ver missing from vsphere_env, so I appended these. Do these versions look right? Is there any expectation that these plugins are already in place on vSphere already?

vsphere_env = {
  cloud_image_name = "ubuntu-focal-20.04-cloudimg"
  compute_node     = "192.168.192.121"
  datacenter       = "Lab101"
  datastore        = "esxi-macbpro-001xxx"
  ds_url           = "ds:///vmfs/volumes/62796470-31d1634c-b222-000cxxxxxxx/"
  library_name     = "rancher-templates"
  server           = "192.168.192.100"
  user             = "Rancher@vsphere.local"
  vm_network       = "VM Network"
  cpi_chart_ver    = "1.2.1"
  csi_chart_ver    = "2.1.0"
}

I have rancher running locally on docker and passed https://192.168.192.62/v3 as api-url in the file .rancher-api-url, but I'm getting this problem with self-signed certs when I dry-run with terraform plan -parallelism=1. If I navigate to https://192.168.192.62/ping, I get pong. Is there any quick workaround to this? Thanks alot.

Error: Rancher is not ready: Doing get: Get "https://192.168.192.62/ping": x509: certificate signed by unknown authority
│
│   with data.rancher2_cloud_credential.auth,
│   on data.tf line 1, in data "rancher2_cloud_credential" "auth":
│    1: data "rancher2_cloud_credential" "auth" {

api-url only needs to be the URL that your Rancher instance exists on - no need to append v3 or anything to the end of it