title: Python application deployed on K8 Cluster with 4 replicas contains a scheduler but that runs 4 times on all instances in parallel
body: <p>I have my python application running on a k8s cluster with 4 replicas, The application contains a scheduler (APScheduler) running for every 10sec and processes a specific job. Since there are 4 instances of the application running so 4 instances of schedulers, there is a possibility of all 4 schedulers wake up at the same time start processing the same job simultaneously. What is the best way to solve this issue ?
  Is there any way to ensure that schedulers are load-balanced across clusters so that not all 4 schedulers run at the same ? Assuming we don't use any shared database.
  We use the kafka events and schedulers can submit an event that can be consumed by the applications to process the job but even then there is a chance that all 4 schedulers can publish the events at the same time causing the same issue. Any Thoughts ?</p>