|
| 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 | +==== |
0 commit comments