-
- Notifications
You must be signed in to change notification settings - Fork 13
Refactoring Service Discovery Concept text #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
23 commits Select commit Hold shift + click to select a range
9373f99 refactored service dicsovery text
ca6ba65 Elaborated the example
ffafef7 Added link to ZNode
8408dc6 Update modules/concepts/pages/service_discovery.adoc
fhennig 6e62361 Update modules/concepts/pages/service_discovery.adoc
fhennig d95a87f Update modules/concepts/pages/service_discovery.adoc
fhennig b26319a more/different text
14116d3 Merge branch 'main' into service-discovery-refactoring
fhennig 7834dca New text
9dc8734 Merge branch 'service-discovery-refactoring' of github.com:stackablet…
2af33e8 Minor changes
58b1700 Update modules/concepts/pages/service_discovery.adoc
fhennig be6b4b8 Update modules/concepts/pages/service_discovery.adoc
fhennig 8c52c34 Update modules/concepts/pages/service_discovery.adoc
fhennig 5b2ce08 Update modules/contributor/pages/service_discovery.adoc
fhennig c8df4dc Update modules/concepts/pages/service_discovery.adoc
fhennig 3fbb2e5 Update modules/concepts/pages/service_discovery.adoc
fhennig fa22a41 Changes
f339938 Added link to druid
3414f01 small change
3625c37 Update modules/concepts/pages/service_discovery.adoc
fhennig 80a0fe6 Update modules/concepts/pages/service_discovery.adoc
fhennig 9d41ce3 Update modules/concepts/pages/service_discovery.adoc
fhennig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| * Concepts | ||
| * xref:concepts:index.adoc[] | ||
| ** xref:service_discovery.adoc[] | ||
| ** xref:s3.adoc[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| = Concepts | ||
| | ||
| This section of the documentation is intended to be read to gain a deeper understanding of the bigger picture and architectural design of the platform. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| = Service discovery | ||
| | ||
| Most products on the Stackable platform (and possibly other software in your stack) require other software to run or to be made useful -- i.e. an analytics tool will delegate the storing of data to other applications and instead interface with various data storage solutions. The Stackable platform uses _service discovery_ to enable users and operators to easily connect different products together. There are three types of uses for the service discovery mechanism: | ||
| | ||
| * A Stackable operated product instance requires a connection to another product to run. For example: NiFi requires a ZooKeeper to run. | ||
fhennig marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| * You want to connect non-Stackable operated software to a Stackable operated product instance. For example: You wrote your own analytics tool and want to read data from Trino. | ||
fhennig marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| * You want to offer a product instance not operated with a Stackable operator as a dependency to Stackable operated product instances. For example: You already run a Druid cluster and want to connect it to a Superset instance operated with a Stackable operator. | ||
| This page explains the general mechanism of service discovery and how this mechanism works in the contexts described above. | ||
| | ||
| == The service discovery ConfigMap | ||
| | ||
| In the Stackable platform, every product instance is defined by a resource with a name, for example a ZooKeeperCluster: | ||
| | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: zookeeper.stackable.tech/v1alpha1 | ||
| kind: ZookeeperCluster | ||
| metadata: | ||
| name: simple-zk | ||
| spec: | ||
| ... | ||
| ---- | ||
| | ||
| The operator reads the resource and creates the necessary pods and services to get the instance running. The operator is aware of the interfaces and connections that may be consumed by other products and it also knows all the details of the actual running processes. | ||
fhennig marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| The operator creates a ConfigMap with the same name as the product instance, in the same namespace. Inside of the ConfigMap is information about how to connect to the product instance. For example for a ZooKeeper cluster named simple-zk the Stackable ZooKeeper operator creates a ConfigMap similar to this: | ||
| | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: simple-zk | ||
| data: | ||
| ZOOKEEPER: simple-zk-server-default-0.simple-zk-server-default.default.svc.cluster.local:2181,simple-zk-server-default-1.simple-zk-server-default.default.svc.cluster.local:2181 | ||
| ---- | ||
| | ||
| The information needed to connect can be a string like above, for example a JDBC connect string: `jdbc:postgresql://localhost:12345`. But a ConfigMap can also contain whole configuration files which can then be mounted into a Pod. This is the case for xref:hdfs::discovery.adoc[HDFS], where the `core-site.xml` and `hdfs-site.xml` files are put into the discovery ConfigMap. | ||
fhennig marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| *The ConfigMap always has the same name as cluster resource.* Which allows Stackable operators as well as users to look up service connection information simply by the name of the product instance they want to connect to. | ||
fhennig marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| == Usage of the service discovery ConfigMap | ||
| | ||
| Above three use cases for service discovery ConfigMap were outlined. They are described in more detail below. | ||
| | ||
| === Stackable internal usage | ||
fhennig marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| Stackable operators use the discovery ConfigMap to automatically connect to service dependencies. Hbase requires HDFS to run. With an HdfsCluster defined as such: | ||
| | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: hdfs.stackable.tech/v1alpha1 | ||
| kind: HdfsCluster | ||
| metadata: | ||
| name: simple-hdfs | ||
| spec: | ||
| ... | ||
| ---- | ||
| The HDFS instance is referenced in HBase like this: | ||
| | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: hbase.stackable.tech/v1alpha1 | ||
| kind: HbaseCluster | ||
| metadata: | ||
| name: simple-hbase | ||
| spec: | ||
| hdfsConfigMapName: simple-hdfs | ||
| ... | ||
| ---- | ||
| | ||
| With the HdfsCluster name simple-hdfs, the HBase Operator looks up the discovery ConfigMap for the simple-hdfs HdfsCluster, retrieves the information it needs to configure Hbase and configures the simple-hbase instance. | ||
| | ||
| === Connect third-party products | ||
| | ||
| You can connect your own products to Stackable-operated product instances. Just use the name of the instance to retrieve the ConfigMap and use the information in there to connect your own service. You can find links to these documentation pages below in the <<whats-next>> section. | ||
| | ||
| === Provide custom dependencies | ||
| | ||
| It is not uncommon to already have some core software running in your stack, such as HDFS. Looking at xref:hdfs::discovery.adoc[the discovery documentation for HDFS], you can see that the discovery ConfigMap for HDFS contains the `core-site.xml` and `hdfs-site-xml` files. | ||
| | ||
| If you are already operating an HDFS instance, you can simply provide a ConfigMap containing these files. You can then use the name of this ConfigMap in the configuration of other products, such as HBase. | ||
| | ||
| [#whats-next] | ||
| == What's next | ||
| | ||
| Consult discovery ConfigMap documentation for specific products: | ||
| | ||
| * xref:hdfs::discovery.adoc[Apache Hadoop HDFS] | ||
| * xref:hive::discovery.adoc[Apache Hive] | ||
| * xref:kafka::discovery.adoc[Apache Kafka] | ||
| * xref:opa::discovery.adoc[OPA] | ||
| * xref:zookeeper::discovery.adoc[Apache ZooKeeper] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.