Deploy on GCP
Run Hive on your own Google Cloud infrastructure using Google Kubernetes Engine (GKE).
Prerequisites
- A GCP project with billing enabled
gcloudCLI installed and authenticatedkubectlinstalled
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-aDeploy the Hive controller
kubectl apply -f https://install.hive.run/operator/gcp.yamlCreate a secret with your GCP service account key:
kubectl create secret generic hive-gcp-credentials \
--from-file=key.json=/path/to/service-account-key.jsonApply 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.04Verify
kubectl get hivecluster hive
# NAME STATUS ENDPOINT AGE
# hive Ready https://hive.internal.example 2mConnect 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