---
id: w1/m19.1/t002
title: Pivot (m19-t007 core) — clusterctl init + move, uninstall the bootstrap autoscaler
worker: worker1
status: done
estimate: 30m
depends_on: [w1/m19.1/t001]
---

## Objective

Make the app cluster self-managed: CAPI controllers and all machine records move from `bex-infra` into the cluster itself, so destroying `bex-infra` (t004) removes a machine, not a capability.

## Context

- Local `clusterctl` v1.13.2 matches CI's `CLUSTERCTL_VERSION`.
- `clusterctl init` needs the hetzner token secret in the app cluster's default ns first (same shape as the mgmt one: `kubectl create secret generic hetzner --from-literal=hcloud=$HCLOUD_TOKEN`).
- CAPI provider pods tolerate/prefer the CP by upstream default — t003 audit recorded "confirm placement at t007"; this is that confirmation.
- The Argo-managed in-cluster autoscaler (deploy/gitops/base/autoscaler.yaml, `incluster-incluster`) has been crashlooping pre-pivot (no CAPI CRDs) — expected to settle once CRDs + objects arrive.
- Two autoscalers must never co-manage the same MachineDeployments: uninstall the bootstrap release on mgmt at the same step.

## Steps

1. `kubectl create secret generic hetzner --from-literal=hcloud=$HCLOUD_TOKEN` on the app cluster (value from `.env`, never printed).
2. `clusterctl init --infrastructure hetzner:v1.1.7` against the app kubeconfig; wait for the four controller deployments Ready; confirm they landed on CP nodes.
3. `clusterctl move --to-kubeconfig <app.kubeconfig>` from the mgmt kubeconfig.
4. Verify in-cluster: `kubectl get machines -A` (app cluster) shows the 4 machines Running; KCP object present and Available.
5. `helm uninstall cluster-autoscaler` on the mgmt cluster; verify the in-cluster autoscaler pod goes Running (crashloop ends).

## Files

- No repo files — operational; findings logged into this task + m19 t006 op log.

## Acceptance criteria

- [ ] `kubectl get machines -n default` INSIDE the app cluster lists all machines Running; KCP Available=True.
- [ ] CAPI/CAPH pods running on CP nodes (placement confirmed, closes the t003-audit note).
- [ ] Bootstrap autoscaler gone from mgmt; in-cluster autoscaler Running ≥5m without restarts.

## Out of scope

- Destroying `bex-infra` (t004 — only after CI access is rewritten in t003).
