Skip to content

Feat: Trino Listener Integration #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6b917c7
add listener to roles
maltesander May 30, 2025
1691220
wip - adapt role and rolegroup access
maltesander Jun 2, 2025
2dcd4fc
remove unused error
maltesander Jun 2, 2025
f0f4c5e
fmt
maltesander Jun 2, 2025
2dda23e
fix tests
maltesander Jun 2, 2025
767e1c0
fmt
maltesander Jun 3, 2025
7ca532c
regenerated charts
maltesander Jun 3, 2025
6e607d8
add docs
maltesander Jun 3, 2025
f7a38d8
wip - working
maltesander Jun 5, 2025
ab6d4c9
make headless service name a function
maltesander Jun 5, 2025
0f80bf3
added tests
maltesander Jun 5, 2025
2ca405c
Merge branch 'main' into feat/trino-listener-integration
maltesander Jun 5, 2025
ecb48b5
adapted changelog
maltesander Jun 5, 2025
b36582d
move scripts to commons folder, fix tests
maltesander Jun 5, 2025
6061ae9
new lines
maltesander Jun 5, 2025
7d39acb
fix tls test
maltesander Jun 5, 2025
09c7fb4
fix authentication test
maltesander Jun 5, 2025
3d4e983
fix opa test
maltesander Jun 6, 2025
0f8e2cb
attempt to fix
maltesander Jun 6, 2025
5dd48d5
Merge branch 'main' into feat/trino-listener-integration
maltesander Jun 6, 2025
fcc2286
adapt getting started to listener
maltesander Jun 6, 2025
0c24393
use role level listener
maltesander Jun 17, 2025
4a90952
add lost comment
maltesander Jun 17, 2025
e9ce6e2
fix listener examples / comments
maltesander Jun 18, 2025
dd900e2
Apply suggestions from code review
maltesander Jun 18, 2025
b0c9874
Merge remote-tracking branch 'origin/main' into feat/trino-listener-i…
maltesander Jun 18, 2025
01e86d1
clippy
maltesander Jun 18, 2025
dc397c1
fix smoke test
maltesander Jun 18, 2025
d3684d1
fix tls test
maltesander Jun 18, 2025
665a4e7
fix authorization test
maltesander Jun 18, 2025
186aa3f
regenerate charts
maltesander Jun 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
- Use `--file-log-max-files` (or `FILE_LOG_MAX_FILES`) to limit the number of log files kept.
- Use `--file-log-rotation-period` (or `FILE_LOG_ROTATION_PERIOD`) to configure the frequency of rotation.
- Use `--console-log-format` (or `CONSOLE_LOG_FORMAT`) to set the format to `plain` (default) or `json`.
- Add Listener integration for Trino ([#753]).
- Add support for Trino 476 ([#755]).

### Changed
Expand Down Expand Up @@ -51,6 +52,7 @@ All notable changes to this project will be documented in this file.
[#745]: https://github.com/stackabletech/trino-operator/pull/745
[#748]: https://github.com/stackabletech/trino-operator/pull/748
[#752]: https://github.com/stackabletech/trino-operator/pull/752
[#753]: https://github.com/stackabletech/trino-operator/pull/753
[#755]: https://github.com/stackabletech/trino-operator/pull/755

## [25.3.0] - 2025-03-21
Expand Down
22 changes: 5 additions & 17 deletions deploy/helm/trino-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,6 @@ spec:
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
listenerClass:
default: cluster-internal
description: |-
This field controls which type of Service the Operator creates for this TrinoCluster:

* cluster-internal: Use a ClusterIP service

* external-unstable: Use a NodePort service

* external-stable: Use a LoadBalancer service

This is a temporary solution with the goal to keep yaml manifests forward compatible. In the future, this setting will control which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
enum:
- cluster-internal
- external-unstable
- external-stable
type: string
tls:
default:
internalSecretClass: tls
Expand Down Expand Up @@ -436,11 +419,16 @@ spec:
x-kubernetes-preserve-unknown-fields: true
roleConfig:
default:
listenerClass: cluster-internal
podDisruptionBudget:
enabled: true
maxUnavailable: null
description: This is a product-agnostic RoleConfig, which is sufficient for most of the products.
properties:
listenerClass:
default: cluster-internal
description: This field controls which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) is used to expose the coordinator.
type: string
podDisruptionBudget:
default:
enabled: true
Expand Down
9 changes: 7 additions & 2 deletions deploy/helm/trino-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,16 @@ rules:
verbs:
- get
- apiGroups:
- apiextensions.k8s.io
- listeners.stackable.tech
resources:
- customresourcedefinitions
- listeners
verbs:
- get
- list
- watch
- patch
- create
- delete
- apiGroups:
- events.k8s.io
resources:
Expand Down
3 changes: 2 additions & 1 deletion docs/modules/trino/examples/getting_started/code/trino.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ spec:
catalogLabelSelector:
matchLabels:
trino: simple-trino
listenerClass: external-unstable
coordinators:
roleConfig:
listenerClass: external-unstable
roleGroups:
default:
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ spec:
catalogLabelSelector:
matchLabels:
trino: simple-trino
listenerClass: external-unstable
coordinators:
roleConfig:
listenerClass: external-unstable
roleGroups:
default:
replicas: 1
Expand Down
21 changes: 11 additions & 10 deletions docs/modules/trino/pages/usage-guide/listenerclass.adoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
= Service exposition with ListenerClasses
:description: Configure Trino service exposure with ListenerClasses: cluster-internal, external-unstable, or external-stable.

Trino offers a web UI and an API, both are exposed by the `connector` xref:concepts:roles-and-role-groups.adoc[role].
The Operator deploys a service called `<name>-connector` (where `<name>` is the name of the TrinoCluster) through which Trino can be reached.

This service can have three different types: `cluster-internal`, `external-unstable` and `external-stable`.
Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level.

This is how the ListenerClass is configured:
The operator deploys a xref:listener-operator:listener.adoc[Listener] for the coodinator pod.
The listener defaults to only being accessible from within the Kubernetes cluster, but this can be changed by setting `.spec.coordinators.roleConfig.listenerClass`:

[source,yaml]
----
spec:
clusterConfig:
listenerClass: cluster-internal # <1>
coordinators:
roleConfig:
listenerClass: external-unstable # <1>
...
workers:
...
----
<1> The default `cluster-internal` setting.
<1> Specify a ListenerClass, such as `external-stable`, `external-unstable`, or `cluster-internal` (the default setting is `cluster-internal`).
This can be set only for the coordinator role.
2 changes: 1 addition & 1 deletion rust/operator-binary/src/config/jvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ mod tests {
let role = TrinoRole::Coordinator;
let rolegroup_ref = role.rolegroup_ref(&trino, "default");
let merged_config = trino.merged_config(&role, &rolegroup_ref, &[]).unwrap();
let coordinators = trino.spec.coordinators.unwrap();
let coordinators = trino.role(&role).unwrap();

let product_version = trino.spec.image.product_version();

Expand Down
Loading