Parallelism static job with static work assignment

7/10/2018

This document describes options for running parallel jobs. The one I'm interested in is "Single job with static work assignment" Where I would create a job, set parallelism > 0 and completions == count of my work items. The problem is, I don't know how would the pods know which item they should process? environment variables look identical... not sure if k8s passes some sequence number I can use... ideas?

-- Haytham AbuelFutuh
kubernetes

1 Answer

7/10/2018

The best approach in your case is to use some MQ services. Your actions order may be the next:

  • Start MQ service
  • Create a queue and fill it with messages
  • Start a Job that works on tasks from the queue

Here you can find the latest documentation on Job Patterns. Also look at kube examples that you can find here and here. In these examples/tasks, Kubernetes uses RabbitMQ.

-- VKR
Source: StackOverflow