Error: Rancher is not ready: Doing get: Get "https://192.168.1.128/ping": x509: certificate signed by unknown authority

Viewed 13

I have a Rancher docker image connected with native Kubernetes cluster.

Using Terraform script I want to implement configuration:

terraform {
  required_providers {
    rancher2 = {
      source = "rancher/rancher2"
      version = "1.24.1"
    }
  }
}

provider "rancher2" {
  api_url    = "https://192.168.1.128/v3"
  access_key = "token-mzn4m"
  secret_key = "d7n7t8bnb6l4477dbfp7hhcr2fvbw4kprhrzpfsjrpjtqbb4p85h4l"
}

resource "rancher2_cluster" "foo-imported" {
  name = "foo-imported"
  description = "Foo rancher2 imported cluster"
}

When I run the script I get:

rancher2_cluster.foo-imported: Creating...
rancher2_cluster.foo-imported: Still creating... [10s elapsed]
rancher2_cluster.foo-imported: Still creating... [20s elapsed]
rancher2_cluster.foo-imported: Still creating... [30s elapsed]
rancher2_cluster.foo-imported: Still creating... [41s elapsed]
rancher2_cluster.foo-imported: Still creating... [51s elapsed]
rancher2_cluster.foo-imported: Still creating... [1m1s elapsed]
rancher2_cluster.foo-imported: Still creating... [1m11s elapsed]
rancher2_cluster.foo-imported: Still creating... [1m21s elapsed]
rancher2_cluster.foo-imported: Still creating... [1m31s elapsed]
rancher2_cluster.foo-imported: Still creating... [1m41s elapsed]
rancher2_cluster.foo-imported: Still creating... [1m51s elapsed]
╷
│ Error: Rancher is not ready: Doing get: Get "https://192.168.1.128/ping": x509: certificate signed by unknown authority
│
│   with rancher2_cluster.foo-imported,
│   on main.tf line 16, in resource "rancher2_cluster" "foo-imported":
│   16: resource "rancher2_cluster" "foo-imported" {

Do you know how I can fix this?

0 Answers
Related