Skip to content

Commit 09e8040

Browse files
authored
feat: Integrate listener operator (#731)
* add integration test * fix dns issue * update discovery cm * fix rustdoc * create headless service name in function * update integration tests with new headless service name * add external-access test * add permissions on listeners for service account * fix authorizer test * move listenerClass to roleConfig * add changelog entry * rename headless service * fix tls test * fix docs * remove unnecessary listener from test * create separate headless services and fix discovery cm * fix rustdocs * use listener scope for tls
1 parent eb1eef4 commit 09e8040

38 files changed

+1079
-377
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
1111
- Use `--file-log-rotation-period` (or `FILE_LOG_ROTATION_PERIOD`) to configure the frequency of rotation.
1212
- Use `--console-log-format` (or `CONSOLE_LOG_FORMAT`) to set the format to `plain` (default) or `json`.
1313
- Add support for `33.0.0` ([#722]).
14+
- Add Listener support for Druid ([#731]).
1415

1516
### Changed
1617

@@ -52,6 +53,7 @@ All notable changes to this project will be documented in this file.
5253
[#721]: https://github.com/stackabletech/druid-operator/pull/721
5354
[#722]: https://github.com/stackabletech/druid-operator/pull/722
5455
[#725]: https://github.com/stackabletech/druid-operator/pull/725
56+
[#731]: https://github.com/stackabletech/druid-operator/pull/731
5557

5658
## [25.3.0] - 2025-03-21
5759

deploy/helm/druid-operator/crds/crds.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,15 @@ spec:
245245
x-kubernetes-preserve-unknown-fields: true
246246
roleConfig:
247247
default:
248+
listenerClass: cluster-internal
248249
podDisruptionBudget:
249250
enabled: true
250251
maxUnavailable: null
251252
description: This is a product-agnostic RoleConfig, which is sufficient for most of the products.
252253
properties:
254+
listenerClass:
255+
default: cluster-internal
256+
type: string
253257
podDisruptionBudget:
254258
default:
255259
enabled: true
@@ -879,19 +883,6 @@ spec:
879883
type: string
880884
type: object
881885
type: object
882-
listenerClass:
883-
default: cluster-internal
884-
description: |-
885-
This field controls which type of Service the Operator creates for this DruidCluster:
886-
887-
* `cluster-internal`: Use a ClusterIP service * `external-unstable`: Use a NodePort service * `external-stable`: Use a LoadBalancer service
888-
889-
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.
890-
enum:
891-
- cluster-internal
892-
- external-unstable
893-
- external-stable
894-
type: string
895886
metadataStorageDatabase:
896887
description: Druid requires an SQL database to store metadata into. Specify connection information here.
897888
properties:
@@ -1182,11 +1173,15 @@ spec:
11821173
x-kubernetes-preserve-unknown-fields: true
11831174
roleConfig:
11841175
default:
1176+
listenerClass: cluster-internal
11851177
podDisruptionBudget:
11861178
enabled: true
11871179
maxUnavailable: null
11881180
description: This is a product-agnostic RoleConfig, which is sufficient for most of the products.
11891181
properties:
1182+
listenerClass:
1183+
default: cluster-internal
1184+
type: string
11901185
podDisruptionBudget:
11911186
default:
11921187
enabled: true
@@ -2720,11 +2715,15 @@ spec:
27202715
x-kubernetes-preserve-unknown-fields: true
27212716
roleConfig:
27222717
default:
2718+
listenerClass: cluster-internal
27232719
podDisruptionBudget:
27242720
enabled: true
27252721
maxUnavailable: null
27262722
description: This is a product-agnostic RoleConfig, which is sufficient for most of the products.
27272723
properties:
2724+
listenerClass:
2725+
default: cluster-internal
2726+
type: string
27282727
podDisruptionBudget:
27292728
default:
27302729
enabled: true

deploy/helm/druid-operator/templates/roles.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ rules:
8484
- customresourcedefinitions
8585
verbs:
8686
- get
87+
- apiGroups:
88+
- listeners.stackable.tech
89+
resources:
90+
- listeners
91+
verbs:
92+
- create
93+
- delete
94+
- get
95+
- list
96+
- patch
97+
- watch
8798
- apiGroups:
8899
- events.k8s.io
89100
resources:

docs/modules/druid/examples/getting_started/druid.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ spec:
77
image:
88
productVersion: 33.0.0
99
clusterConfig:
10-
listenerClass: external-stable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
1110
zookeeperConfigMapName: simple-druid-znode
1211
deepStorage:
1312
hdfs:
@@ -23,10 +22,14 @@ spec:
2322
roleGroups:
2423
default:
2524
replicas: 1
25+
roleConfig:
26+
listenerClass: external-stable # This exposes this role outside of Kubernetes. Remove this configuration if this is not desired
2627
coordinators:
2728
roleGroups:
2829
default:
2930
replicas: 1
31+
roleConfig:
32+
listenerClass: external-stable # This exposes this role outside of Kubernetes. Remove this configuration if this is not desired
3033
historicals:
3134
roleGroups:
3235
default:
@@ -39,6 +42,8 @@ spec:
3942
roleGroups:
4043
default:
4144
replicas: 1
45+
roleConfig:
46+
listenerClass: external-stable # This exposes this role outside of Kubernetes. Remove this configuration if this is not desired
4247
---
4348
apiVersion: v1
4449
kind: Secret

docs/modules/druid/examples/getting_started/druid.yaml.j2

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ spec:
77
image:
88
productVersion: 33.0.0
99
clusterConfig:
10-
listenerClass: external-stable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
1110
zookeeperConfigMapName: simple-druid-znode
1211
deepStorage:
1312
hdfs:
@@ -23,10 +22,14 @@ spec:
2322
roleGroups:
2423
default:
2524
replicas: 1
25+
roleConfig:
26+
listenerClass: external-stable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
2627
coordinators:
2728
roleGroups:
2829
default:
2930
replicas: 1
31+
roleConfig:
32+
listenerClass: external-stable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
3033
historicals:
3134
roleGroups:
3235
default:
@@ -39,6 +42,8 @@ spec:
3942
roleGroups:
4043
default:
4144
replicas: 1
45+
roleConfig:
46+
listenerClass: external-stable # This exposes your Stacklet outside of Kubernetes. Remove this configuration if this is not desired
4247
---
4348
apiVersion: v1
4449
kind: Secret

docs/modules/druid/pages/usage-guide/listenerclass.adoc

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
:description: Configure Apache Druid service exposure using ListenerClass to control service types: cluster-internal, external-unstable, or external-stable.
33

44
Apache Druid offers a web UI and an API, both are exposed by the `router` role.
5-
Other roles also expose API endpoints such as the `broker` and `coordinator`.
6-
The Operator deploys services called `<name>-<role>` (where `<name>` is the name of the DruidCluster and `<role>` is the role for the Service) through which Druid can be reached.
5+
The `broker` and `coordinator` roles expose additional API endpoints.
76

8-
These services can have three different types: `cluster-internal`, `external-unstable` and `external-stable`.
9-
Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level.
10-
11-
This is how the listener class is configured:
7+
The operator deploys a xref:listener-operator:listener.adoc[Listener] for the `router`, `broker` and `coordinator` roles.
8+
The Listener defaults to only being accessible from within the Kubernetes cluster, but this can be changed by configuring a ListenerClass
9+
for specific roles:
1210

1311
[source,yaml]
1412
----
1513
spec:
16-
clusterConfig:
17-
listenerClass: cluster-internal # <1>
14+
brokers:
15+
roleConfig:
16+
listenerClass: cluster-internal # <1>
17+
coordinators:
18+
roleConfig:
19+
listenerClass: cluster-internal # <1>
20+
routers:
21+
roleConfig:
22+
listenerClass: external-unstable # <1>
1823
----
19-
<1> The default `cluster-internal` setting.
20-
21-
This setting affects all role Services at once.
24+
<1> Specify one of `external-stable`, `external-unstable`, `cluster-internal` or a custom ListenerClass (the default setting is `cluster-internal`).

0 commit comments

Comments
 (0)