Skip to content

Commit 00450c4

Browse files
committed
Start adding content for discovery operator
1 parent 22737cb commit 00450c4

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

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

+64-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ spec:
112112
form of validation when creating their own discovery CM e.g. pointing to their existing HDFS.
113113
* Cannot have two products with the same name, as the discovery CM name clashes. One solution could be to prefix the
114114
product name (e.g. trino-simple), This can impose other problems such as too long CM names.
115+
* Cannot be mounted across namespaces, would need to be copied.
115116

116117
==== Discovery Object: Option 2 - Dedicated CRD Object for every Product
117118

@@ -141,7 +142,8 @@ spec:
141142

142143
* Validation by using e.g. complex enums
143144
* Commons structure can be shared between all operators, such as `Listener` endpoints or tls server certificate
144-
information
145+
information. One possible repository for such code would be either in `operator-rs` directly, as a separate workspace
146+
member or in a completely separate repo. One possible name could be `stackable_discovery`.
145147

146148
===== *Cons*
147149

@@ -158,6 +160,9 @@ spec:
158160
* Side-Note: `stackablectl stacklet list` should *not* look at discovery objects, as they can come from a user and are
159161
external systems, where we don't know anything about.
160162

163+
Many of above cons could be solved/mitigated by the introduction of a Discovery controller/operator. See
164+
xref:#discovery-op[here] how this operator/controller would work.
165+
161166
==== Discovery Object: Option 3 - Dedicated CRD Object + ConfigMap for every Product
162167

163168
[source,yaml]
@@ -523,13 +528,70 @@ Trino discovery does not provide any information on how to authenticate
523528
* Not viable, as users need to know how to connect, and are not expected to try 50 different auth methods. We need to
524529
give them a AuthenticationClass, that says them e.g. what LDAP or PKI is used.
525530

531+
[#discovery-op]
532+
=== Discovery Operator/Controller
533+
534+
[source]
535+
----
536+
NS 1 || NS 2
537+
----------- || ------------
538+
| HDFS-Op | || --- | Trino-Op | <--------
539+
----------- || | ------------ |
540+
| || | | | |
541+
deploys || | deploys |
542+
| || | | | |
543+
v || | v v |
544+
------------------------ || | ------ ---------- |
545+
| HDFSClusterDiscovery | || | | CM | | STS(s) | |
546+
| | || | ------ ---------- |
547+
| - hdfs-site.xml | || | |
548+
| - core-site.xml | || | |
549+
| - auth: ... | || wants to |
550+
------------------------ || connect and uses
551+
^ || creates |
552+
| || | |
553+
| || v |
554+
| || ------------ -------------- |
555+
watches || | Request* | | Response** | --
556+
| || ------------ --------------
557+
| || ^ ^
558+
| || | |
559+
| || watches creates
560+
| || | |
561+
| ---------------- | |
562+
-------- | Discovery-Op | ----------------
563+
----------------
564+
||
565+
----
566+
567+
The Discovery Operator/Controller handles cross-namespace discovery between products. Each product operator creates a
568+
namespace-scoped Discovery object (See `HDFSClusterDiscovery`). However some Discovery objects may need additional
569+
ConfigMaps. These ConfigMaps cannot be mounted across namespaces, which would prevent products from being deployed into
570+
separate namespaces. To solve this issue, the Discovery Operator would handle cross-namespace discovery. An example
571+
discovery flow would look like this:
572+
573+
. The Trino-Op (the Product/Client to be exact) located in `NS 2` wants to connect to the HDFS cluster in `NS 1`
574+
. The Trino-Op then creates a `Request*` object for which the Discovery-Op watches
575+
. When the Discovery-Op encounters a new `Request*`, it will lookup the requested endpoint
576+
. Gathered information from the endpoints Discovery data will by forwarded by the Discovery-Op by creating a
577+
`Response**` in the target namespace `NS 2`
578+
. The Trino-Op then uses the `Response**` to fill out local ConfigMaps. The change in a ConfigMap/STS triggers an
579+
automatic restart of the product. This immediately propagates changes in the endpoints Discovery.
580+
581+
pass:[*] Exact type to be determined.
582+
583+
pass:[**] Exact type to be determined, re-using the Discovery type might be a solution, but will entangle types across
584+
operators. One possible solution might by to create one repository named `stackable_discovery`, which includes the
585+
Discovery-Op and all request and response types. Product operators then only need to depend on one additional crate
586+
`stackable_discovery` to enable them to use the request and response types.
587+
526588
== Decision Outcome
527589

528590
* *Discovery Object:* Option 3
529591
* *Server TLS:* TBD, but leaning towards Option 2
530592
* *Authentication:* Option 1
531593

532-
=== Appendix A
594+
== Appendix A
533595

534596
Let's model a kerberos secured HDFS with the Options "TLS: Include caCert in Discovery config" and "Authentication:
535597
Add needed details"

0 commit comments

Comments
 (0)