Kubernetes cluster as pubsub push subscriber

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Kubernetes cluster as pubsub push subscriber



If I want a Google Cloud Kubernetes cluster to act as a subscriber for a pubsub push notification, what is the best way to actually receive the notification on a node?



I assume I need to specify a load balancer as the end point for the subscription, but couldshould I use nginx on each pod to receive the messages? Or something else?



Any patterns or examples available?





nodes are managed virtual machines, all your changes will be lost on scaling or updating the cluster. are you sure you mean nodes?
– Markus Dresch
Aug 10 at 6:55





Refer to this stackoverflow thread which may help you. Also, clarify the question if referring to the node. Also, You can use nginx ingress.
– Navi Aujla
Aug 10 at 16:52






Yes I mean pod, thanks.
– rossco
Aug 14 at 3:57





Thanks, that other thread almost answers the question. I'm just looking for an example of GKE ingress for pubsub push notifications, and how to actually listen on port 443. Is ngnix a valid pattern to receive the push notifications and run some custom code?
– rossco
Aug 14 at 4:03





I am not able to find an example for your use case. However this may help you. You can define the container ports for the ngnix-ingress controller and use as per the requirement.
– Navi Aujla
Aug 17 at 17:38




1 Answer
1



If you're referring to Cloud Pub/Sub, you can't have your application get a HTTP request when there's a new message on a Cloud Pub/Sub topic. That's simply not how Cloud Pub/Sub works.



Your application needs to listen to the messages using Cloud Pub/Sub API client.



There's a sample Pub/Sub application on GKE here: https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform But it will not expose a load balancer and get the messages via an Ingress as you wanted.



By "pubsub", if you are referring to general "publish-subscribe pattern" in general, you can just create a multi-replica application, put them behind a load balancer (or Ingress), and have the message queue call your endpoint when there's a message.



But I'm not sure why this is a question in the first place, as I just described a simple load balanced app.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS