backend/scripts/tenant_cleanup/QUICK_START_NO_BASTION.md
# Navigate to backend directory
cd onyx/backend
# Step 1: Generate CSV of tenants to clean (5-10 min)
PYTHONPATH=. python scripts/tenant_cleanup/no_bastion_analyze_tenants.py
# Step 2: Mark connectors for deletion (1-2 min)
PYTHONPATH=. python scripts/tenant_cleanup/no_bastion_mark_connectors.py \
--csv gated_tenants_no_query_3mo_*.csv \
--force \
--concurrency 16
# ⏰ WAIT 6+ hours for background deletion to complete
# Step 3: Final cleanup (1-2 min)
PYTHONPATH=. python scripts/tenant_cleanup/no_bastion_cleanup_tenants.py \
--csv gated_tenants_no_query_3mo_*.csv \
--force
Instead of the original scripts that require bastion access:
analyze_current_tenants.py → no_bastion_analyze_tenants.pymark_connectors_for_deletion.py → no_bastion_mark_connectors.pycleanup_tenants.py → no_bastion_cleanup_tenants.pyNo environment variables needed! All queries run directly from pods.
✅ kubectl access to your cluster
✅ Running celery-worker-user-file-processing pods
✅ Permission to exec into pods
❌ No bastion host required ❌ No SSH keys required ❌ No environment variables required
# Check if you can find worker pods
kubectl get po | grep celery-worker-user-file-processing | grep Running
# If you see pods, you're ready to go!
kubectl logs -f <celery-worker-pod>gated_tenants_no_query_3mo_YYYYMMDD_HHMMSS.csv - List of tenants to cleancleaned_tenants.csv - Successfully cleaned tenants with timestampsThe scripts include multiple safety checks:
--force)See NO_BASTION_README.md for: