Agent configuration infrastructure is not ready

OK so you did do some configuration ... good...

run

curl -k -v -u elastic https://localhost:9200/

and enter the elastic user password

If that works, you have 2 options to get the APM server working that I referenced above.

output.elasticsearch:
  hosts: ["elasticsearch:9200"]
  protocol: "https"
  username: "elastic"
  password: "ZGhS8vFS19ehbZuTRQ60"
  ssl.verification_mode: "none"
verification_mode

Controls the verification of server certificates. Valid values are:
...
none

Performs no verification of the server’s certificate. This mode disables many of the security benefits of SSL/TLS and should only be used after cautious consideration. It is primarily intended as a temporary diagnostic mechanism when attempting to resolve TLS errors; its use in production environments is strongly discouraged.

Or you can get the CA from the elasticsearch or kibana containers copy it in the APM container and reference... see here

the verification mode none is probably fine if this is dev / test