# Identity selection and workstation defaults

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> Ringleader builds each cloud workstation with one CloudIdentity from its namespace, whose defaults and overrides shape the workstation.


Ringleader builds each cloud workstation with exactly one CloudIdentity from the workstation's
namespace. That identity supplies the credentials and the placement, and its defaults and
overrides decide what the workstation's own settings can change.

## Identity selection

When a [Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/) routes to a cloud provider, Ringleader
picks a CloudIdentity from the same namespace. Its `spec.provider` must match, and its
`spec.selector.matchLabels` must match the workstation's labels. If several match, the identity with the
highest `priority` wins, and ties are broken by name.

An empty selector matches all workstations. A high-priority catch-all can therefore silently outrank
scoped identities, so keep catch-alls at `priority: 0`.

Identities are not merged. A narrowly scoped, high-priority identity must carry everything the
workstations it wins need, including its credential path, not just the field that makes it special.

An identity that sets `requireUse` is used only for workstations whose owner holds the `use` right on
it. [Restricted cloud identities](https://docs-stg.ringleader.dev/cloud-accounts/cloud-identities/restricted-identities/)
says how that changes the choice.

An Edge picks its identity by a different rule, which
[Cloud identity of an Edge](https://docs-stg.ringleader.dev/reference/resources/edge/#cloud-identity-of-an-edge)
describes. So an Edge and a workstation in one namespace can use different identities.

## Defaults and overrides

`defaultProviderConfig` and `overrideProviderConfig` mirror a workstation's own `spec.providerConfig`,
which is a map with one block per provider. Ringleader applies them in a fixed order. The default
comes first, the workstation's own `providerConfig` replaces it, and the override replaces both.

- A **default** supplies a value that a workstation may change, such as a machine type for the whole fleet.
- An **override** forces a value whatever the workstation says, such as a project and zone that policy pins.

A member may change a default only for the keys that size the workstation, label it or ask for a public
address. The keys that place it and shape its network are yours to set on the CloudIdentity, such as a
project, zone, network or subnet. See
[Keys you set and keys an administrator sets](https://docs-stg.ringleader.dev/workstations/providers/cloud/#keys-you-set-and-keys-an-administrator-sets).
A default for one of them therefore holds unless you widen the list of keys a member may set.
[Placement delegation](https://docs-stg.ringleader.dev/cloud-accounts/cloud-identities/placement-delegation/)
shows how.

## Choose the identity for a group of workstations

To give some workstations their own placement, write a second CloudIdentity for them.

1. In the new identity, set `spec.provider` to the workstation's cloud.
1. Under `spec.selector.matchLabels`, name a label that only those workstations carry.
1. Set a `priority` higher than the identity the other workstations use.
1. Give the identity its own credential path and placement.

Ringleader then picks the new identity for every workstation that carries the label, because identities
are not merged. The [CloudIdentity](https://docs-stg.ringleader.dev/reference/resources/cloudidentity/) reference shows a
complete identity for each cloud.

## Check which identity a workstation uses

A workstation's status names the identity that selected it in `cloudIdentity`, and reads
`<none matched>` when none does. The [Workstation](https://docs-stg.ringleader.dev/reference/resources/workstation/) reference
lists the status fields.

## Next steps

- [Restricted cloud identities](https://docs-stg.ringleader.dev/cloud-accounts/cloud-identities/restricted-identities/):
  limit an identity to the people you choose.
- [Placement delegation](https://docs-stg.ringleader.dev/cloud-accounts/cloud-identities/placement-delegation/):
  let members set keys that are otherwise yours alone.
- [Cost allocation labels](https://docs-stg.ringleader.dev/cloud-accounts/cloud-identities/cost-allocation-labels/):
  put labels on every workstation an identity builds.

