You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: expose services with listener classes (#562)
* add listener.rs and replace usages of CurrentlySupportedListenerClasses
* expose history pods via listener classes
* expose spark connect pods via listener classes
* update changelog
* connect: use persistent volumes for listener and move from deplument to stateful set
Decided to move to stateful set because deployments don't support volume
claim templates.
* history: use persistent columes for listener volumes
* history: create group listeners and update crd
* history: remove services created by the operator and update test
* connect: create server listeners and update crd
* history: refactor to use listener::build_listener
* connect: remove traces of deployment
* history: refactor rbac as per todo
* docs: update
* chore: remove set command to make jenkins test work
* Update CHANGELOG.md
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
* Update rust/operator-binary/src/connect/server.rs
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
* Update rust/operator-binary/src/crd/history.rs
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
* doc: mention cluster_config usage status
* review feedback
---------
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
Copy file name to clipboardExpand all lines: deploy/helm/spark-k8s-operator/crds/crds.yaml
+18-40
Original file line number
Diff line number
Diff line change
@@ -1118,27 +1118,11 @@ spec:
1118
1118
description: A Spark cluster history server component. This resource is managed by the Stackable operator for Apache Spark. Find more information on how to use it in the [operator documentation](https://docs.stackable.tech/home/nightly/spark-k8s/usage-guide/history-server).
1119
1119
properties:
1120
1120
clusterConfig:
1121
-
default:
1122
-
listenerClass: cluster-internal
1123
-
description: Global Spark history server configuration that applies to all roles and role groups.
1124
-
properties:
1125
-
listenerClass:
1126
-
default: cluster-internal
1127
-
description: |-
1128
-
This field controls which type of Service the Operator creates for this HistoryServer:
1129
-
1130
-
* cluster-internal: Use a ClusterIP service
1131
-
1132
-
* external-unstable: Use a NodePort service
1133
-
1134
-
* external-stable: Use a LoadBalancer service
1121
+
default: {}
1122
+
description: |-
1123
+
Global Spark history server configuration that applies to all roles.
1135
1124
1136
-
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/stable/listener-operator/listenerclass.html> will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
1137
-
enum:
1138
-
- cluster-internal
1139
-
- external-unstable
1140
-
- external-stable
1141
-
type: string
1125
+
This was previously used to hold the listener configuration, which has since moved to the role configuration.
1142
1126
type: object
1143
1127
image:
1144
1128
anyOf:
@@ -1395,6 +1379,9 @@ spec:
1395
1379
cleaner:
1396
1380
nullable: true
1397
1381
type: boolean
1382
+
listenerClass:
1383
+
nullable: true
1384
+
type: string
1398
1385
logging:
1399
1386
default:
1400
1387
containers: {}
@@ -1641,6 +1628,9 @@ spec:
1641
1628
cleaner:
1642
1629
nullable: true
1643
1630
type: boolean
1631
+
listenerClass:
1632
+
nullable: true
1633
+
type: string
1644
1634
logging:
1645
1635
default:
1646
1636
containers: {}
@@ -1879,27 +1869,11 @@ spec:
1879
1869
type: string
1880
1870
type: array
1881
1871
clusterConfig:
1882
-
default:
1883
-
listenerClass: external-unstable
1884
-
description: Global Spark Connect server configuration that applies to all roles.
1885
-
properties:
1886
-
listenerClass:
1887
-
default: external-unstable
1888
-
description: |-
1889
-
This field controls which type of Service the Operator creates for this ConnectServer:
1890
-
1891
-
* cluster-internal: Use a ClusterIP service
1892
-
1893
-
* external-unstable: Use a NodePort service
1894
-
1895
-
* external-stable: Use a LoadBalancer service
1872
+
default: {}
1873
+
description: |-
1874
+
Global Spark Connect server configuration that applies to all roles.
1896
1875
1897
-
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/stable/listener-operator/listenerclass.html> will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change.
1898
-
enum:
1899
-
- cluster-internal
1900
-
- external-unstable
1901
-
- external-stable
1902
-
type: string
1876
+
This was previously used to hold the listener configuration, which has since moved to the server configuration.
1903
1877
type: object
1904
1878
clusterOperation:
1905
1879
default:
@@ -2191,6 +2165,10 @@ spec:
2191
2165
config:
2192
2166
default: {}
2193
2167
properties:
2168
+
listenerClass:
2169
+
description: This field controls which [ListenerClass](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass.html) is used to expose the Spark services.
:description: Configure the Spark connect and history services exposure with listener classes: cluster-internal, external-unstable, or external-stable.
2
3
3
-
The Spark operator deploys SparkApplications, and does not offer a UI or other API, so no services are exposed.
4
-
However, the operator can also deploy HistoryServers, which do offer a UI and API.
5
-
The operator deploys a service called `<name>-historyserver` (where `<name>` is the name of the spark application) through which the HistoryServer can be reached.
4
+
== History services
6
5
7
-
This service can have three different types: `cluster-internal`, `external-unstable` and `external-stable`.
8
-
Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level.
9
-
10
-
This is how the ListenerClass is configured:
6
+
The operator deploys a xref:listener-operator:listener.adoc[Listener] for each spark history pod.
7
+
The default is to only being accessible from within the Kubernetes cluster, but this can be changed by setting `.spec.nodes.config.listenerClass`:
11
8
12
9
[source,yaml]
13
10
----
11
+
apiVersion: spark.stackable.tech/v1alpha1
12
+
kind: SparkHistoryServer
13
+
metadata:
14
+
name: spark-history
14
15
spec:
15
-
clusterConfig:
16
-
listenerClass: cluster-internal # <1>
16
+
nodes:
17
+
config:
18
+
listenerClass: external-unstable # <1>
17
19
----
18
-
<1> The default `cluster-internal` setting.
20
+
<1> Specify one of `external-stable`, `external-unstable`, `cluster-internal` (the default setting is `cluster-internal`).
21
+
22
+
For the example above, the listener operator creates a service named `spark-history-node-default` where `spark-history` is the name of the SparkHistoryServer, `node` is the service role (the only service role available for history servers) and `default` is the role group.
23
+
24
+
== Connect services
25
+
26
+
Connect pods can be exposed using listener classes in exactly tha same fashion as history servers.
0 commit comments