# dflow clusters:register

> Attach a private cluster to the current workspace. The kubeconfig is sent once and is not printed.

Web page: /docs/cli/project/clusters-register/

This attaches a cluster you already run to the current workspace. The kubeconfig is sent once and is not printed. Use this only when you already have a cluster. A first deploy on dFlow's machines does not need it.

```bash
dflow clusters:register --name NAME --region REGION --kubeconfig PATH
```

## Flags

`--name` and `--region` are required. The region is 2 to 32 lowercase letters, digits, or hyphens. `--kubeconfig` is the path to a kubeconfig that names a server. `--idempotency-key` is optional, so a retry does not register the cluster twice. The usual global flags still apply.

## What you see

The terminal prints `status`, `cluster`, and `operation`. Exit 0 when the operation status is `succeeded`.

## When it fails

A missing workspace exits 1. Exit 1 is also a missing flag, a bad region, or a kubeconfig that cannot be read. Exit 2: auth. Exit 5: the cluster check failed. Exit 6: a precondition failed, including a credential that was not stored. Exit 10: the API could not be reached.
