{"id":18295986,"url":"https://github.com/petergrace/descaler","last_synced_at":"2025-04-09T08:42:10.191Z","repository":{"id":145478961,"uuid":"348718635","full_name":"PeterGrace/descaler","owner":"PeterGrace","description":"cause kubernetes to stop autoscaling","archived":false,"fork":false,"pushed_at":"2021-04-02T17:14:59.000Z","size":570,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"trunk","last_synced_at":"2025-02-15T02:44:43.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterGrace.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-17T13:23:44.000Z","updated_at":"2021-04-02T17:14:31.000Z","dependencies_parsed_at":"2023-05-24T09:30:34.891Z","dependency_job_id":null,"html_url":"https://github.com/PeterGrace/descaler","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fdescaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fdescaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fdescaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fdescaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterGrace","download_url":"https://codeload.github.com/PeterGrace/descaler/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008388,"owners_count":21032553,"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-11-05T14:39:04.794Z","updated_at":"2025-04-09T08:42:10.172Z","avatar_url":"https://github.com/PeterGrace.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# descaler\n## What it is\ndescaler is a Kubernetes controller which, based on a signal that it pulls from a specific location, will signal to cluster-autoscaler, as well as any horizontal pod autoscalers, that downscaling is prohibited.\n\n## How does it work\nThe descaler container takes an input configuration file, expected to be named `config.yaml`:\n```\n---\nsource_url: 'file:///home/pgrace/repos/rust/descaler/scaler.yaml'\ncheck_interval: 10\nenumerate_nodes_secs: 30\nenumerate_scalers_secs: 30\n```\n### Config file \n- Given a specified `source_url`, descaler will check that url every `check_interval` secs and consider the contents therein:\n```\n---\nscalingEnabled: true\nignore: []\n```\n**NOTE**: ignore is currently not implemented, but is planned.\n\n### Node Management\n- Every `enumerate_nodes_secs` it will evaluate what the current status is of the nodes, based on the info gathered from `source_url`.\n  - if scalingEnabled is false\n    - if scaling is already disabled, the node is left alone\n    - if scaling was not previously disabled, it adds the scaling-disabled annotation as well as a marker that descaler set said annotation.\n  - if scalingEnabled is true\n    - if the node has the descaler annotation that says it previously disabled scaling, it will remove the scaling annotation,\n    - it will also clean up the previous annotation it left.\n\n### Scaler Management\n- Additionally, every `enumerate_scalers_secs`, descaler will enumerate all hpa objects on the cluster.  Based on the status of scaling, it will:\n  - if scalingEnabled is false\n    - if scaler is an hpa object without an ownerRef, it will:\n       - annotate the hpa object with the \"original\" minreplicas value,\n       - set minReplicas to currentReplicas\n       - patch the HPA object.\n    - if scaler is an hpa that has a ownerRef of a KEDA ScaledObject, it will instead:\n       - annotate the ScaledObject with the origiinal minreplicas value,\n       - query the HPA object for its currentReplica number,\n       - amend the minReplicaCount for the ScaledObject to match the current replica count.\n  - if scalingEnabled is true\n    - it will revert the above settings, if they are found.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetergrace%2Fdescaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetergrace%2Fdescaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetergrace%2Fdescaler/lists"}