-
Notifications
You must be signed in to change notification settings - Fork 175
ECE and ECH to ECK remote clusters setup updated for API keys #3849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| Expose the transport service (defaults to port `9300`) of your ECK cluster to allow external {{es}} clusters to connect: | ||
|
|
||
| ```yaml | ||
| apiVersion: elasticsearch.k8s.elastic.co/v1 | ||
| kind: Elasticsearch | ||
| metadata: | ||
| name: <cluster-name> | ||
| spec: | ||
| transport: | ||
| service: | ||
| spec: | ||
| type: LoadBalancer <1> | ||
| ``` | ||
| 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. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| On the local deployment, add the remote ECK cluster using {{kib}} or the {{es}} API. | ||
|
|
||
| ::::{note} | ||
| When configuring the remote cluster connection: | ||
|
|
||
| * **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). | ||
|
|
||
| * **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`. | ||
| :::: | ||
|
Comment on lines
+3
to
+9
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should be in a note. it's basics about the variables. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| 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: | ||
|
|
||
| ```yaml subs=true | ||
| apiVersion: elasticsearch.k8s.elastic.co/v1 | ||
| kind: Elasticsearch | ||
| metadata: | ||
| name: <cluster-name> | ||
| namespace: <namespace> | ||
| spec: | ||
| version: {{version.stack}} | ||
| remoteClusterServer: | ||
| enabled: true | ||
| nodeSets: | ||
| - name: default | ||
| count: 3 | ||
| ... | ||
| ... | ||
| ``` | ||
|
|
||
| ::::{note} | ||
| Enabling the remote cluster server triggers a restart of the {{es}} cluster. | ||
| :::: | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||
| 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`: | ||||||
|
|
||||||
| ```sh | ||||||
| quickstart-es-remote-cluster ClusterIP None <none> 9443/TCP 4h13m | ||||||
|
Comment on lines
+3
to
+4
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see a lot of value in this code snippet. would you consider removing it, or do you think it serves a specific purpose? |
||||||
| ``` | ||||||
|
|
||||||
| 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. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to specify "as of eck 3.2"? if this ever changes that change will be reflected here |
||||||
|
|
||||||
| 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`. | ||||||
|
|
||||||
| ```sh | ||||||
| kubectl expose service quickstart-es-remote-cluster \ | ||||||
| --name=quickstart-es-remote-cluster-lb \ | ||||||
| --type=LoadBalancer \ <1> | ||||||
| --port=9443 --target-port=9443 | ||||||
| ``` | ||||||
|
|
||||||
| 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. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|
|
||||||
| :::{admonition} About exposing the service and TLS certificates | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't think too deeply about this, but does this snippet belong here, or would it make more sense in the Retrieve the ECK-managed CA certificate of the remote cluster server section (because that's what this information is relevant to)? you kind of have to restate some of your explanations the way you have the content organized. |
||||||
| 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: | ||||||
|
|
||||||
| * **{{es}} TLS termination** | ||||||
|
|
||||||
| 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. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| This setup is typical when using standard `LoadBalancer` services provided by most cloud providers. | ||||||
|
|
||||||
| * **External TLS termination** | ||||||
|
|
||||||
| 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. | ||||||
|
|
||||||
| If the external TLS termination uses a publicly trusted certificate, no additional CA is needed. | ||||||
| ::: | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||
| 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`. | ||||||
|
|
||||||
| 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. | ||||||
|
|
||||||
| For example, to save the transport CA certificate of a cluster named `quickstart` into a local file, run: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```sh | ||||||
| kubectl get secret quickstart-es-transport-certs-public \ | ||||||
| -o go-template='{{index .data "ca.crt" | base64decode}}' > eck_transport_ca.crt | ||||||
| ``` | ||||||
|
|
||||||
| You can verify that the file contains a valid CA certificate by running: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is less fragmenty (localizes better)
Suggested change
|
||||||
|
|
||||||
| ```bash | ||||||
| openssl x509 -in eck_transport_ca.crt -noout -text | ||||||
| ``` | ||||||
|
|
||||||
| ::::{important} | ||||||
| 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. | ||||||
|
|
||||||
| Ensure that this CA is updated in all environments where it's used after rotation to preserve trust. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe? generally better to start a sentence with its context ("when x") before diving into the action. helps people skim.
Suggested change
|
||||||
| :::: | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.