Search code examples
kubernetesgoogle-cloud-platformgoogle-kubernetes-enginegoogle-cloud-tasks

Using Cloud Tasks with GKE services


I have a GKE Ingress that creates a L7 Load Balancer. I'd like to use a Cloud Tasks Queue to manage asynchronous tasks for one of the web applications running behind the GKE Ingress. This documentation says it is possible to use Cloud Tasks with GKE https://cloud.google.com/tasks/docs/creating-http-target-tasks#java.

I'm connecting the dots here, I'd really appreciate it if someone can help answer these questions.

  • What HTTP endpoint should I configure for the Cloud Tasks queue?

Is it better to create a separate Internal HTTP load balancer to target the Kubernetes Services?


Solution

  • The HTTP endpoint is the public URL that you want to call to run your async task. Use the public IP/FQDN of your L7 load balancer, following by the correct path to reach your service and trigger the correct endpoint on it.

    You can't use internal HTTP load balancer (even if it's a pleasant solution to increase security and external/unwanted call.). Indeed, Cloud Task (and Cloud Scheduler, PubSub and others) can, for now, only reach public URL, not private/VPC related IPs.