Skip to content

Commit 70a7d9f

Browse files
razvanclaude
andcommitted
refactor(openlineage): use credentialsSecretName instead of AuthenticationClass
Follows the operator-rs change: derive the OpenLineage backend bearer token from the connection's `credentialsSecretName` Secret (key `apiKey`) instead of resolving a Static AuthenticationClass. Drops ResolvedOpenLineageAuth and the authenticationclasses RBAC rule. See stackabletech/decisions#90 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 92535f1 commit 70a7d9f

12 files changed

Lines changed: 69 additions & 238 deletions

File tree

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/helm/spark-k8s-operator/templates/roles.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,6 @@ rules:
202202
- get
203203
- list
204204
- watch
205-
# AuthenticationClasses used to authenticate against an OpenLineage backend.
206-
- apiGroups:
207-
- authentication.stackable.tech
208-
resources:
209-
- authenticationclasses
210-
verbs:
211-
- get
212-
- list
213-
- watch
214205
# Required for managing how the History Server and Connect Server are exposed
215206
# outside of the cluster.
216207
- apiGroups:

docs/modules/spark-k8s/pages/usage-guide/openlineage.adoc

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ You can still override any of the injected values — including the full `spark.
7272
== Authentication
7373

7474
Backends that require authentication (for example DataHub, or a Marquez instance behind a gateway) expect a bearer token on each request.
75-
Configure this by referencing an xref:concepts:authentication.adoc[`AuthenticationClass`] from the connection via `authenticationClassRef`:
75+
Configure this by setting `credentialsSecretName` on the connection to the name of a Secret holding the token:
7676

7777
[source,yaml]
7878
----
@@ -86,45 +86,33 @@ spec:
8686
inline:
8787
host: marquez
8888
port: 5000
89-
authenticationClassRef: openlineage-auth # <1>
89+
credentialsSecretName: openlineage-token # <1>
9090
...
9191
---
92-
apiVersion: authentication.stackable.tech/v1alpha1
93-
kind: AuthenticationClass
94-
metadata:
95-
name: openlineage-auth
96-
spec:
97-
provider:
98-
static: # <2>
99-
userCredentialsSecret:
100-
name: openlineage-token # <3>
101-
---
10292
apiVersion: v1
10393
kind: Secret
10494
metadata:
10595
name: openlineage-token
106-
namespace: default # <4>
96+
namespace: default # <2>
10797
stringData:
108-
apiKey: "s3cr3t-bearer-token" # <5>
98+
apiKey: "s3cr3t-bearer-token" # <3>
10999
----
110-
<1> References an `AuthenticationClass` by name (cluster-scoped). If omitted, no authentication is used.
111-
<2> Only the `static` provider is supported for OpenLineage. Other providers (LDAP, OIDC, TLS) are rejected with an error.
112-
<3> Name of the Secret holding the token. Must exist in the same namespace as the `SparkApplication`.
113-
<4> The Secret must be in the workload's namespace so it can be projected into the driver.
114-
<5> The token must be stored under the fixed key `apiKey`. The operator never reads the Secret; it is injected into the driver's OpenLineage listener via a `secretKeyRef` environment variable, so the token never appears in the spark-submit arguments or the pod spec.
100+
<1> Name of the Secret holding the token. If omitted, no authentication is used. The Secret must exist in the same namespace as the `SparkApplication`.
101+
<2> The Secret must be in the workload's namespace so it can be projected into the driver.
102+
<3> The token must be stored under the fixed key `apiKey`. The operator never reads the Secret; it is injected into the driver's OpenLineage listener via a `secretKeyRef` environment variable, so the token never appears in the spark-submit arguments or the pod spec.
115103

116104
The operator translates this into the OpenLineage HTTP transport's `api_key` (bearer) authentication.
117105
Combine it with the `tls` block above when the backend also needs TLS server verification.
118106

119107
[NOTE]
120108
====
121-
When `authenticationClassRef` is set, the operator delivers the *entire* transport configuration
109+
When `credentialsSecretName` is set, the operator delivers the *entire* transport configuration
122110
(type, URL and auth) to the driver through `OPENLINEAGE__*` environment variables rather than
123111
`spark.openlineage.transport.*` `--conf` properties.
124112
This is required: OpenLineage resolves the `transport` from a single source, so a transport defined
125113
via `sparkConf` would discard the environment-provided authentication.
126114
Consequently, do **not** override `spark.openlineage.transport.*` via `sparkConf` when using
127-
`authenticationClassRef` — doing so drops the credentials and the backend will reject the events.
115+
`credentialsSecretName` — doing so drops the credentials and the backend will reject the events.
128116
====
129117

130118
[#job-name]

extra/crds.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,12 +1987,11 @@ spec:
19871987
OpenLineage connection definition as a resource.
19881988
Learn more about [OpenLineage](https://openlineage.io/).
19891989
properties:
1990-
authenticationClassRef:
1990+
credentialsSecretName:
19911991
description: |-
1992-
Name of an [`AuthenticationClass`](https://docs.stackable.tech/home/nightly/concepts/authentication) used
1993-
to authenticate against the OpenLineage backend. The `AuthenticationClass` is cluster-scoped
1994-
and referenced by name; it is resolved at runtime via
1995-
[`OpenLineageConnectionSpec::resolve_authentication_class`]. If not specified, no
1992+
Name of a Secret containing the API key used to authenticate against the OpenLineage
1993+
backend. The API key must be stored under the key `apiKey`. The Secret must be located in
1994+
the same namespace as the workload using this connection. If not specified, no
19961995
authentication is used.
19971996
nullable: true
19981997
type: string
@@ -6702,12 +6701,11 @@ spec:
67026701
OpenLineage connection definition as a resource.
67036702
Learn more about [OpenLineage](https://openlineage.io/).
67046703
properties:
6705-
authenticationClassRef:
6704+
credentialsSecretName:
67066705
description: |-
6707-
Name of an [`AuthenticationClass`](https://docs.stackable.tech/home/nightly/concepts/authentication) used
6708-
to authenticate against the OpenLineage backend. The `AuthenticationClass` is cluster-scoped
6709-
and referenced by name; it is resolved at runtime via
6710-
[`OpenLineageConnectionSpec::resolve_authentication_class`]. If not specified, no
6706+
Name of a Secret containing the API key used to authenticate against the OpenLineage
6707+
backend. The API key must be stored under the key `apiKey`. The Secret must be located in
6708+
the same namespace as the workload using this connection. If not specified, no
67116709
authentication is used.
67126710
nullable: true
67136711
type: string

0 commit comments

Comments
 (0)