Skip to content

Commit f2158cf

Browse files
committed
WIP
1 parent d3b6fdd commit f2158cf

File tree

1 file changed

+69
-32
lines changed

1 file changed

+69
-32
lines changed

modules/contributor/pages/adr/ADR028-discovery-revision.adoc

Lines changed: 69 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Currently we expose some of these information, but not all (e.g. which ca cert t
2323
On the other hand it could be the case that users have external services which Stackable services should use, e.g.
2424
an non-stackable HDFS where an Stackable Trino should connect to.
2525

26+
Question 1: How do we want to make products discoverable?
27+
Question 2: How should clients verify the identity of the server (e.g. the cert of the server)
28+
Question 3: How should clients authenticate themselves against the server?
29+
2630
== Decision Drivers
2731
We have some common use-cases that we need to express via the discovery mechanism:
2832

@@ -148,8 +152,8 @@ kind: HdfsClusterDiscovery
148152
metadata:
149153
name: simple-hdfs
150154
spec:
155+
productVersion: 3.3.4 # *could* be put in common struct and #[serde(flattened)]
151156
hdfsSitesConfigMap: hdfs-simple-hdfs
152-
productVersion: 3.3.4
153157
httpProtocol:
154158
http: {}
155159
# OR
@@ -169,6 +173,26 @@ spec:
169173
core-site.xml: <xml>
170174
----
171175

176+
[source,yaml]
177+
----
178+
apiVersion: trino.stackable.tech/v1alpha1
179+
kind: TrinoClusterDiscovery
180+
metadata:
181+
name: simple-trino
182+
spec:
183+
productVersion: "414"
184+
coordinatorEndpoint:
185+
host: trino-coordinator.ns.svc.cluster.local
186+
port: 8443
187+
protocol:
188+
http: {}
189+
# OR
190+
https:
191+
caCertSecretClass: tls
192+
authentication: <whatever>, see below
193+
# No CM needed
194+
----
195+
172196
==== Pros
173197

174198
* Fixes mount problem from `Discovery Object: Use dedicated CRD object for every product`
@@ -228,32 +252,33 @@ Instead of writing discovery information to dedicated objects - such as CM or cu
228252
Currently we have the freedom of either connection to a Zookeeper root dir or a ZNode transparently.
229253

230254
=== [2] TLS: Discovery config contains SecretClass
231-
The discovery includes the SecretClass used to obtain the *server* certificate
255+
The discovery includes the SecretClass used to obtain the ca.crt used to validate the *server* certificate
232256

233257
Trino discovery:
234258
[source,yaml]
235259
----
260+
apiVersion: trino.stackable.tech/v1alpha1
261+
kind: TrinoClusterDiscovery
236262
metadata:
237-
name: my-trino
238-
coordinatorEndpoint:
239-
host: trino-coordinator.ns.svc.cluster.local
240-
port: 8443
241-
protocol:
242-
http: {}
243-
# OR
244-
https:
245-
caCertSecretClass: tls
263+
name: simple-trino
264+
spec:
265+
coordinatorEndpoint:
266+
host: trino-coordinator.ns.svc.cluster.local
267+
port: 8443
268+
protocol:
269+
http: {}
270+
# OR
271+
https:
272+
caCertSecretClass: tls # gives ca.crt used to verify the server cert
246273
---
247274
# superset config
248275
security:
249-
tls:
276+
tls: # server tls cert
250277
secretClassName: tls
251-
kerberos:
252-
secretClassName: kerberos
253278
backends: # Don't look at the Superset CRD structure, we are only interested in the tls stuff here
254279
- name: my-trino
255280
trino:
256-
discoveryConfigName: my-trino
281+
discovery: my-trino
257282
----
258283

259284
==== Pros
@@ -269,20 +294,26 @@ For usability reasons it can be omitted and defaults to the SecretClass the clie
269294
Trino discovery:
270295
[source,yaml]
271296
----
297+
apiVersion: trino.stackable.tech/v1alpha1
298+
kind: TrinoClusterDiscovery
272299
metadata:
273-
name: my-trino
274-
coordinatorEndpoint: https://trino-coordinator.ns.svc.cluster.local:8443
275-
---
300+
name: simple-trino
301+
spec:
302+
coordinatorEndpoint:
303+
host: trino-coordinator.ns.svc.cluster.local
304+
port: 8443
305+
protocol:
306+
http: {}
307+
# OR
308+
https: {} # NO! cert information
276309
# superset config
277310
security:
278311
tls:
279312
secretClassName: tls
280-
kerberos:
281-
secretClassName: kerberos
282313
backends: # Don't look at the Superset CRD structure, we are only interested in the tls stuff here
283314
- name: my-trino
284315
trino:
285-
discoveryConfigName: my-trino
316+
discovery: my-trino
286317
# override tls from the global config, OPTIONALLY
287318
tlsSecretClass: my-second-pki
288319
----
@@ -295,6 +326,7 @@ backends: # Don't look at the Superset CRD structure, we are only interested in
295326
==== Cons
296327

297328
* The client has to know what pki/secretClass the server is using.
329+
* Superset TrinoConnection could not only say "Connect this Superset and this Trino", but need to say "using this ca.crt to validate the Trino server"
298330

299331
=== [2] TLS: Include caCert in Discovery config
300332

@@ -318,7 +350,6 @@ endpoint:
318350

319351
==== Pros
320352

321-
* Assuming DiscoveryConfig is located within a CM, the operator can simply mount the discovery CM to get the ca.crt. Operator does not need to read/look at the DiscoveryConfig.
322353
* Easier for external clients to use as they don't need to know the concept of SecretClasses and don't even need to run withing k8s.
323354
* The client has to *not* know what pki/secretClass the server is using.
324355

@@ -339,11 +370,13 @@ authentication:
339370
authenticationClass: my-class
340371
----
341372

373+
==== Pros
374+
* IMPORTANT: This is the only thing the server can know (how he is verifying client identities). He can not recommend an SecretClass used to obtain the client credentials. E.g. he uses an LDAP AuthenticationClass, there is no way it can now what SecretClass provides credentials accepted by LDAP. (Most cases it will be a user logging into a WebUI and the LDAP credentials of the user are not even stored anywhere but just remembered by the user)
375+
342376
==== Cons
343377

344378
* Operator has to read the AuthenticationClass to determine its type (pw/tls/keytab) and set up the needed volumes and commands.
345-
* The AuthenticationClass is meant to describe "how should a server verify connecting clients" and re-purpose it to mean "how a client should authenticate itself".
346-
379+
// * The AuthenticationClass is meant to describe "how should a server verify connecting clients" and re-purpose it to mean "how a client should authenticate itself". Image a user creates a Secret `trino-users` with *only* a ca.crt and a SecretClass `trino-users` on top. The connecting client than has no way of knowing how to get a client cert.
347380

348381
=== [3] Authentication: Add SecretClass to Discovery Config
349382

@@ -359,7 +392,7 @@ authentication:
359392
==== Cons
360393

361394
* Operator has to read the SecretClass to determine its type (pw/tls/keytab) and set up the needed volumes and commands.
362-
395+
* Image then SecretClass is of type `k8sSearch`. The connection client (e.g. controlled via superset-operator) than has no idea if he should expect a tls.crd or a keytab when mounting the SecretClass.
363396

364397
=== [3] Authentication: Add needed details
365398

@@ -372,11 +405,9 @@ authentication:
372405
none: {}
373406
password: {}
374407
tls:
375-
secretClass: client-tls # Use this SecretClass to obtain a *client* cert
408+
secretClass: client-tls # Use this SecretClass to obtain a *client* cert tls.crt
376409
kerberos:
377410
secretClass: client-kerberos # Use this SecretClass to obtain a keytab
378-
oauth:
379-
secretClass: client-oauth # Use this SecretClass to obtain whatever it needs
380411
----
381412

382413
==== Pros
@@ -385,13 +416,19 @@ authentication:
385416

386417
==== Cons
387418

388-
* Operator has read the Discovery CM it wants to connect to
419+
=== [3] Authentication: Don't add information how to authenticate
420+
421+
Trino discovery does not provide any information on how to authenticate
422+
423+
==== Cons
424+
425+
* Not viable, as users need to know how to connect, and are not expected to try 50 different auth methods. We need to give them a AuthenticationClass, that says them e.g. what LDAP or PKI is used.
389426

390427
== Decision Outcome
391428

392-
[1] Discovery Object: TODO
393-
[2] TLS: TODO
394-
[3] Authentication: TODO
429+
[1] Discovery Object: `Discovery Object: Use dedicated CRD object for every product - in combination with ConfigMap`
430+
[2] Server tls cert: TODO
431+
[3] Authentication: `Authentication: Add AuthenticationClass to Discovery Config`
395432

396433
=== Appendix A
397434
Let's model a kerberos secured HDFS with the Options "TLS: Include caCert in Discovery config" and "Authentication: Add needed details"

0 commit comments

Comments
 (0)