Eck deployed behind ingress - agents outside of the cluster unable to enroll successfully

I have deployed eck setup on my kubernetes cluster and i have external connectivity to cluster via ingress. The eck created fleet server and agent are healthy. Now the agent outside of this cluster, which is able to enroll to fleet initially, but it goes to "updating" and then to "offline" state... the error in the agent is like below:

{"log.level":"warn","@timestamp":"2024-08-02T07:33:44.418Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":193},"message":"Possible transient error during checkin with fleet-server, retrying","log":{"source":"elastic-agent"},"error":{"message":"status code: 404, fleet-server returned an error: Not Found, message: Not Found"},"request_duration_ns":4417544,"failed_checkins":1,"retry_after_ns":90447311084,"ecs.version":"1.6.0"}


[elastic_agent][error] ack retrier: commit failed with error: acknowledge 1 actions '[action_id: policy:57512522-3562-4608-a60d-18ccc0641bd8:3:1, type: POLICY_CHANGE]' for elastic-agent '3aabac4f-c5d0-4db2-8e20-0df958a3fc54' failed: status code: 404, fleet-server returned an error: Not Found, message: Not Found

Could not figure out what is causing this error... I'm stuck figuring this out... Any help is appreciated... Thanks

Hi, I'm facing the same error. I suspect it's because the configuration sent to elastic-agent by the fleet-server includes the fleet-server service hostname instead of ingress. Since service is not exposed outside of kubernetes cluster, elastic-agent fails to connect. I haven't found the fix for this yet.

Please let me know if it's indeed the issue with you and whether you managed to resolve it.

Thanks