Skip to content

Commit ee287be

Browse files
committed
ECE and ECH to ECK remote clusters setup updated for API keys
1 parent ac93a60 commit ee287be

11 files changed

+304
-35
lines changed

deploy-manage/remote-clusters/_snippets/apikeys-local-ece-remote-private.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It requires remote_type substitution to be defined
1010

1111
Narrow the list by name, ID, or choose from several other filters. To further define the list, use a combination of filters.
1212

13-
3. Access the **Security** page of the deployment.
13+
3. From the navigation menu, select **Security**.
1414
4. Select **Remote Connections > Add trusted environment** and choose **{{remote_type}}**. Then click **Next**.
1515
5. Select **API keys** as authentication mechanism and click **Next**.
1616
6. When asked whether the Certificate Authority (CA) of the remote environment’s proxy or load-balancing infrastructure is public, select **No, it is private**.
@@ -21,13 +21,13 @@ It requires remote_type substitution to be defined
2121
* For the **Remote cluster name**, enter the alias of your choice. You will use this alias to connect to the remote cluster later. It must be lowercase and only contain letters, numbers, dashes and underscores.
2222
* For the **Cross-cluster API key**, paste the encoded cross-cluster API key.
2323

24-
2. Click **Add** to save the API key to the keystore.
24+
2. Click **Add** to save the API key.
2525
3. Repeat these steps for each API key you want to add. For example, if you want to use several clusters of the remote environment for CCR or CCS.
2626

2727
8. Add the CA certificate of the remote environment.
2828
9. Provide a name for the trusted environment. That name will appear in the trust summary of your deployment's **Security** page.
2929
10. Select **Create trust** to complete the configuration.
30-
11. Restart the local deployment to reload the keystore with its new setting. To do that, go to the deployment's main page, locate the **Actions** menu, and select **Restart {{es}}**.
30+
11. Restart the local deployment to reload the new setting. To do that, go to the deployment's main page, locate the **Actions** menu, and select **Restart {{es}}**.
3131

3232
::::{note}
3333
If the local deployment runs on version 8.14 or greater, you no longer need to perform this step because the keystore is reloaded automatically with the new API keys.

deploy-manage/remote-clusters/_snippets/apikeys-local-ece-remote-public.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ This snippet is in use in the following locations:
1010

1111
Narrow the list by name, ID, or choose from several other filters. To further define the list, use a combination of filters.
1212

13-
3. From the deployment menu, select **Security**.
13+
3. From the navigation menu, select **Security**.
1414
4. Locate **Remote Connections > Trust management > Connections using API keys** and select **Add API key**.
1515

1616
1. Fill both fields.
1717

18-
* For the **Remote cluster name**, enter the the alias of your choice. You will use this alias to connect to the remote cluster later. It must be lowercase and only contain letters, numbers, dashes and underscores.
18+
* For the **Remote cluster name**, enter the alias of your choice. You will use this alias to connect to the remote cluster later. It must be lowercase and only contain letters, numbers, dashes and underscores.
1919
* For the **Cross-cluster API key**, paste the encoded cross-cluster API key.
2020

21-
2. Click **Add** to save the API key to the keystore.
21+
2. Click **Add** to save the API key.
2222

23-
5. Restart the local deployment to reload the keystore with its new setting. To do that, go to the deployment's main page (named after your deployment's name), locate the **Actions** menu, and select **Restart {{es}}**.
23+
5. Restart the local deployment to reload the new setting. To do that, go to the deployment's main page, locate the **Actions** menu, and select **Restart {{es}}**.
2424

2525
::::{note}
2626
If the local deployment runs on version 8.14 or greater, you no longer need to perform this step because the keystore is reloaded automatically with the new API keys.

deploy-manage/remote-clusters/_snippets/apikeys-local-ech-remote-private.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ It requires remote_type substitution to be defined
2121
* For the **Remote cluster name**, enter the alias of your choice. You will use this alias to connect to the remote cluster later. It must be lowercase and only contain letters, numbers, dashes and underscores.
2222
* For the **Cross-cluster API key**, paste the encoded cross-cluster API key.
2323

24-
2. Click **Add** to save the API key to the keystore.
24+
2. Click **Add** to save the API key.
2525
3. Repeat these steps for each API key you want to add. For example, if you want to use several clusters of the remote environment for CCR or CCS.
2626

2727
8. Add the CA certificate of the remote environment.
2828
9. Provide a name for the trusted environment. That name will appear in the trust summary of your deployment's **Security** page.
2929
10. Select **Create trust** to complete the configuration.
30-
11. Restart the local deployment to reload the keystore with its new setting. To do that, go to the deployment's main page, locate the **Actions** menu, and select **Restart {{es}}**.
30+
11. Restart the local deployment to reload the new setting. To do that, go to the deployment's main page, locate the **Actions** menu, and select **Restart {{es}}**.
3131

3232
::::{note}
3333
If the local deployment runs on version 8.14 or greater, you no longer need to perform this step because the keystore is reloaded automatically with the new API keys.

deploy-manage/remote-clusters/_snippets/apikeys-local-ech-remote-public.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ This snippet is in use in the following locations:
1515

1616
1. Fill both fields.
1717

18-
* For the **Remote cluster name**, enter the the alias of your choice. You will use this alias to connect to the remote cluster later. It must be lowercase and only contain letters, numbers, dashes and underscores.
18+
* For the **Remote cluster name**, enter the alias of your choice. You will use this alias to connect to the remote cluster later. It must be lowercase and only contain letters, numbers, dashes and underscores.
1919
* For the **Cross-cluster API key**, paste the encoded cross-cluster API key.
2020

2121
2. Click **Add** to save the API key.
2222

23-
5. Restart the local deployment to reload the new setting. To do that, go to the deployment's main page (named after your deployment's name), locate the **Actions** menu, and select **Restart {{es}}**.
23+
5. Restart the local deployment to reload the new setting. To do that, go to the deployment's main page, locate the **Actions** menu, and select **Restart {{es}}**.
2424

2525
::::{note}
2626
If the local deployment runs on version 8.14 or greater, you no longer need to perform this step because the keystore is reloaded automatically with the new API keys.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Expose the transport service (defaults to port `9300`) of your ECK cluster to allow external {{es}} clusters to connect:
2+
3+
```yaml
4+
apiVersion: elasticsearch.k8s.elastic.co/v1
5+
kind: Elasticsearch
6+
metadata:
7+
name: <cluster-name>
8+
spec:
9+
transport:
10+
service:
11+
spec:
12+
type: LoadBalancer <1>
13+
```
14+
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.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
On the local deployment, add the remote ECK cluster using {{kib}} or the {{es}} API.
2+
3+
::::{note}
4+
When configuring the remote cluster connection:
5+
6+
* **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 authentication) or the transport interface (for certificate-based authentication).
7+
8+
* **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`.
9+
::::
10+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
By default, the remote cluster server interface is disabled on ECK-managed clusters. To use the API key–based security model for cross-cluster connections, you must first enable it on the remote {{es}} cluster:
2+
3+
```yaml subs=true
4+
apiVersion: elasticsearch.k8s.elastic.co/v1
5+
kind: Elasticsearch
6+
metadata:
7+
name: <cluster-name>
8+
namespace: <namespace>
9+
spec:
10+
version: {{version.stack}}
11+
remoteClusterServer:
12+
enabled: true
13+
nodeSets:
14+
- name: default
15+
count: 3
16+
...
17+
...
18+
```
19+
20+
::::{note}
21+
Enabling the remote cluster server triggers a restart of the {{es}} cluster.
22+
::::
23+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
When the remote cluster server is enabled, ECK automatically creates a Kubernetes service named `<cluster-name>-es-remote-cluster` that exposes the server internally on port `9443`:
2+
3+
```sh
4+
quickstart-es-remote-cluster ClusterIP None <none> 9443/TCP 4h13m
5+
```
6+
7+
To allow other clusters running outside your Kubernetes environment to connect, you must expose this service externally. As of ECK {{version.eck}}, you cannot customize the service that ECK generates for the remote cluster interface, but you can create your own `LoadBalancer` service, `Ingress` object, or use another method available in your environment.
8+
9+
For example, the following command creates a service named `quickstart-es-remote-cluster-lb`, similar to the managed `quickstart-es-remote-cluster` but of type `LoadBalancer`.
10+
11+
```sh
12+
kubectl expose service quickstart-es-remote-cluster \
13+
--name=quickstart-es-remote-cluster-lb \
14+
--type=LoadBalancer \ <1>
15+
--port=9443 --target-port=9443
16+
```
17+
18+
1. On cloud providers which support external load balancers, setting the type to LoadBalancer provisions a load balancer for your service. Alternatively, expose the service `<cluster-name>-es-remote-cluster` through one of the Kubernetes Ingress controllers that support TCP services.
19+
20+
21+
:::{admonition} About exposing the service and TLS certificates
22+
When exposing the remote cluster service, determine which TLS certificate will be presented to clients and whether a certificate authority (CA) is required to establish trust. This depends on how traffic to port `9443` is routed in your environment and which component terminates the TLS connection:
23+
24+
* **{{es}} TLS termination**
25+
26+
If the connection reaches the {{es}} Pods without intermediate TLS termination, the {{es}} nodes present their transport certificates managed by ECK. The local cluster must therefore trust these certificates by including the ECK-managed transport CA, which you can retrieve in the next section.
27+
28+
This setup is typical when using standard `LoadBalancer` services provided by most cloud providers.
29+
30+
* **External TLS termination**
31+
32+
If the connection to port `9443` of your {{es}} cluster is handled by an external load balancer, Ingress controller, or another proxy that performs SSL termination with its own certificates, use the CA associated with that component if it's signed by a private CA.
33+
34+
If the external TLS termination uses a publicly trusted certificate, no additional CA is needed.
35+
:::
36+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The certificate authority (CA) used by ECK to issue certificates for the remote cluster server interface is stored in the `ca.crt` key of the secret named `<cluster_name>-es-transport-certs-public`.
2+
3+
If the external connections reach the {{es}} Pods on port `9443` without any intermediate TLS termination, you must retrieve this CA, as it will be required in the local cluster configuration to establish trust.
4+
5+
For example, to save the transport CA certificate of a cluster named `quickstart` into a local file, run:
6+
7+
```sh
8+
kubectl get secret quickstart-es-transport-certs-public \
9+
-o go-template='{{index .data "ca.crt" | base64decode}}' > eck_transport_ca.crt
10+
```
11+
12+
You can verify that the file contains a valid CA certificate by running:
13+
14+
```bash
15+
openssl x509 -in eck_transport_ca.crt -noout -text
16+
```
17+
18+
::::{important}
19+
ECK-managed CA certificates are automatically rotated after one year by default, but you can [configure](/deploy-manage/deploy/cloud-on-k8s/configure-eck.md) a different validity period.
20+
21+
Ensure that this CA is updated in all environments where it's used after rotation to preserve trust.
22+
::::
23+

deploy-manage/remote-clusters/ec-enable-ccs-for-eck.md

Lines changed: 95 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,87 @@ applies_to:
88
eck: ga
99
products:
1010
- id: cloud-hosted
11+
sub:
12+
remote_type: Self-managed
1113
---
1214

1315
# Connect {{ech}} deployments to {{eck}} clusters [ec-enable-ccs-for-eck]
1416

1517
These steps describe how to configure remote clusters between an {{es}} cluster in {{ech}} (ECH) and an {{es}} cluster running within [{{eck}} (ECK)](/deploy-manage/deploy/cloud-on-k8s.md). Once that’s done, you’ll be able to [run CCS queries from {{es}}](/solutions/search/cross-cluster-search.md) or [set up CCR](/deploy-manage/tools/cross-cluster-replication/set-up-cross-cluster-replication.md).
1618

19+
:::{include} _snippets/terminology.md
20+
:::
1721

18-
## Establish trust between the two clusters [ec_establish_trust_between_two_clusters]
1922

20-
The first step is to establish trust between the two clusters, by adding the CA certificate and trust details of each environment into the other.
23+
## Allow the remote connection [ec_allow_the_remote_connection_4]
2124

22-
This guide uses TLS certificates to secure remote cluster connections and follows a similar approach to [Access clusters of a self-managed environment](ec-remote-cluster-self-managed.md).
25+
:::{include} _snippets/allow-connection-intro.md
26+
:::
2327

24-
### Establish trust in the ECH cluster [ec_establish_trust_in_the_elasticsearch_service_cluster]
28+
:::::::{tab-set}
29+
30+
::::::{tab-item} API key
31+
32+
:::{include} _snippets/apikeys-intro.md
33+
:::
34+
35+
### Prerequisites and limitations [ec_prerequisites_and_limitations_4]
36+
37+
:::{include} _snippets/apikeys-prerequisites-limitations.md
38+
:::
39+
40+
### Enable the remote cluster server interface on the remote ECK cluster
41+
42+
:::{include} _snippets/eck_rcs_enable.md
43+
:::
44+
45+
### Configure external access to the remote cluster server interface
46+
47+
:::{include} _snippets/eck_rcs_expose.md
48+
:::
49+
50+
51+
### Retrieve the ECK-managed CA certificate of the remote cluster server [fetch-ca-cert]
52+
53+
:::{include} _snippets/eck_rcs_retrieve_ca.md
54+
:::
55+
56+
### Create a cross-cluster API key on the remote cluster [ec_create_a_cross_cluster_api_key_on_the_remote_deployment_4]
57+
58+
:::{include} _snippets/apikeys-create-key.md
59+
:::
60+
61+
62+
### Configure the local deployment [ec_configure_the_local_deployment_2]
63+
64+
:::{include} _snippets/apikeys-local-config-intro.md
65+
:::
66+
67+
The steps to follow depend on whether the certificate authority (CA) presented by the remote cluster server, proxy, or load-balancing infrastructure is publicly trusted or private.
68+
69+
::::{dropdown} The CA is public
70+
71+
:::{include} _snippets/apikeys-local-ech-remote-public.md
72+
:::
73+
74+
::::
75+
76+
::::{dropdown} The CA is private (ECK-managed transport certificates)
77+
78+
When adding the CA certificate in the next steps, use either the ECK-managed transport CA obtained [previously](#fetch-ca-cert), or the CA of the component that terminates TLS connections to clients.
79+
80+
:::{include} _snippets/apikeys-local-ech-remote-private.md
81+
:::
82+
::::
83+
84+
::::::
85+
86+
::::::{tab-item} TLS certificate (deprecated)
87+
### Establish mutual trust between the clusters [ec_establish_trust_between_two_clusters]
88+
89+
When using TLS certificates-based authentication, the first step is to establish trust between the two clusters, by adding the CA certificate and trust details of each environment into the other.
90+
91+
#### Establish trust in the ECH cluster [ec_establish_trust_in_the_elasticsearch_service_cluster]
2592

2693
To configure trust in the ECH deployment:
2794

@@ -52,7 +119,7 @@ To configure trust in the ECH deployment:
52119

53120
7. On the confirmation screen, when prompted **Have you already set up trust from the other environment?**, select **No, I have NOT set up trust from the other environment yet**. Download both the ECH deployment CA certificate and the `trust.yml` file. These files can also be retrieved from the **Security** page of the deployment. You’ll use these files to configure trust in the ECK deployment.
54121

55-
### Update the downloaded `trust.yml` file for ECK compatibility
122+
#### Update the downloaded `trust.yml` file for ECK compatibility
56123

57124
The `trust.yml` file you downloaded from the Cloud UI includes a subject name pattern that isn't valid for your ECK cluster. Before using it in your ECK cluster, you need to update the file with the pattern that matches your cluster.
58125
@@ -92,8 +159,7 @@ trust.subject_name:
92159
93160
Apply the changes and save the `trust.yml` file.
94161
95-
96-
### Establish trust in the ECK cluster [ec_establish_trust_in_the_eck_cluster]
162+
#### Establish trust in the ECK cluster [ec_establish_trust_in_the_eck_cluster]
97163
98164
To configure trust in the ECK deployment:
99165
@@ -142,14 +208,30 @@ To configure trust in the ECK deployment:
142208
1. Ensure `secretName` matches the name of the Secret you created earlier.
143209
2. Ensure `name` matches the name of the ConfigMap you created earlier.
144210
145-
## Set up CCS/R [ec_setup_ccsr]
211+
### Configure external access to the transport interface of your ECK cluster
212+
213+
:::{include} _snippets/eck_expose_transport.md
214+
:::
215+
216+
::::::
217+
:::::::
218+
219+
## Connect to the remote cluster [ec_connect_to_the_remote_cluster_4]
220+
221+
:::{include} _snippets/eck_rcs_connect_intro.md
222+
:::
223+
224+
### Using {{kib}} [ec_using_kibana_4]
146225
147-
Now that trust has been established, you can set up CCS/R from the ECK cluster to the ECH cluster or from the ECH cluster to the ECK cluster.
226+
:::{include} _snippets/rcs-kibana-api-snippet-self.md
227+
:::
148228
149-
### ECK Cluster to {{ech}} cluster [ec_eck_cluster_to_elasticsearch_service_cluster]
229+
### Using the {{es}} API [ec_using_the_elasticsearch_api_4]
150230
151-
Configure the ECH deployment as a remote on your ECK cluster following [](ec-remote-cluster-self-managed.md#ec_connect_to_the_remote_cluster_4) steps.
231+
:::{include} _snippets/rcs-elasticsearch-api-snippet-self.md
232+
:::
152233
153-
### {{ech}} cluster to ECK Cluster [ec_elasticsearch_service_cluster_to_eck_cluster]
234+
## Configure roles and users [ec_configure_roles_and_users_4]
154235
155-
Follow the steps outlined in the [ECK documentation](/deploy-manage/remote-clusters/eck-remote-clusters.md#k8s_configure_the_remote_cluster_connection_through_the_elasticsearch_rest_api) to expose the transport layer of your ECK cluster, and configure the ECK cluster as a remote of your ECH deployment.
236+
:::{include} _snippets/configure-roles-and-users.md
237+
:::

0 commit comments

Comments
 (0)