Skip to content

Commit 2177e7d

Browse files
eedugonshainaraskastheletterfbarkbay
authored
Remote clusters missing use cases and structural changes (#4170)
This PR addresses some missing use cases on Remote Clusters with ECK. Due to the missing use cases and the fact that originally we only had one doc in the Remote Clusters ECK section we have updated the structure to contain: - New landing page with links to the different use cases, including the ones that reside in ECH or ECE sections. - Dedicated doc to configure remote clusters within ECK (this is the original doc) - Dedicated doc to configure remote clusters belonging to different ECH environments (comes partially from the old section "Connect from a cluster running outside the kubernetes cluster" where we have refined + added API key method). - Created new doc to connect a self-managed cluster to ECK (comes partially from the old section "Connect from an Elasticsearch cluster running outside the Kubernetes cluster" where we have refined + added API key method). - Created new doc to connect ECK clusters to external remote clusters (not managed by ECK operator). The remote could be ECH, ECE or self-managed. Addresses the following issues: - #1471 - elastic/cloud-on-k8s#8502 --------- Co-authored-by: shainaraskas <58563081+shainaraskas@users.noreply.github.com> Co-authored-by: Fabrizio Ferri-Benedetti <fabri.ferribenedetti@elastic.co> Co-authored-by: Michael Morello <michael.morello@elastic.co>
1 parent 3eb20a7 commit 2177e7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1285
-298
lines changed

deploy-manage/remote-clusters/_snippets/allow-connection-intro.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters.md
5+
- eck-remote-clusters-to-other-eck.md
6+
- ece-remote-cluster-self-managed.md
7+
- ece-remote-cluster-same-ece.md
8+
- ece-remote-cluster-other-ece.md
9+
- ece-remote-cluster-ece-ess.md
10+
- ece-enable-ccs-for-eck.md
11+
- ec-remote-cluster-self-managed.md
12+
- ec-remote-cluster-same-ess.md
13+
- ec-remote-cluster-other-ess.md
14+
- ec-remote-cluster-ece.md
15+
- ec-enable-ccs-for-eck.md
16+
-->
117
Before you start, consider the [security model](/deploy-manage/remote-clusters/security-models.md) that you would prefer to use for authenticating remote connections between clusters, and follow the corresponding steps.
218

319
API key
Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
* On the deployment you will use as remote, use the [{{es}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-cross-cluster-api-key) or [{{kib}}](/deploy-manage/api-keys/elasticsearch-api-keys.md) to create a cross-cluster API key. Configure it with access to the indices you want to use for {{ccs}} or {{ccr}}.
2-
* Copy the encoded key (`encoded` in the response) to a safe location. You will need it in the next step.
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- remote-clusters-api-key.md
5+
- eck-remote-clusters-to-other-eck.md
6+
- eck-remote-clusters-to-external.md
7+
- ece-remote-cluster-self-managed.md
8+
- ece-remote-cluster-same-ece.md
9+
- ece-remote-cluster-other-ece.md
10+
- ece-remote-cluster-ece-ess.md
11+
- ece-enable-ccs-for-eck.md
12+
- ec-remote-cluster-self-managed.md
13+
- ec-remote-cluster-same-ess.md
14+
- ec-remote-cluster-other-ess.md
15+
- ec-remote-cluster-ece.md
16+
- ec-enable-ccs-for-eck.md
17+
-->
18+
1. On the remote cluster, use the [{{es}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-cross-cluster-api-key) or [{{kib}}](/deploy-manage/api-keys/elasticsearch-api-keys.md) to create a cross-cluster API key. Configure it to include access to the indices you want to use for {{ccs}} or {{ccr}}.
19+
2. Copy the encoded key (`encoded` in the response) to a safe location. It is required for the local cluster configuration.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters.md
5+
- eck-remote-clusters-to-other-eck.md
6+
- eck-remote-clusters-to-external.md
7+
- ece-remote-cluster-self-managed.md
8+
- ece-remote-cluster-same-ece.md
9+
- ece-remote-cluster-other-ece.md
10+
- ece-remote-cluster-ece-ess.md
11+
- ece-enable-ccs-for-eck.md
12+
- ec-remote-cluster-self-managed.md
13+
- ec-remote-cluster-same-ess.md
14+
- ec-remote-cluster-other-ess.md
15+
- ec-remote-cluster-ece.md
16+
- ec-enable-ccs-for-eck.md
17+
-->
118
Follow these steps to configure the [API key security model](/deploy-manage/remote-clusters/security-models.md#api-key) for remote clusters. If you run into any issues, refer to [Troubleshooting](/troubleshoot/elasticsearch/remote-clusters.md).
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
The API key created previously will be used by the local deployment to authenticate with the corresponding set of permissions to the remote deployment. For that, you need to add the API key to the local deployment's keystore.
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters-to-other-eck.md
5+
- eck-remote-clusters-to-external.md
6+
- ece-remote-cluster-self-managed.md
7+
- ece-remote-cluster-same-ece.md
8+
- ece-remote-cluster-other-ece.md
9+
- ece-remote-cluster-ece-ess.md
10+
- ece-enable-ccs-for-eck.md
11+
- ec-remote-cluster-self-managed.md
12+
- ec-remote-cluster-same-ess.md
13+
- ec-remote-cluster-other-ess.md
14+
- ec-remote-cluster-ece.md
15+
- ec-enable-ccs-for-eck.md
16+
-->
17+
The API key created previously is needed by the local {{local_type_generic}} to authenticate with the corresponding set of permissions to the remote {{remote_type_generic}}. To enable this, add the API key to the local {{local_type_generic}}'s keystore.
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters-to-other-eck.md
5+
- ece-remote-cluster-self-managed.md
6+
- ece-remote-cluster-same-ece.md
7+
- ece-remote-cluster-other-ece.md
8+
- ece-remote-cluster-ece-ess.md
9+
- ece-enable-ccs-for-eck.md
10+
- ec-remote-cluster-self-managed.md
11+
- ec-remote-cluster-same-ess.md
12+
- ec-remote-cluster-other-ess.md
13+
- ec-remote-cluster-ece.md
14+
- ec-enable-ccs-for-eck.md
15+
-->
116
* The local and remote deployments must be on {{stack}} 8.14 or later.
2-
* Contrary to the certificate security model, the API key security model does not require that both local and remote clusters trust each other.
17+
* Unlike the certificate-based security model, the API key model does not require mutual trust between clusters; only the local cluster is required to trust the remote cluster's certificate.
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters.md
5+
- eck-remote-clusters-to-other-eck.md
6+
- eck-remote-clusters-to-external.md
7+
- ece-remote-cluster-self-managed.md
8+
- ece-remote-cluster-same-ece.md
9+
- ece-remote-cluster-other-ece.md
10+
- ece-remote-cluster-ece-ess.md
11+
- ece-enable-ccs-for-eck.md
12+
- ec-remote-cluster-self-managed.md
13+
- ec-remote-cluster-same-ess.md
14+
- ec-remote-cluster-other-ess.md
15+
- ec-remote-cluster-ece.md
16+
- ec-enable-ccs-for-eck.md
17+
-->
118
% this will need improvement in a future PR, as the text below is only valid for API key based security model
219

3-
If you're using the API key based security model, to use a remote cluster for {{ccr}} or {{ccs}}, you need to create user roles with [remote indices privileges](/deploy-manage/users-roles/cluster-or-deployment-auth/role-structure.md#roles-remote-indices-priv) on the local cluster. Refer to [Configure roles and users](/deploy-manage/remote-clusters/remote-clusters-api-key.md#remote-clusters-privileges-api-key).
20+
If you're using the API keybased security model for {{ccr}} or {{ccs}}, you can define user roles with [remote indices privileges](/deploy-manage/users-roles/cluster-or-deployment-auth/role-structure.md#roles-remote-indices-priv) on the local cluster to further restrict the permissions granted by the API key. For more details, refer to [Configure roles and users](/deploy-manage/remote-clusters/remote-clusters-api-key.md#remote-clusters-privileges-api-key).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--
2+
This snippet is in use in the following locations:
3+
- eck-remote-clusters-to-other-eck.md
4+
- eck-remote-clusters-to-external.md
5+
-->
6+
The following command creates a secret containing the encoded API key obtained earlier:
7+
8+
```sh
9+
cat <<EOF | kubectl apply -f -
10+
apiVersion: v1
11+
kind: Secret
12+
metadata:
13+
name: remote-api-keys
14+
type: Opaque
15+
stringData:
16+
cluster.remote.<remote-cluster-name>.credentials: <encoded value> <1>
17+
EOF
18+
```
19+
1. For the `<remote-cluster-name>`, enter the alias of your choice. This alias is used when connecting to the remote cluster. It must be lowercase and only contain letters, numbers, dashes, and underscores.
20+
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters-to-other-eck.md
5+
- ece-enable-ccs-for-eck.md
6+
- ec-enable-ccs-for-eck.md
7+
-->
18
Expose the transport service (defaults to port `9300`) of your ECK cluster to allow external {{es}} clusters to connect:
29

310
```yaml
411
apiVersion: elasticsearch.k8s.elastic.co/v1
512
kind: Elasticsearch
613
metadata:
7-
name: <cluster-name>
14+
name: <remote-cluster-name>
815
spec:
916
transport:
1017
service:
1118
spec:
1219
type: LoadBalancer <1>
1320
```
1421
15-
1. On cloud providers which support external load balancers, setting the type field to `LoadBalancer` provisions a load balancer for your service. Alternatively, expose the service `<cluster-name>-es-transport` through one of the Kubernetes Ingress controllers that support TCP services.
22+
1. On cloud providers which support external load balancers, setting the `type` field to `LoadBalancer` provisions a load balancer for your service. Alternatively, expose the service `<cluster-name>-es-transport` through one of the Kubernetes Ingress controllers that support TCP services.
23+
24+
:::{note}
25+
If you change the service’s `port` to expose a different port externally, set `targetPort` explicitly to `9300`, which is the default transport service listening port. Otherwise, Kubernetes uses the same value for both fields, resulting in failed connections.
26+
:::
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters-to-other-eck.md
5+
-->
6+
ECK stores the CA used to issue certificates for the {{es}} transport layer in a secret named `<cluster_name>-es-transport-certs-public`.
7+
8+
For example, to save the transport CA certificate of a cluster named `quickstart` into a local file, run the following command:
9+
10+
```sh
11+
kubectl get secret quickstart-es-transport-certs-public \
12+
-o go-template='{{index .data "ca.crt" | base64decode}}' > quickstart_transport_ca.crt
13+
```
14+
15+
::::{note}
16+
Beware of copying the source secret as-is into a different namespace. Refer to [Copying secrets with Owner References](/troubleshoot/deployments/cloud-on-k8s/common-problems.md#k8s-common-problems-owner-refs) for more information.
17+
::::
18+
19+
::::{note}
20+
CA certificates are automatically rotated after one year by default. You can [configure](/deploy-manage/deploy/cloud-on-k8s/configure-eck.md) this period. Make sure to keep the copy of the certificates secret up-to-date.
21+
::::
22+
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1-
On the local deployment, add the remote ECK cluster using {{kib}} or the {{es}} API with the following connection settings:
1+
<!--
2+
This snippet is in use in the following locations:
3+
- self-remote-cluster-eck.md
4+
- eck-remote-clusters-to-other-eck.md
5+
- ece-enable-ccs-for-eck.md
6+
- ec-enable-ccs-for-eck.md
27
3-
* **Remote address**: Use the FQDN or IP address of the LoadBalancer service, or similar resource, you created to expose the remote cluster server interface (for API key-based authentication) or the transport interface (for TLS certificate-based authentication).
8+
It requires local_type_generic substitution to be defined
9+
-->
10+
On the local {{local_type_generic}}, use {{kib}} or the {{es}} API to add the remote ECK cluster with the following connection settings:
11+
12+
* **Remote address**: Use the FQDN or IP address of the LoadBalancer service or alternative resource that you created to expose the remote cluster.
13+
14+
* For API key-based authentication, use the server interface address and port.
15+
* For TLS certificate-based authentication, use the transport interface address and port.
16+
17+
If you haven't changed the external listening port of the kubernetes service, the port should be `9443` for API key-based authentication, or `9300` for TLS certificate-based authentication.
418

519
* **TLS server name**: You can try leaving this field empty first. If the connection fails, and your environment is presenting the ECK-managed certificates during the TLS handshake, use `<cluster-name>-es-remote-cluster.<namespace>.svc` as the server name. For example, for a cluster named `quickstart` in the `default` namespace, use `quickstart-es-remote-cluster.default.svc`.

0 commit comments

Comments
 (0)