terraform-provider-rancher2 icon indicating copy to clipboard operation
terraform-provider-rancher2 copied to clipboard

[BUG] multiple resources reporting "Unknown schema type [catalog.cattle.io.clusterrepo]" on fresh cluster

Open pneigel-ca opened this issue 2 years ago • 5 comments

Rancher Server Setup

  • Rancher version: 2.6.9
  • Installation option: Helm on EKS

Information about the Cluster

  • Kubernetes version: v1.24.8-rancher1-1
  • Cluster Type (Local/Downstream): Downstream vSphere Provisioned

User Information

  • What is the role of the user logged in? Global admin

Provider Information

  • What is the version of the Rancher v2 Terraform Provider in use? 1.24.1
  • What is the version of Terraform in use? 1.1.7

Describe the bug

When provisioning a new downstream cluster with terraform and automation, the cluster is created but resources in the downstream cluster encounter an error. Re-applying the same terraform after a short period of time works without issue.

To Reproduce

Create a fresh, moderate sized cluster (~20min to create) and deploy resources to the clusters' namespaces.

Actual Result

Creating resources fails with an odd error, but can be reapplied without issue or modification.

Expected Result

Cluster sync should understand when the cluster is ready for resource provisioning.

Other information

Similar issue which was "resolved" here, newer reports of the issue are almost identical so I opened a new issue: https://github.com/rancher/terraform-provider-rancher2/issues/662

We use rancher2_cluster_sync resources to ensure the cluster is up and available. Re-applying the same code with no changes works without issue.

Fail: image

Rerun: image

We are experiencing the problem with both rancher2_catalog_v2 as well as rancher2_app_v2 resources.

resource "rancher2_cluster_sync" "sync" {
  cluster_id    = rancher2_cluster.cluster.id
  node_pool_ids = [rancher2_node_pool.controlplane.id, rancher2_node_pool.etcd.id, rancher2_node_pool.workers.id]
  timeouts {
    create = "60m"
    update = "60m"
    delete = "60m"
  }
}

resource "rancher2_catalog_v2" "github_helm" {
  cluster_id       = rancher2_cluster_sync.sync.id
  name             = "github-helm-repo"
  git_repo         = "https://myrepo.domain/my-org/HELM-CHARTS.git"
  git_branch       = "gh-pages"
  secret_name      = "helm-repo"
  secret_namespace = data.rancher2_namespace.default.id
}

resource "rancher2_app_v2" "logging" {
  cluster_id    = rancher2_cluster_sync.sync.id
  name          = "rancher-logging"
  namespace     = "cattle-logging-system"
  repo_name     = "rancher-charts"
  chart_name    = "rancher-logging"
  chart_version = "100.1.2+up3.17.4"
}

pneigel-ca avatar Feb 01 '23 22:02 pneigel-ca