When you create a cluster with cortex cluster up
, an environment named aws
or gcp
is automatically created to point to your cluster and is configured to be the default environment. You can name the environment something else via the --configure-env
flag, e.g. cortex cluster up --configure-env prod
. You can also use the --configure-env
flag with cortex cluster info
and cortex cluster configure
to create / update the specified environment.
You can list your environments with cortex env list
, change the default environment with cortex env default
, delete an environment with cortex env delete
, and create/update an environment with cortex env configure
.
cortex cluster up --config cluster1.yaml --configure-env cluster1 # configures the cluster1 envcortex cluster up --config cluster2.yaml --configure-env cluster2 # configures the cluster2 env​cortex deploy --env cluster1cortex logs my-api --env cluster1cortex delete my-api --env cluster1​cortex deploy --env cluster2cortex logs my-api --env cluster2cortex delete my-api --env cluster2
cortex cluster info --config cluster1.yaml --configure-env cluster1 # configures the cluster1 envcortex cluster info --config cluster2.yaml --configure-env cluster2 # configures the cluster2 env​cortex deploy --env cluster1cortex logs my-api --env cluster1cortex delete my-api --env cluster1​cortex deploy --env cluster2cortex logs my-api --env cluster2cortex delete my-api --env cluster2
If you are installing the cortex
CLI on a new machine, you can configure it to access an existing Cortex cluster.
On the machine which already has the CLI configured, run:
cortex env list
Take note of the environment name and operator endpoint of the desired environment.
On your new machine, run:
cortex env configure
This will prompt for the necessary configuration. Note that the AWS credentials that you use here do not need any IAM permissions attached. If you will be running any cortex cluster
commands specify the preferred AWS credentials using cli flags --aws-key AWS_ACCESS_KEY_ID --aws-secret AWS_SECRET_ACCESS_KEY
.