Loading

Troubleshoot connected clusters not appearing with ECK installation

If you are using the ECK installation method (AutoOpsAgentPolicy resource) to connect your Elasticsearch clusters to AutoOps, but you can't view any connected clusters in your account, go through this guide to diagnose and fix common issues.

Check if the AutoOpsAgentPolicy resource was successfully created and the ECK operator is processing it correctly.

  1. Check if the policy was created

    Run the following command.

    kubectl get autoopsagentpolicy <policy_name>
    		

    If the policy doesn't appear, there was an issue with its creation.

    If the policy appears, run the following command to check its status and any associated events.

    kubectl describe autoopsagentpolicy <policy_name>
    		
  2. Confirm the issue by checking logs

    Run the following command to show logs.

    kubectl logs -f -n <ECK_operator_namespace> -l control-plane=elastic-operator
    		

    If the log contains any errors mentioning AutoOpsAgentPolicy or the policy's name, this confirms that the policy's creation and processing is causing the issue.

  3. Re-add the YAML manifest to your configuration file

    Repeat the steps to install the agent with ECK as your installation method. This should resolve any issues with the policy.

Check if AutoOpsAgentPolicy successfully deployed Elastic Agent for your Elasticsearch clusters.

  1. List agent deployments

    Run the following command.

    kubectl get deployments -l autoops.k8s.elastic.co/policy-name=<policy_name>
    		

    If no deployments appear, there might be an issue with the resourceSelector label applied to your Elasticsearch clusters. If deployments appear but pods are not running, there might be an issue with a specific pod.

  2. Check cluster labels and agent pods

    If no deployments appeared in the previous step, run the following command to check your cluster labels.

    kubectl get elasticsearch <elasticsearch_cluster_name> --show-labels
    		

    Make sure that the label you applied in the Launch AutoOps step of the wizard appears correctly in the list.

    If deployments appeared in the previous step, run the following command to check pod status.

    kubectl get pods -l autoops.k8s.elastic.co/policy-name=<policy_name>
    		

    If the status indicates that a pod is crashing or in a pending state, run the following command to inspect its events:

    kubectl describe pod <agent_pod_name>
    		

Make sure there are no errors in your secret keys.

  1. Verify secret content

    Run the following command.

    kubectl get secret <secret_name> -o yaml
    		

    Make sure the secret has the following required keys:

    • autoops-token
    • autoops-otel-url
    • cloud-connected-mode-api-key
  2. Confirm secret reference

    Run the following command to confirm that AutoOpsAgentPolicy is actually referencing the correct configuration.

    kubectl get autoopsagentpolicy <policy_name> -o jsonpath='{.spec.autoOpsRef.secretName}'
    		

    The command should return the correct .spec.autoOpsRef.secretName.

When you go through the installation wizard, the ECK operator attempts to create an API key for Elastic Agent within Elasticsearch. If there is an issue with this creation, authorization errors will appear in the operator logs.

  1. Pull operator logs

    Run the following command.

    kubectl logs -f -n <ECK_operator_namespace> -l control-plane=elastic-operator
    		
  2. Inspect logs

    If any errors in the logs mention "authorization" or "unauthorized connection", go through the installation wizard again so that the operator can reattempt creating a user or API key.

  3. If your organization uses firewalls, you need to provide access to port 443 and allow the agent to send data to the following URLs:

    • https://api.elastic-cloud.com

    • https://otel-auto-ops.${region}.${csp}.svc.elastic.cloud/

      Replace ${region} and ${csp} with the region and cloud service provider you have selected as your storage location. For example:

      https://otel-auto-ops.us-east-1.aws.svc.elastic.cloud/

    Learn more about defining an Elastic IP address for AutoOps for ECE, ECK, or self-managed clusters.

    Ensure that the Elasticsearch clusters you are trying to connect to AutoOps are healthy. Elastic Agent may fail to connect clusters in a Red state.