Deploy on GCP

Run Hive on your own Google Cloud infrastructure using Google Kubernetes Engine (GKE).

Prerequisites

  • A GCP project with billing enabled
  • gcloud CLI installed and authenticated
  • kubectl installed

Create a GKE cluster

gcloud container clusters create hive-cluster \
  --zone us-central1-a \
  --num-nodes 3 \
  --machine-type n2-standard-4

gcloud container clusters get-credentials hive-cluster --zone us-central1-a

Deploy the Hive controller

kubectl apply -f https://install.hive.run/operator/gcp.yaml

Create a secret with your GCP service account key:

kubectl create secret generic hive-gcp-credentials \
  --from-file=key.json=/path/to/service-account-key.json

Apply the cluster config:

file.yaml
apiVersion: hive.run/v1
kind: HiveCluster
metadata:
  name: hive
spec:
  provider: gcp
  project: my-gcp-project
  region: us-central1
  credentials:
    secretRef: hive-gcp-credentials
  sandboxes:
    maxConcurrent: 100
    defaultImage: ubuntu:24.04

Verify

kubectl get hivecluster hive
# NAME   STATUS   ENDPOINT                        AGE
# hive   Ready    https://hive.internal.example   2m

Connect the TypeScript client

Pass gatwayUrl to point the SDK at your deployed controller:

index.ts
import { getOrCreateSandbox, shutdown } from "hive";

const sandbox = await getOrCreateSandbox("my-sandbox", {
  fs: [{ backend: "local", mount: "/workspace", acls: [{ path: "/workspace/**", access: "rw" }] }],
}, {
  gatwayUrl: "https://hive.internal.example",
});

Next: AWS