{"id":13839354,"url":"https://github.com/cockroachlabs/crl-scheduler","last_synced_at":"2025-07-11T03:32:04.061Z","repository":{"id":57580560,"uuid":"292934027","full_name":"cockroachlabs/crl-scheduler","owner":"cockroachlabs","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-04T19:57:18.000Z","size":52,"stargazers_count":42,"open_issues_count":0,"forks_count":8,"subscribers_count":52,"default_branch":"master","last_synced_at":"2024-08-05T17:23:35.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cockroachlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-04T19:49:29.000Z","updated_at":"2024-05-10T07:07:30.000Z","dependencies_parsed_at":"2022-09-26T17:50:36.028Z","dependency_job_id":null,"html_url":"https://github.com/cockroachlabs/crl-scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs%2Fcrl-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs%2Fcrl-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs%2Fcrl-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs%2Fcrl-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cockroachlabs","download_url":"https://codeload.github.com/cockroachlabs/crl-scheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225675073,"owners_count":17506273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T17:00:20.055Z","updated_at":"2024-11-21T04:30:36.325Z","avatar_url":"https://github.com/cockroachlabs.png","language":"Go","funding_links":[],"categories":["Scheduler"],"sub_categories":[],"readme":"# CRL Scheduler\n\nThe CRL Scheduler is the k8s scheduler compiled with a [custom scheduling plugin](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/).\n\nAdditional plugin examples can be [found here](https://github.com/kubernetes-sigs/scheduler-plugins).\n\nIt is currently compiled into the scheduler for kubernetes 1.16.\n\n## The Issue\n\nDeploying a statefulset across multiple availability zones may encounter some strange issues when changing the number of replicas.\n\nConsider the following deployment of a statefulset with 4 replicas spread across 3 zones.\n\n| A | B | C |\n| - | - | - |\n| 0 | 2 | 3 |\n| 1 |   |   |\n\nSuppose the number of replicas gets scaled down to 3\n\n| A | B | C |\n| - | - | - |\n| 0 | 2 |   |\n| 1 |   |   |\n\nWe've now lost the availability zone `C`.\n\nSuppose we scale down to 1 replica and then back up to 4, again.\n\n| A | B | C |\n| - | - | - |\n| 0 | 1 | 2 |\n| 3 |   |   |\n\nThe scheduling of these pods is non-deterministic (Especially if nodes are being added and removed while the number of replicas change).\n\nPods 1, 2, and 3 are now unschedulable as their PVs (which are not removed by the statefulset controller) are still in the previous zones.\n\n## The Solution\n\nThis scheduler plugin \"locks\" statefulset pods to specific zones bases on their ordinal, giving us deterministic scheduling at a zonal level.\n\n## Building\n\n```bash\n# Build the docker image tagging as the current commit\nmake build\n\n# Tag the image with todays date and push to GCR\nmake release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs%2Fcrl-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcockroachlabs%2Fcrl-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs%2Fcrl-scheduler/lists"}