diff --git a/_search-plugins/cross-cluster-search.md b/_search-plugins/cross-cluster-search.md index c25f3d70d9..947097e8b3 100644 --- a/_search-plugins/cross-cluster-search.md +++ b/_search-plugins/cross-cluster-search.md @@ -285,7 +285,7 @@ curl -XGET -k -u 'admin:' 'https://opensearch-domain-1:92 ## Sample Kubernetes/Helm setup If you are using Kubernetes clusters to deploy OpenSearch, you need to configure the remote cluster using either the `LoadBalancer` or `Ingress`. The Kubernetes services created using the following [Helm]({{site.url}}{{site.baseurl}}/install-and-configure/install-opensearch/helm/) example are of the `ClusterIP` type and are only accessible from within the cluster; therefore, you must use an externally accessible endpoint: -```json +```bash curl -k -XPUT -H 'Content-Type: application/json' -u 'admin:' 'https://opensearch-domain-1:9200/_cluster/settings' -d ' { "persistent": { @@ -297,3 +297,68 @@ curl -k -XPUT -H 'Content-Type: application/json' -u 'admin::9300; + } + upstream opensearch-http { + server :9200; + } + server { + listen 8300; + ssl_certificate /.../{{site.opensearch_version}}/config/esnode.pem; + ssl_certificate_key /.../{{site.opensearch_version}}/config/esnode-key.pem; + ssl_trusted_certificate /.../{{site.opensearch_version}}/config/root-ca.pem; + proxy_pass opensearch-transport; + ssl_preread on; + } + server { + listen 443; + listen [::]:443; + ssl_certificate /.../{{site.opensearch_version}}/config/esnode.pem; + ssl_certificate_key /.../{{site.opensearch_version}}/config/esnode-key.pem; + ssl_trusted_certificate /.../{{site.opensearch_version}}/config/root-ca.pem; + proxy_pass opensearch-http; + ssl_preread on; + } +} +``` + +The listening ports for HTTP and transport communication are set to `443` and `8300`, respectively. + +### OpenSearch configuration + +The remote cluster can be configured to point to the `proxy` by using the following command: + +```bash +curl -k -XPUT -H 'Content-Type: application/json' -u 'admin:' 'https://opensearch:9200/_cluster/settings' -d ' +{ + "persistent": { + "cluster.remote": { + "opensearch-remote-cluster": { + "mode": "proxy", + "proxy_address": ":8300" + } + } + } +}' +``` + +Note the previously configured port `8300` in the [Proxy configuration]({{site.url}}{{site.baseurl}}/search-plugins/cross-cluster-search/#proxy-configuration) section.