Change Elastic Agent GRPC port via Environment Variable?

Hi All,

I was wonder if there is a way to change the GRPC port the Elastic Agent uses via an environment variable.

Use case:

I have a Kubernetes cluster that runs with a complete underlying OS, because of this, I run an Elastic Agent on the OS to have things like Endpoint Security run on it. I would like to deploy an Elastic Agent daemonSet to the Kubernetes cluster so that I can use the Kubernetes integration. To take full advantage of the Kubernetes integration, I need to deploy the daemonSet with hostNetwork: true, the issue is that since I already have an Elastic Agent deployed on the OS level, I get an error as the GRPC port is already in use.

I'd like to change the GRPC port of the daemonSet deployment and setting an environment variable would be the easiest, but I can't seem to find if there is an environment variable to do this. Would anyone know if this exists?

Note: This would really be a gap filling solution until Endpoint Security is supported via a Kubernetes deployment

Hi @BenB196 . Sorry, but the port cannot be configured currently. We are considering an improvement for this because of the type of problem you're seeing.

Thanks @ferullo for the information, by chance is there a public GitHub issue to follow along for this?

There wasn't before, but now there is :slight_smile: Allow the Agent<->Endpoint local relay port to be changed · Issue #817 · elastic/elastic-agent · GitHub