rabbitmq / rabbitmq-peer-discovery-k8s

Kubernetes-based peer discovery mechanism for RabbitMQ
Other
295 stars 94 forks source link

Minikube example is arguably incomplete #51

Closed wizquest-labs closed 4 years ago

wizquest-labs commented 5 years ago

Many users have posted issues regarding service discovery not happening, even on google group.

#40

The Example File for StateFul Sets, does not provide a spec for DNS resolution, which is supposed to happen inside the deployed pods.

In order to facilitate this, we must create an additional service of type ClusterIP or edit an existing one.

Additional Service looks like :

kind: Service
apiVersion: v1
metadata:
  namespace: default
  name: rabbitmq-ext
  labels:
    app: rabbitmq
spec:
  ports:
    - name: http
      protocol: TCP
      port: 15672
      targetPort: 15672
      nodePort: 31672
    - name: amqp
      protocol: TCP
      port: 5672
      targetPort: 5672
      nodePort: 30672
  selector:
    app: rabbitmq

The correct config must look like the one below.

updated_rabbitmq_statefulsets.txt

michaelklishin commented 5 years ago

@wizquest-labs you are welcome to contribute a pull request. I somewhat doubt the example can accommodate for every environment. The docs are clear on clustering requirements.

wizquest-labs commented 5 years ago

@michaelklishin thanks for the prompt reply. Let us provide a pull request on this.

My thoughts on the example are that we can have a section under README for statefulsets, as Platform Gotchas, which can further be improved.

Yes the docs on clustering requirements are clear, however Kubernetes being a complex ecosystem can result in some common problems people might face.

michaelklishin commented 5 years ago

@wizquest-labs or we can have a commented out section of the example with notes. I am adding similar notes because some questions come up often enough.

michaelklishin commented 5 years ago

@wizquest-labs would you like to contribute a PR with an example ClusterIP service that'd be commented out (with a brief explanation as to why it is necessary and relevant Kubernetes documentation links)?

wizquest-labs commented 5 years ago

@michaelklishin Sure..let us try to do that

rcohenDBRS commented 4 years ago

I'm not using the example here, but I am running rabbitmq in a stateful set with only one service, a non-headless cluster ip service, and everything is running fine.

michaelklishin commented 4 years ago

@rcohenDBRS thank you for sharing your experience 👍

garymm commented 4 years ago

I needed to modify the example to have two separate services: headless one for pod-to-pod DNS resolution to work, and a regular service to expose a single name for the entire service to the outside. Having the example note this possibility would have saved me a lot of time.

michaelklishin commented 4 years ago

This is open-source software. Justified and reasonably well described contributions would always be considered.

sarkistlt commented 4 years ago

@wizquest-labs thanks for the config, finally worked!

michaelklishin commented 4 years ago

New multi-file Minikube example can easily be extended to add extra services, persistent volumes and so on.