# Stackable Operator for Trino

> Manage Trino clusters on Kubernetes with the Stackable operator, featuring resource management, demos, and support for custom Trino versions.

-   [GitHub](https://github.com/stackabletech/trino-operator/)

-   [Feature Tracker](https://features.stackable.tech/unified)

-   [CRD documentation](https://crds.stackable.tech/trino-operator/26.7.0/)


This is an operator for Kubernetes that can manage [Trino](https://trino.io/) clusters. Trino is an open-source distributed SQL query engine that enables high-speed analytics of large datasets from multiple data sources using SQL queries. This operator enables you to manage your Trino instances on Kubernetes efficiently.

## Getting started

Follow the [Getting started guide](https://docs.stackable.tech/home/stable/trino/getting_started/index.md) to start using the Stackable operator for Trino on your Kubernetes cluster. It guides you through the installation process and help you run your first Trino queries on Kubernetes.

## Operator model

The operator manages Kubernetes resources in sync with [custom resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) defined by you, the user.

### Custom resources

The Trino operator manages two custom resources: The _TrinoCluster_ and [_TrinoCatalogs_](https://docs.stackable.tech/home/stable/trino/concepts/index.md). The TrinoCluster resource allows for the specification of a Trino cluster. Two [roles](https://docs.stackable.tech/home/stable/concepts/stacklet/index.md) are defined: `coordinators` and `workers`.

To connect to data sources the TrinoCatalogs are used. Have a look at the [catalog overview](https://docs.stackable.tech/home/stable/trino/usage-guide/catalogs/index.md) to find out which types of data sources are supported by the Stackable platform.

### Resources

To run the cluster on Kubernetes the operator creates Kubernetes resources such as ConfigMaps, StatefulSets and Services.

![A diagram depicting the Kubernetes resources created by the operator](https://docs.stackable.tech/home/stable/trino/_images/trino_overview.drawio.svg)

## Demos

The [trino-taxi-data](https://docs.stackable.tech/home/stable/demos/trino-taxi-data/index.md) demo uses Trino together with [Apache Hive](https://docs.stackable.tech/home/stable/hive/index.md) to access the prominent New York Taxi dataset. [Apache Superset](https://docs.stackable.tech/home/stable/superset/index.md) is then used to read the data from the Trino instance via SQL and visualize it.

The [data-lakehouse-iceberg-trino-spark](https://docs.stackable.tech/home/stable/demos/data-lakehouse-iceberg-trino-spark/index.md) demo showcases a data Lakehouse with multiple datasets. Again Trino is used to enable SQL access to the data. The [trino-iceberg](https://docs.stackable.tech/home/stable/demos/trino-iceberg/index.md) demo is a subset of the Lakehouse demo, focusing just on Apache Iceberg integration.

The [spark-k8s-anomaly-detection-taxi-data](https://docs.stackable.tech/home/stable/demos/spark-k8s-anomaly-detection-taxi-data/index.md) also uses Trino to enable SQL access to data but also shows [OpenPolicyAgent](https://docs.stackable.tech/home/stable/opa/index.md) integration for [authorization](https://docs.stackable.tech/home/stable/trino/usage-guide/security/index.md).

## Supported versions

The Stackable operator for Trino currently supports the Trino versions listed below. To use a specific Trino version in your TrinoCluster, you have to specify an image - this is explained in the [Product image selection](https://docs.stackable.tech/home/stable/concepts/product-image-selection/index.md) documentation. The operator also supports running images from a custom registry or running entirely customized images; both of these cases are explained under [Product image selection](https://docs.stackable.tech/home/stable/concepts/product-image-selection/index.md) as well.

-   481 (Please note that we use the [trino-storage](https://github.com/snowlift/trino-storage) connector version 477, as no newer version was available at the time of release)

-   479 (deprecated; Please note that we use the [trino-storage](https://github.com/snowlift/trino-storage) connector version 477, as no newer version was available at the time of release)

-   477 (LTS)


## Useful links

-   The [trino-operator](https://github.com/stackabletech/trino-operator/) GitHub repository

-   The operator feature overview in the [feature tracker](https://features.stackable.tech/unified)

-   The [TrinoCluster](https://crds.stackable.tech/26.7.0/trino.stackable.tech/trinocluster/v1alpha1/) and [TrinoCatalog](https://crds.stackable.tech/26.7.0/trino.stackable.tech/trinocatalog/v1alpha1/) CRD documentation
