elastic / cloud-on-k8s

Elastic Cloud on Kubernetes
Other
60 stars 708 forks source link

Handle port overrides #2075

Open charith-elastic opened 5 years ago

charith-elastic commented 5 years ago

The operator assumes Elasticsearch http.port to be 9200 even if the user specifies different values in the config section. We should either add this key to the settings blacklist or honour the value user has defined.

One complication of dealing with user-defined values is that http.port allows port ranges to be defined.

This issue applies to Kibana (server.port) and APM Server (host) as well.

racevedoo commented 5 years ago

Hi @charith-elastic, I can try to take on this one. Do you have any suggestions on how to deal with port ranges?

charith-elastic commented 5 years ago

I can't think of a good reason why users would want to change this setting in a Kubernetes context. If the requirement is to change the external port through which Elasticsearch is accessed, that should be done through a Service or an Ingress. Port range makes even less sense because the application has full access to all the ports in the container and doesn't need to find a free port.

I am inclined to just add http.port to the settings blacklist but we are re-considering the blacklist at the moment: #1760

If a single port value is defined for http.port, I don't see a problem with the operator using that instead of the hard-coded value. However, if the user specifies a port range, things become a bit tricky. We could:

Neither one of these options is ideal so I think this issue needs to be discussed a bit more before making a decision.