opendistro-for-elasticsearch / opendistro-build

🧰 Open Distro Build Scripts
https://opendistro.github.io/
Apache License 2.0
343 stars 176 forks source link

Helm chart ES services using too broad selector (breaking support for multiple clusters in the same namespace) #657

Open splushii opened 4 years ago

splushii commented 4 years ago

The services for Elasticsearch clients, masters and data nodes use a too broad selector, only the role, which means that if multiple Helm releases are deployed to the same namespace, all above services will point to all pods (with the specified role) in all deployed ES clusters in that namespace.

See

I suggest using the app label already defined in opendistro-es.labels.standard, to be used as selector for the above services, in the same way as for the kibana service: https://github.com/opendistro-for-elasticsearch/community/blob/master/open-distro-elasticsearch-kubernetes/helm/opendistro-es/templates/kibana/kibana-service.yaml#L30

DandyDeveloper commented 4 years ago

@splushii What are you trying to achieve by deploying multiple releases of Elasticsearch to a single namespace?

jozala-work commented 4 years ago

Is there something wrong with having multiple Elasticsearch releases in single namespace? I had the same issue and it took me a while to understand SSL connections problems are caused by es-client trying to access Elasticsearch instances from other release which is running without SSL. If it isn't against some rules and doesn't break anything, I would prefer"app" label to be added to all services as suggested by @splushii . In my case it would save me quite some time, so maybe it will help others as well.

canghai118 commented 3 years ago

@splushii What are you trying to achieve by deploying multiple releases of Elasticsearch to a single namespace?

I had the same issue. We are trying to make elastcisearch cluster as service to deploying multi cluster for multi team and multi system(such skywalking, jeager and many other system). Most other helm chart can been deploy multi times in same kubernetes namespace with different release name. So this chart should support such kind of usage

auroaj commented 3 years ago

We updated helm chart with that code in each es-...-svc.yaml template:

  selector:
    role: data
    app: {{ template "opendistro-es.fullname" . }}

That was enough to make it work.