Export the GOOGLE_APPLICATION_CREDENTIALS environment variable, containing the path to your GCP credentials file (e.g. export GOOGLE_APPLICATION_CREDENTIALS=~/.config/gcloud/myproject-8a41417a968a.json)
If you haven't done so already, enable the Kubernetes Engine API in your GCP project (here)
Spin up Cortex on your GCP account
# install the CLIpipinstallcortex# spin up Cortex on your GCP accountcortexcluster-gcpupcluster.yaml# (see configuration options below)
Configure Cortex
# cluster.yaml# GKE cluster namecluster_name:cortex# GCP project IDproject:<your GCP project ID># GCP zone for your clusterzone:us-east1-c# list of cluster node pools; the smaller index, the higher the priority of the node poolnode_pools: - name:np-cpu# name of the node poolinstance_type:n1-standard-2# instance type# accelerator_type: nvidia-tesla-t4 # GPU to attach to your instance (optional)# accelerators_per_instance: 1 # the number of GPUs to attach to each instance (optional)min_instances:1# minimum number of instancesmax_instances:5# maximum number of instancespreemptible:false# enable the use of preemptible instances - name:np-gpuinstance_type:n1-standard-2accelerator_type:nvidia-tesla-t4accelerators_per_instance:1min_instances:1max_instances:5preemptible:false...# the name of the network in which to create your cluster# network: default# the name of the subnetwork in which to create your cluster# subnet: default# API load balancer scheme [internet-facing | internal]api_load_balancer_scheme:internet-facing# operator load balancer scheme [internet-facing | internal]# note: if using "internal", you must be within the cluster's VPC or configure VPC Peering to connect your CLI to your cluster operatoroperator_load_balancer_scheme:internet-facing
The docker images used by the Cortex cluster can also be overridden, although this is not common. They can be configured by adding any of these keys to your cluster configuration file (default values are shown):