rancher icon indicating copy to clipboard operation
rancher copied to clipboard

[BUG] Cattle-cleanup job for imported clusters not pulling from configured private registry

Open sachua opened this issue 3 years ago • 2 comments

Rancher Server Setup

  • Rancher version: 2.6.9
  • Installation option (Docker install/Helm Chart): Helm Chart
    • If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc): Generic, 1.21
  • Proxy/Cert Details: n/a

Information about the Cluster

  • Kubernetes version: 1.21
  • Cluster Type (Local/Downstream): Downstream
    • If downstream, what type of cluster? (Custom/Imported or specify provider for Hosted/Infrastructure Provider): Imported

User Information

  • What is the role of the user logged in? (Admin/Cluster Owner/Cluster Member/Project Owner/Project Member/Custom)
    • If custom, define the set of permissions:

Describe the bug

When deleting an imported cluster from Rancher Dashboard UI, the cattle-cleanup job that is created in the downstream cluster pulls from Dockerhub instead of the configured private registry.

To Reproduce

  1. Import a generic cluster
  2. Delete the generic cluster

Result

A cattle-cleanup job is created, but it pulls its image from Dockerhub and not the configured private registry for the cluster.

Expected Result

cattle-cleanup job should pull from the configured private registry

Screenshots

image image

Additional context

SURE-8712

sachua avatar Jan 05 '23 10:01 sachua

This issue is reproducible even in rancher-v2.9.0-rc3 and comes from https://github.com/rancher/rancher/blob/release/v2.9/pkg/controllers/management/usercontrollers/controller.go#L305

Internal ref: SURE-8712

skanakal avatar Jul 24 '24 06:07 skanakal

awaiting requested alpha to resume testing

Josh-Diamond avatar Aug 08 '24 17:08 Josh-Diamond

Ticket #40068 - Test Results - ✅

Verified on Rancher v2.9.1-rc1:

Scenario Test Case Result
1. Import downstream RKE1 cluster => delete imported cluster via Rancher => verify cattle-cleanup job
2. Import downstream RKE2 cluster => delete imported cluster via Rancher => verify cattle-cleanup job

Scenario 1 - ✅

  1. Fresh install of Rancher v2.9.1-rc1
  2. Provision a standalone cluster - ( I used RKE v1.6.1 w/ k8s v1.29.7-rancher1-1 )
  3. Once active, import the cluster into Rancher
  4. Wait for cluster to come up active in Rancher UI, then delete the imported cluster
  5. Verified - cluster successfully deletes from Rancher UI
  6. Using kubectl, describe the cattle-cleanup job and verify where cleanup-agent is pulled, using the following command:
kubectl describe job <job_name_here> -n default
  1. Verified - cleanup-agent image points to globally configured private registry; as expected

Scenario 2 - ✅

  1. Fresh install of Rancher v2.9.1-rc1
  2. Provision a standalone cluster - ( I used RKE2 w/ k8s v1.30.2+rke2r1 )
  3. Once active, import the cluster into Rancher
  4. Wait for cluster to come up active in Rancher UI, then delete the imported cluster
  5. Verified - cluster successfully deletes from Rancher UI
  6. Using kubectl, describe the cattle-cleanup job and verify where cleanup-agent is pulled, using the following command:
kubectl describe job <job_name_here> -n default
  1. Verified - cleanup-agent image points to globally configured private registry; as expected

Josh-Diamond avatar Aug 12 '24 22:08 Josh-Diamond