---
id: w1/m19/t007
title: Pivot to self-managed: clusterctl move, in-cluster autoscaler, destroy bex-infra
worker: worker1
status: done
estimate: 45m
depends_on: [w1/m19/t006]
---

## Objective

Make the new cluster manage its own machines (CAPI bootstrap-and-pivot), switch the autoscaler to its in-cluster mode, and retire the pet management node.

## Context

- `clusterctl init --infrastructure hetzner:v1.1.7` on the NEW app cluster (needs the hetzner token secret in its default ns).
- `clusterctl move --to-kubeconfig <app>` from the k3s mgmt cluster - Cluster/Machine/templates migrate; KCP + CAPH controllers now reconcile in-cluster. **At pivot, `helm uninstall cluster-autoscaler` on the mgmt cluster** (the bootstrap-phase release) - the Argo-managed in-cluster autoscaler (`incluster-incluster`, deploy/gitops/base/autoscaler.yaml) takes over; two autoscalers must never manage the same MachineDeployments.
- Autoscaler: CA_TAG=v1.31.5 scripts/install-autoscaler.sh against the app cluster (incluster-incluster values from t004); Argo adopts it + the CAPI Application (t004) on next sync.
- `terraform destroy -target` the bex-infra server (definition retained for DR bootstrap); update docs/ADR019-infra-credentials.md trust-chain section (mgmt cert path is gone; app cluster is root).

## Steps

1. Init, move, verify machines reconcile in-cluster (scale a pool by annotation and watch), install autoscaler, destroy node, update doc.

## Files

- docs/ADR019-infra-credentials.md (trust chain update)
- docs/ADR002-architecture.md (two-clusters diagram becomes one self-managed cluster + disposable bootstrap)

## Acceptance criteria

- [ ] `kubectl get machines -n default` works INSIDE the app cluster and shows all machines Running.
- [ ] KCP Available=True in-cluster; a test MachineDeployment scale converges.
- [ ] Autoscaler pod healthy in-cluster (no kubeconfig secret mounted); Argo shows cluster-api + autoscaler apps Synced.
- [ ] Hetzner shows no bex-infra server; `terraform plan` shows it as intentionally absent/targeted-out.

## Out of scope

- k8s version upgrade (first follow-up after a working KCP, not this milestone).
