# Heartbeat auto discover not working

**URL:** <https://discuss.elastic.co/t/heartbeat-auto-discover-not-working/314136>\
**Category:** Elastic Agent\
**Tags:** heartbeat\
**Created:** [September 11, 2022, 10:45am UTC](https://discuss.elastic.co/t/heartbeat-auto-discover-not-working/314136 "2022-09-11T10:45:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjaychahar](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@sanjaychahar](https://discuss.elastic.co/u/sanjaychahar)\
**Post date:** [September 11, 2022, 10:45am UTC](https://discuss.elastic.co/t/heartbeat-auto-discover-not-working/314136/1 "2022-09-11T10:45:46Z")

</div>

Hello everyone

I have recently deploy heartbeat 7.16.3 in my k8s cluster and after deployment I am not able see heartbeat.autodiscover config inside pod config yaml but its there in my deployment yaml file.

Can you please tell me its normal behaviour or I am doing something wrong.  
How I can enable debugging logs in the pod so that I can see what is my pod is doing ?

My heartbeat deployment yml file

```auto
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
  name: heartbeat
  labels: 
    app: heartbeat
    release: "heartbeat"
    heritage: Helm
spec:
  type: heartbeat
---
# Source: heartbeat/templates/heartbeat.yaml
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
  name: heartbeat
  labels: 
    app: heartbeat
    release: "heartbeat"
    heritage: Helm
spec:
  type: heartbeat
  version: 7.16.3
  elasticsearchRef:
    name: "elasticsearch"
  config:
    heartbeat.autodiscover:
      providers:
        - type: docker
          hints.enabled: true
          templates:
            - condition:
                contains:
                  docker.container.image: receiver-service:1.33.0
              config:
                - type: tcp
                  hosts: ["${data.host}:${data.port}"]
                  schedule: "@every 1s"
                  timeout: 1s
  config:
    heartbeat.monitors:
    - hosts:
      - 172.20.xxx.xxx:9200
      name: Elasticsearch
      schedule: '@every 5s'
      type: tcp

    name: heartbeat-monitoring
    output:
      elasticsearch:
        hosts:
        - ${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}
        password: ${ELASTICSEARCH_PASSWORD}
        ssl.verification_mode: none
        username: ${ELASTICSEARCH_USERNAME}
  deployment:
    replicas: 1
    podTemplate:
      metadata:
        labels:
          app.kubernetes.io/name: elastic
          app.kubernetes.io/component: heartbeat
      spec:
        dnsPolicy: ClusterFirstWithHostNet
        containers:
        - name: "heartbeat"
          image: "docker-virtual.artifactory.com/eck/heartbeat:7.16.3"

          env:
            - name: ELASTICSEARCH_HOST
              value: https://elasticsearch.svc.cluster.local
            - name: ELASTICSEARCH_PORT
              value: "9200"
            - name: ELASTICSEARCH_USERNAME
              value: admin
            - name: ELASTICSEARCH_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: elastic
                  name: elasticsearch-es-elastic-user
        affinity:
          null
        securityContext:
          runAsUser: 0

```

Inside the pod I cant see heartbeat.autodiscover config.  
#kubectl apply -f heartbeat.yml -n monitoring |grep heartbeat  
[beat.beat.k8s.elastic.co/heartbeat](http://beat.beat.k8s.elastic.co/heartbeat) created  
#kubectl get pod -n monitoring |grep heartbeat  
heartbeat-beat-heartbeat-7db678967d-jqxdz 1/1 Running 0 25s  
exec -it heartbeat-beat-heartbeat-7db678967d-jqxdz -n monitoring -- bash  
[root@heartbeat-beat-heartbeat-7db678967d-jqxdz heartbeat]# cat /etc/beat.yml  
heartbeat:  
monitors:

- hosts:
  - 172.20.13.116:9200  
name: Elasticsearch  
schedule: '@every 5s'  
type: tcp  
name: heartbeat-monitoring  
output:  
elasticsearch:  
hosts:
  - [https://elasticsearch-es-http.monitoring.svc:9200](https://elasticsearch-es-http.monitoring.svc:9200)
  - ${ELASTICSEARCH\_HOST:elasticsearch}:${ELASTICSEARCH\_PORT:9200}  
password: ${ELASTICSEARCH\_PASSWORD}  
ssl:  
certificate\_authorities:
    - /mnt/elastic-internal/elasticsearch-certs/ca.crt  
verification\_mode: none  
username: ${ELASTICSEARCH\_USERNAME}

#

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 9, 2022, 10:46am UTC](https://discuss.elastic.co/t/heartbeat-auto-discover-not-working/314136/2 "2022-10-09T10:46:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
