# Managing Environments

Most organizations have multiple "environments" that they deploy to. These are typically infrastructures for distinct deployment stages or purposes that are isolated from one another in some way(s), often physically and by ownership and permissions.

Typical dimensions of isolation include:

- Deployment Stage or Realm: development, staging, production
- Region: us-east, us-west, europe, etc.
- Kubernetes Cluster

In ConfigHub's [two-level authorization model](../background/concepts/authorization.md), you'd isolate distinct environments by [space](../background/entities/space.md) and by [worker](workers.md) (and therefore by [targets](../background/entities/target.md)).

We recommend that you use different spaces for different environments. You can add an `Environment` [label](../background/concepts/metadata.md) to each space to identify the environment to which it belongs.

With the CLI you can do that like this:

```
cub space create --label Environment=development app-dev
```

You may also choose to further subdivide spaces by application/service or team in order to facilitate self service, in which case we recommend adding [labels](../background/concepts/metadata.md), such as `Application`, to identify which application/service the spaces correspond to.

If you do that, you may also want to create a space for each environment to contain shared entities, such as [workers](../background/entities/worker.md), [targets](../background/entities/target.md), [views](../background/entities/view.md), and [filters](../background/entities/filter.md).

```
cub space create --label Environment=development platform-dev
```

[Triggers](../background/entities/trigger.md) are used to enforce constraint-based policies on configuration data. Triggers are registered at the space level, either by creating them in the space or by specifying which triggers apply to the space using a [where filter](../background/concepts/filters.md).

For example:

```
platformSpaceID="$(cub space get platform-prod -o jq='.Space.SpaceID')"
cub space create app-prod --label Environment=production --where-trigger "SpaceID = '$platformSpaceID'"
```
