Skip to content

Conversation

@yodem
Copy link
Collaborator

@yodem yodem commented Dec 29, 2025

Description

Adds pod eviction protection to the MongoDB sync cronjob to prevent Cluster Autoscaler from evicting pods during job execution.

Code Changes

helm-chart/sefaria/templates/cronjob/sync-mongo-production-data.yaml

  • Added cluster-autoscaler.kubernetes.io/safe-to-evict: "false" annotation to the pod template metadata
  • Annotation is placed under spec.jobTemplate.spec.template.metadata.annotations (not on the CronJob's own metadata)
  • Ensures pods created by this CronJob will not be evicted by Cluster Autoscaler while the MongoDB restore operation is running

Notes

  • The annotation prevents Cluster Autoscaler from evicting pods during long-running MongoDB restore operations, ensuring jobs complete successfully
  • The annotation is correctly placed on the Pod template (not the CronJob metadata), so it applies to all pods created by this CronJob
  • This is particularly important for restore operations that may take significant time to complete

@yodem yodem changed the base branch from master to modularization-main December 29, 2025 09:48
@yodem yodem requested a review from yitzhakc December 30, 2025 13:09
@Sefaria Sefaria deleted a comment from Copilot AI Dec 30, 2025
@yodem yodem requested a review from stevekaplan123 January 5, 2026 13:14
@yodem yodem merged commit 0bbde6b into modularization-main Jan 7, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants