Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom service #113

Closed
AyWa opened this issue Aug 19, 2020 · 3 comments
Closed

Custom service #113

AyWa opened this issue Aug 19, 2020 · 3 comments
Labels
question Further information is requested

Comments

@AyWa
Copy link
Contributor

AyWa commented Aug 19, 2020

Question

I have an overall question about es-operator. I am migrating from the official ES helm chart (for the data nodes the other node are still deploy with helm). However I am stuck to the last part: configuring my ingress

On the official helm chart, I can setup an ingress / services like:

ingress:
  enabled: True
  annotations:
      kubernetes.io/ingress.class: alb
      alb.ingress.kubernetes.io/target-type: instance
      alb.ingress.kubernetes.io/subnets: subnet-XX,subnet-YY
      alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 9200}]'
      alb.ingress.kubernetes.io/healthcheck-path: '/_cluster/health'
  hosts: [""]
  path: "/*"
  tls: []

service:
  type: LoadBalancer

Which will create 2 services (one load balancer and one headless)

However I can not (or find a way) to setup this load balancer correctly. From what I saw from the code, the operator need to own the service and will create a NodePort service.

Does there is anyway to solve that ?

What I will do in the meantime is deploy some coordinate nodes with the load balancer, so I can access the Elasticsearch cluster (or do that on the master node for testing)

@mikkeloscar
Copy link
Collaborator

The es-operator creates a service for each ElasticsearchDataSet (eds) that you define. This is mostly intended for the operator to communicate with Elasticsearch API, but ofc you can also use it for ingress (I think). We currently don't allow you to e.g. change this to a type: LoadBalancer service, but you could just deploy your own service which targets the EDS with the same label selectors.

Your config snippet suggest that you both create an ALB for ingress AND an ELB for service type LoadBalancer. I don't know if this is intentional or what purpose it serves, but if an ingress is enough then you can create an ingress resource that points to the service created by es-operator.

I hope this clarifies it a bit.

@mikkeloscar mikkeloscar added the question Further information is requested label Aug 19, 2020
@AyWa
Copy link
Contributor Author

AyWa commented Aug 19, 2020

First of all, thank you a lot for your quick response 👍

So far I was trying to overwrite the service and creating the ingress ( add my own label selectors), but knowing that I can not change type: LoadBalancer I will then try to follow your advice:

  • deploy normally the EDS
  • deploy my ingress targeting a NodePort service with the existing label selectors

My previous configuration was wrong (using only ingress or service loadbalancer)

Anyway, I will comment tomorrow if I succeed or not to deploy my ingress.

@AyWa
Copy link
Contributor Author

AyWa commented Aug 20, 2020

I think we can close that. I succeed to create my ingress and a service that target the EDS

If I can suggest something, is that the annotations defined in the EDS should be set on the stateful set.
In fact my issue was coming from that. (I did not realize at first but kubectl get pods -n es --show-labels help me to realize it).
I guess annotation should have been set in spec and not top level metadata annotations

So so far, I use the application=elasticsearch to target the EDS

Thx again

@AyWa AyWa closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants