Skip to content

mattstep/pulumi-trino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pulumi-trino

A Pulumi project that deploys a Trino cluster on Kubernetes using the official Trino Helm chart, with an OpenTelemetry Collector for observability.

Supports two deployment targets via Go build tags:

  • EKS (default) -- provisions a VPC and EKS cluster on AWS, exposes Trino via LoadBalancer
  • Minikube -- uses a local minikube cluster with resource-constrained settings

What gets deployed

  • Trino (Helm chart v1.42.0) -- coordinator (and workers on EKS)
  • OpenTelemetry Collector (contrib image) -- receives:
    • Metrics -- scrapes Trino's native /metrics endpoint via Prometheus receiver
    • Logs -- receives Trino's structured JSON logs via TCP
    • Traces -- receives Trino's OpenTelemetry traces via OTLP gRPC

Prerequisites

For EKS:

For Minikube:

Deploying to EKS

  1. Login to Pulumi
  2. Deploy from the stack/ directory:
    cd stack
    pulumi up
    

Alternatively, use the Automation API entrypoint at the repo root to deploy remotely via Pulumi Deployments (update main.go to point to your organization first):

go run main.go

To destroy the stack:

cd stack
pulumi destroy

Deploying to Minikube

  1. Start minikube:

    minikube start --cpus=2 --memory=4096
    
  2. Deploy with the minikube build tag:

    cd stack
    GOFLAGS="-tags=minikube" pulumi login --local
    GOFLAGS="-tags=minikube" pulumi stack init dev
    GOFLAGS="-tags=minikube" pulumi up --yes
    

    The minikube build reads your local kubeconfig (~/.kube/config by default) and configures Trino with reduced resource limits (512M coordinator heap, no workers) to fit within a 4GB minikube VM.

  3. Verify Trino is running:

    SVC_NAME=$(kubectl get svc -l app.kubernetes.io/name=trino -o jsonpath='{.items[0].metadata.name}')
    kubectl port-forward "svc/$SVC_NAME" 8080:8080 &
    curl http://localhost:8080/v1/info
    

To destroy:

GOFLAGS="-tags=minikube" pulumi destroy --yes

Project structure

stack/
  main.go           -- entrypoint, calls deploy()
  stack.go          -- orchestration: creates cluster, deploys OTel collector and Trino
  observability.go  -- OpenTelemetry Collector Helm release and configuration
  eks.go            -- EKS cluster provisioning and Helm values (build tag: !minikube)
  minikube.go       -- local kubeconfig reader and Helm values (build tag: minikube)
  Pulumi.yaml       -- Pulumi project definition
main.go             -- Automation API entrypoint for remote EKS deployment

CI

A GitHub Actions workflow (.github/workflows/test-minikube.yml) runs on pushes and PRs to main. It deploys to minikube and verifies that Trino's /v1/info endpoint returns a 2xx response and the OTel collector is running.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages