Terraform GKE Helix Cluster
- Install
terraform
brew install terraform
- Install
google-cloud-sdk
to get thegcloud
CLI
brew install --cask google-cloud-sdk
- Ensure you have sufficient quota for an
L4
GPU. See the GCP docs for more details.
- Clone this repository and cd into the directory:
git clone https://github.com/helixml/terraform-gke-helix.git
cd terraform-gke-helix
- Log into GCP:
gcloud init
gcloud auth application-default login
- Edit the configuration in the
terraform.tfvars
file to match your account. - Initialize the Terraform workspace:
terraform init
Now deploy the infra.
terraform apply
gcloud container clusters get-credentials $(terraform output -raw kubernetes_cluster_name) --region $(terraform output -raw region) --project $(terraform output -raw project_id)
You may need to install gke-gcloud-auth-plugin to gain access to the cluster.
Now you can install Helix by following the Helix Kubernetes installation documentation.
Here is some useful information when you configure the runner:
- the default GPU type in the
terraform.tfvars
is an L4 with 24GB GPU ram. So--set runner.memory=24GB
. - by default there's a single node with a GPU. So install everything on the same node (no selector) and
--set replicaCount=1
For example:
export LATEST_RELEASE=$(curl -s https://get.helix.ml/latest.txt)
helm upgrade --install my-helix-runner helix/helix-runner \
--set runner.host="http://my-helix-controlplane" \
--set runner.token="oh-hallo-insecure-token" \
--set runner.memory=24GB \
--set replicaCount=1 \
--set runner.axolotl="false" \
--set image.tag="${LATEST_RELEASE}-small"
The default kubernetes installation is locked down. You can access Helix via port-forwarding from your machine.
kubectl port-forward svc/my-helix-controlplane 8080:80
And visit: http://localhost:8080/
Take a look at the user documentation to learn how to use Helix.
terraform destroy