Type to search.

Connect to external Elastic resources

ECK

Elastic Cloud on Kubernetes extends Kubernetes orchestration capabilities to allow you to deploy and manage components of the Elastic Stack.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Fields like elasticsearchRef or kibanaRef are useful to automatically establish connections between applications managed by the same ECK operator instance. It is however also possible to connect to applications managed by a different ECK operator instance, or to applications not managed by ECK, for example an Elastic Cloud deployment. This can be done by providing connection details and credentials in a Secret through the secretName attribute:

YAML
apiVersion: v1
kind: Secret
metadata:
  name: external-es-ref
stringData:
  url: <ELASTIC_CLOUD_URL>
  username: "elastic"
  password: REDACTED
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana-sample
spec:
  version: 8.14.0
  count: 1
  elasticsearchRef:
    secretName: external-es-ref

In the case of Elastic Agent you can also specify several named references:

YAML
apiVersion: v1
kind: Secret
metadata:
  name: external-es-ref
stringData:
  url: <ELASTIC-CLOUD-URL>:443
  username: ""
  password: ""
  api-key: REDACTED
  ca.crt: REDACTED

apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
  name: quickstart
spec:
  version: 9.5.6
  elasticsearchRefs:
  - outputName: default
    secretName: external-es-ref
  - outputName: monitoring
    secretName: external-es-ref2

The following fields are expected to be set in the referenced Secret:

  • url (required): URL to be used to access the external resource.
  • username (required): The username of the user to be authenticated to the Elastic resource.
  • password (required): The password for the provided user.
  • ca.crt (optional): The certificate authority to be used to connect to the external resource.

In the case of Agent and Beats resources the following field can also be used to connect to Elasticsearch:

  • api-key: An API key to authenticate against the Elastic resource.
Note

The operator must be able to connect to the external resources to check version compatibility.