You just need to keep the CLUSTER_NAME-ca
and CLUSTER_NAME-talos
secrets around.
To do this you an remove the owner reference from them.
cluster_name="example-cluster"
for secret in "${cluster_name}-ca" "${cluster_name}-talos"; do
kubectl patch "${secret}" --type=json --patch="$(cat <<EOF
- op: remove
path: /metadata/ownerReferences
EOF
)"
done
Then you can proceed with deleting and recreating the cluster resources.