Skip to main content

Manage Environments

An environment is a grouping of clusters and assets contained within an enterprise. Environments are a convenient way to group workloads by team, like dev, prod, and demos.

Usage and Options

Includes the given cluster within the given environment. DOES NOT modify any infrastructure; only creates an association within Codiac.

USAGE
$ codiac environment COMMAND

TOPICS
environment cluster Includes the given cluster within the given environment. DOES NOT modify any
infrastructure; only creates an association within Codiac.

COMMANDS
environment create Create a new environment for a given enterprise. Returns an error if the
environment already exists.
environment list Shows the list of environments.

Create an environment

  1. Use codiac environment create to create an environment.

  2. Follow the prompts to set the tenant, environment name, and cluster. Example:

$ codiac environment create
? Select a Tenant: abc
? Environment name: example-env
? Cluster to include: example-cluster (azure, southcentralus)
Creating new environment [main/example-env]......
Success! Environment [example-env] created for enterprise [main]

List environments

  1. Use codiac environment list to list all available environments.
$ codiac environment list
Retrieving... found 1
main enterprise:
└─ example-env example-cluster (azure, southcentralus)

Attach a cluster to an environment

info

This command creates a link between a cluster and an environment within Codiac. It does not modify any infrastructure.

  1. Use codiac environment cluster attach to link a cluster to an environment.

  2. Follow the prompts to select the environment and the cluster.

$ codiac environment cluster attach
? Environment: example-env (no cluster) Yes
? Attach Cluster: example-cluster
Success! Successfully attached cluster [example-cluster] to environment [main/example-env]

Detach a cluster from an environment

info

This command removes the link between a cluster and an environment within Codiac. It does not modify any infrastructure.

  1. Use codiac environment cluster detach to unlink a cluster from an environment.

  2. Follow the prompts to select the environment. If more than one cluster is attached to the environment, you will also be prompted to choose the cluster you want to detach.

$ codiac environment cluster detach
? Environment: example-env Yes
Success! Successfully detached cluster [example-cluster] from environment [main/example-env]