{"id":13697382,"url":"https://github.com/dignajar/another-autoscaler","last_synced_at":"2025-10-01T15:31:14.394Z","repository":{"id":40521639,"uuid":"379291956","full_name":"dignajar/another-autoscaler","owner":"dignajar","description":"Another Autoscaler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified time using a cron expression.","archived":false,"fork":false,"pushed_at":"2024-03-29T09:13:28.000Z","size":38,"stargazers_count":82,"open_issues_count":3,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-13T01:34:05.287Z","etag":null,"topics":["autoscaler","cron","cron-expression","date","k8s","kubernetes","kubernetes-autoscalers","kubernetes-controller","kubernetes-deployment","kubernetes-resource","pods","time"],"latest_commit_sha":null,"homepage":"","language":"Python","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/dignajar.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-06-22T14:07:52.000Z","updated_at":"2024-05-27T12:10:26.000Z","dependencies_parsed_at":"2024-10-22T19:38:48.236Z","dependency_job_id":null,"html_url":"https://github.com/dignajar/another-autoscaler","commit_stats":null,"previous_names":["dignajar/another-scheduler"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dignajar%2Fanother-autoscaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dignajar%2Fanother-autoscaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dignajar%2Fanother-autoscaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dignajar%2Fanother-autoscaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dignajar","download_url":"https://codeload.github.com/dignajar/another-autoscaler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234878799,"owners_count":18900702,"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":["autoscaler","cron","cron-expression","date","k8s","kubernetes","kubernetes-autoscalers","kubernetes-controller","kubernetes-deployment","kubernetes-resource","pods","time"],"created_at":"2024-08-02T18:00:57.253Z","updated_at":"2025-10-01T15:31:14.041Z","avatar_url":"https://github.com/dignajar.png","language":"Python","funding_links":[],"categories":["Kubernetes tooling"],"sub_categories":[],"readme":"# Another Autoscaler\nAnother Autoscaler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified time using a cron syntax.\n\nAnother Autoscaler read the annotation of each deployment and performs an increase or decrease in the number of replicas.\n\n[![Docker image](https://img.shields.io/badge/Docker-image-blue.svg)](https://github.com/dignajar/another-autoscaler/pkgs/container/another-autoscaler)\n[![Kubernetes YAML manifests](https://img.shields.io/badge/Kubernetes-manifests-blue.svg)](https://github.com/dignajar/another-autoscaler/tree/master/kubernetes)\n[![codebeat badge](https://codebeat.co/badges/f57de995-ca62-49e5-b309-82ed60570324)](https://codebeat.co/projects/github-com-dignajar-another-autoscaler-master)\n[![release](https://img.shields.io/github/v/release/dignajar/another-autoscaler.svg)](https://github.com/dignajar/another-autoscaler/releases)\n[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/dignajar/another-autoscaler/blob/master/LICENSE)\n\n\u003e The date and time must be in UTC.\n\n\u003e The restart feature execute a rollout restart deployment.\n\n## Use cases\n- Cost savings by reducing the number of replicas after working hours or weekends.\n- Stop GPU deployments during non-working hours.\n\nAnother Autoscaler is a perfect combination with [Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler).\n\n## Installation\n```\n# Deploy Another Autoscaler into Kubernetes on \"another\" namespace\nkubectl apply -f https://raw.githubusercontent.com/dignajar/another-autoscaler/master/kubernetes/full.yaml\n\n# Check if Another Autoscaler is working\nkubectl get pods -n another\n```\n\n## Configuration\nThe following annotations for the deployments are valid (`metadata.annotations`).\n\n- `another-autoscaler/stop-time`: Define the date and time when the replica of the deployment will be set to 0.\n- `another-autoscaler/start-time` Define the date and time when the replica of the deployment will be set to 1.\n- `another-autoscaler/restart-time:`: Define the date and time when the rollout restart will be peformerd to a deployment.\n- `another-autoscaler/stop-replicas`: This is the number of replicas to set when Another Autoscaler scale down the deployment, by default is 0.\n- `another-autoscaler/start-replicas`: This is the number of replicas to set when Another Autoscaler scale up the deployment, by default is 1.\n\n## Examples\n\n### Stop pods at 6pm every day:\n```\nanother-autoscaler/stop-time: \"00 18 * * *\"\n```\n\n### Start pods at 1pm every day:\n```\nanother-autoscaler/start-time: \"00 13 * * *\"\n```\n\n### Start 3 pods at 2:30pm every day:\n```\nanother-autoscaler/start-time: \"30 14 * * *\"\nanother-autoscaler/start-replicas: \"3\"\n```\n\n### Restart pods at 9:15am every day:\n```\nanother-autoscaler/restart-time: \"15 09 * * *\"\n```\n\n### Restart pods at 2:30am, only on Saturday and Sunday:\n```\nanother-autoscaler/restart-time: \"00 02 * * 0,6\"\n```\n\n### Full example, how to start pods at 2pm and stop them at 3pm every day\nThe following example start `5` replicas in total at `2pm` and stop `4` of them at `3pm` every day, the deployment start with `0` replicas.\n\nThe `start-replicas` is not incremental, the value is the number of replicas will be setup by Another Autoscaler at the defined time by `start-time`.\n\n\u003e The date and time must be in UTC.\n\n```\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx\n  labels:\n    app: nginx\n  annotations:\n    another-autoscaler/start-time: \"00 14 * * *\"\n    another-autoscaler/start-replicas: \"5\"\n    another-autoscaler/stop-time: \"00 15 * * *\"\n    another-autoscaler/stop-replicas: \"1\"\nspec:\n  replicas: 0\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:latest\n        ports:\n        - containerPort: 80\n```\n\n## GitOps / FluxCD\nTo avoid conflicts with Flux and Another Autoscaler, you can remove the field `spec.replicas` from your deployment manifest and leave Another Autoscaler to manage the number of replicas.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdignajar%2Fanother-autoscaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdignajar%2Fanother-autoscaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdignajar%2Fanother-autoscaler/lists"}