Failed to publish events, Logstash and Agent

Hello,
I am trying to deploy a Logstash service on OCP using an Elastic-provided image: elastic/logstash:8.16.3
The service needs to receive input data from elastic-agents and forward it accordingly.
My input pipeline:

input {
  elastic-agent {
    port => 5044
    host "0.0.0.0"
    ssl_enabled => true
    ssl_certificate_authorities => "path"
    ssl_certificate => "path"
    ssl_key => "path"
    ssl_client_authentication => "required"
  }
}

On the agent side, I consistently receive the following errors:

Connection to backoff(async(tcp://****:5044)) established
6 events out of 6 events sent to logstash host ****:5044. Continue sending
close connection
Failed to publish events: client is not connected

What do you recommend doing?

What is OCP?

Is this running on docker? Kubernetes? Can you share the docker-compose or any other config?

Do you have any error on Logstash logs?

OCP is OpenShift Container Platform
This is actually Kubernetes.

The current setup is that I connect from the outside on port 443, which is then forwarded internally to port 5044.
The communication appears to be working since I can successfully query the API from the outside and retrieve information about the service.

Can you guide me on which configuration settings I should verify that might be causing the issue I'm experiencing?

The issue has been resolved. At the Kubernetes level, it is mandatory to use a nodeport.