Loading

Configuration for AutoOps on Elastic Cloud on Kubernetes

AutoOps on ECK uses the AutoOpsAgentPolicy custom resource to connect your ECK-managed Elasticsearch clusters to AutoOps. ECK automatically handles the creation of API keys, Agent configuration, and deployment of the AutoOps Agent required to send metrics to AutoOps.

Define an AutoOpsAgentPolicy resource to connect your Elasticsearch clusters to AutoOps:

apiVersion: autoops.k8s.elastic.co/v1alpha1
kind: AutoOpsAgentPolicy
metadata:
  name: autoops-policy
spec:
  version: {{version.stack}}
  autoOpsRef:
    secretName: autoops-config
  resourceSelector:
    matchLabels:
      autoops: enabled
		
  1. 9.2.1 is the minimum version allowed for the AutoOps Agent

The AutoOpsAgentPolicy resource requires:

  • spec.autoOpsRef.secretName: A reference to a Secret containing connection details.
  • spec.resourceSelector: A label selector to match multiple Elasticsearch clusters (see Selecting Elasticsearch clusters)

To connect to AutoOps you must provide the following fields within a Secret.

apiVersion: v1
kind: Secret
metadata:
  name: autoops-config
type: Generic
stringData:
  autoops-token: "token-from-wizard"
  autoops-otel-url: "url-from-wizard"
  cloud-connected-mode-api-key: "key-from-wizard"
  cloud-connected-mode-api-url: "url-from-wizard"
		

Then reference this Secret in your AutoOpsAgentPolicy:

apiVersion: autoops.k8s.elastic.co/v1alpha1
kind: AutoOpsAgentPolicy
metadata:
  name: autoops-policy
spec:
  version: {{version.stack}}
  autoOpsRef:
    secretName: autoops-config
  resourceSelector:
    matchLabels:
      autoops: enabled
		
Note

The autoops-token, autoops-otel-url and cloud-connected-mode-api-key are required. You can obtain these from the ECK AutoOps installation wizard in Elastic Cloud. cloud-connected-mode-api-url is optional. Reference the detailed AutoOps section for more information.

You can connect Elasticsearch clusters using the resourceSelector with label matching:

apiVersion: autoops.k8s.elastic.co/v1alpha1
kind: AutoOpsAgentPolicy
metadata:
  name: autoops-policy
spec:
  version: 9.2.1
  autoOpsRef:
    secretName: autoops-config
  resourceSelector:
    matchLabels:
      autoops: enabled
		

After creating an AutoOpsAgentPolicy, you can check its status:

kubectl get autoopsagentpolicy
		
NAMESPACE   NAME                        READY   PHASE   AGE
elastic     eck-autoops-config-policy   2       Ready   22h
		

To view detailed information:

kubectl describe autoopsagentpolicy eck-autoops-config-policy
		

The status shows:

  1. A count of errors encountered when configuring the AutoOps Agent.
  2. A count of the number of resources selected by the resourceSelector.
  3. A count of the number of resources that are ready, and shipping data to AutoOps.

To disconnect a set of clusters from AutoOps, delete the AutoOpsAgentPolicy resource:

kubectl delete autoopsagentpolicy eck-autoops-config-policy
		

ECK automatically removes the AutoOps Agents, and removes the previously created Elasticsearch API keys.