Skip to content

Commit 788176d

Browse files
docs: Document the discovery ConfigMap
1 parent 9102954 commit 788176d

4 files changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
:clusterName: simple-opensearch
2+
:namespace: stackable
3+
:discoveryServiceListenerClass: external-stable
4+
5+
= Discovery
6+
:page-aliases: discovery.adoc
7+
8+
The Stackable Operator for OpenSearch publishes a xref:concepts:service_discovery.adoc[service discovery ConfigMap] which exposes a client configuration bundle that allows access to the OpenSearch cluster.
9+
10+
The bundle includes the connection parameters to access the OpenSearch cluster.
11+
These parameters may be used by other operators or tools to configure their products with access to OpenSearch.
12+
13+
== Example
14+
15+
Given the following OpenSearch cluster:
16+
17+
[source,yaml,subs="normal,callouts"]
18+
----
19+
apiVersion: opensearch.stackable.tech/v1alpha1
20+
kind: OpenSearchCluster
21+
metadata:
22+
name: {clusterName} # <1>
23+
namespace: {namespace} # <2>
24+
spec:
25+
clusterConfig:
26+
tls:
27+
serverSecretClass: tls # <3>
28+
nodes:
29+
roleConfig:
30+
discoveryServiceListenerClass: {discoveryServiceListenerClass} # <4>
31+
roleGroups:
32+
cluster-manager:
33+
config:
34+
discoveryServiceExposed: true # <5>
35+
nodeRoles:
36+
- cluster_manager
37+
data:
38+
config:
39+
discoveryServiceExposed: false # <6>
40+
nodeRoles:
41+
- ingest
42+
- data
43+
- remote_cluster_client
44+
----
45+
<1> The name of the OpenSearch cluster which is also the name of the created discovery ConfigMap.
46+
<2> The namespace of the cluster and the discovery ConfigMap.
47+
<3> Whether a `serverSecretClass` is set or not, determines the value of the `OPENSEARCH_PROTOCOL` key in the discovery ConfigMap.
48+
<4> The xref:listener-operator:listenerclass.adoc[ListenerClass] that is used for the discovery service.
49+
<5> The `cluster-manager` role group is exposed in the discovery service.
50+
<6> The `data` role group is not exposed in the discovery service.
51+
52+
The resulting discovery ConfigMap is `{namespace}/{clusterName}`.
53+
54+
== Contents
55+
56+
The `{namespace}/{clusterName}` discovery ConfigMap contains the following fields where `{clusterName}` represents the name and `{namespace}` the namespace of the cluster:
57+
58+
`OPENSEARCH_HOST`::
59+
====
60+
Contains the hostname or IP of the service that references the exposed role groups.
61+
62+
In case, `discoveryServiceListenerClass` was set to `cluster-internal`, the following hostname will be set:
63+
64+
[subs="normal"]
65+
{clusterName}.{namespace}.svc.cluster.local
66+
67+
If `discoveryServiceListenerClass` was set to `external-stable`, the content could look like:
68+
69+
10.104.213.49
70+
====
71+
72+
`OPENSEARCH_PORT`::
73+
====
74+
Contains the port of the service that references the exposed role groups.
75+
76+
Depending on the `discoveryServiceListenerClass`, the port will be either the default HTTP port 9200 or a NodePort:
77+
78+
31315
79+
====
80+
81+
`OPENSEARCH_PROTOCOL`::
82+
====
83+
Contains either `http` or `https`, depending on whether a `serverSecretClass` is configured:
84+
85+
https
86+
====

docs/modules/opensearch/pages/reference/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
Consult the reference documentation section to find exhaustive information on:
44

55
* Descriptions and default values of all properties in the CRDs used by this operator in the xref:reference/crds.adoc[].
6+
* The properties in the xref:reference/discovery.adoc[Discovery ConfigMap].
67
* The xref:reference/commandline-parameters.adoc[] and xref:reference/environment-variables.adoc[] accepted by the operator.

docs/modules/opensearch/pages/usage-guide/listenerclass.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
= Service exposition with ListenerClasses
22
:description: Configure OpenSearch service exposure with ListenerClasses: cluster-internal, external-unstable, or external-stable.
33

4+
You probably want the other thing.
5+
46
The operator deploys a xref:listener-operator:listener.adoc[Listener] for OpenSearch role-groups.
57
The listener defaults to only being accessible from within the Kubernetes cluster, but this can be changed by setting `.spec.nodes.roleGroups.\{role-group-name}.config.listenerClass`:
68

docs/modules/opensearch/partials/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
* xref:opensearch:reference/index.adoc[]
2222
** xref:opensearch:reference/crds.adoc[]
2323
*** {crd-docs}/opensearch.stackable.tech/opensearchcluster/v1alpha1/[OpenSearchCluster {external-link-icon}^]
24+
** xref:opensearch:reference/discovery.adoc[]
2425
** xref:opensearch:reference/commandline-parameters.adoc[]
2526
** xref:opensearch:reference/environment-variables.adoc[]

0 commit comments

Comments
 (0)