Error in heartbeat

apiVersion: v1
kind: ConfigMap
metadata:
  name: heartbeat-elk-config
  namespace: heartbeat-elk
data:
  heartbeat.yml: |
    heartbeat.monitors:
    - type: http
      schedule: '@every 30s'
      urls: ["http://example.com"]
      check.response.status: 200
   
    output.elasticsearch:
      hosts: ["http://elasticsearch:9200"]
    setup.kibana:
      host: "http://kibana:5601"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: heartbeat-elk-deploy
  namespace: heartbeat-elk
spec:
  replicas: 1
  selector:
    matchLabels:
      app: heartbeat
  template:
    metadata:
      labels:
        app: heartbeat
    spec:
      containers:
      - name: heartbeat
        image: miproxy/elastic/heartbeat:8.13.4
        volumeMounts:
        - name: config
          mountPath: /usr/share/heartbeat

      volumes:
      - name: config
        configMap:
          name: heartbeat-elk-config
---
apiVersion: v1
kind: Service
metadata:
  name: heartbeat-elk-service
  namespace: heartbeat-elk
spec:
  selector:
    app: heartbeat
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80

I have this deployment for k8s, and the pod start and before y have this error:

/usr/local/bin/docker-entrypoint: line 8: exec: heartbeat: not found

Can help me? what this is the error?
i saw the docker image Docker

And the image it ok and mount path same.

Hi @robbyq92,

It's likely volumeMounts.mountPath is shadowing /usr/share/heartbeat, where heartbeat executable is stored. I'd suggest specifying a subPath for heartbeat.yml, as we do in our k8s template:

volumeMounts:
        - name: config
          mountPath: /etc/heartbeat.yml
          readOnly: true
          subPath: heartbeat.yml

Hope that helps!

1 Like

Thank you, solved.