{"id":20151856,"url":"https://github.com/bernardovale/downscaler","last_synced_at":"2025-04-09T20:51:16.543Z","repository":{"id":41295530,"uuid":"149356171","full_name":"bernardoVale/downscaler","owner":"bernardoVale","description":"Scale idle apps to zero and wake them up when they receive traffic","archived":false,"fork":false,"pushed_at":"2018-11-09T22:55:07.000Z","size":2000,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T22:42:53.899Z","etag":null,"topics":["downscale","kubernetes","nginx","nginx-ingress-controller","scale-to-zero"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bernardoVale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-18T21:49:05.000Z","updated_at":"2025-02-11T16:36:11.000Z","dependencies_parsed_at":"2022-09-11T12:30:59.980Z","dependency_job_id":null,"html_url":"https://github.com/bernardoVale/downscaler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardoVale%2Fdownscaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardoVale%2Fdownscaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardoVale%2Fdownscaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardoVale%2Fdownscaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernardoVale","download_url":"https://codeload.github.com/bernardoVale/downscaler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111957,"owners_count":21049576,"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":["downscale","kubernetes","nginx","nginx-ingress-controller","scale-to-zero"],"created_at":"2024-11-13T23:07:15.901Z","updated_at":"2025-04-09T20:51:16.523Z","avatar_url":"https://github.com/bernardoVale.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Downscaler\n\nDownscaler implements an [nginx-ingress-controller](https://github.com/kubernetes/ingress-nginx) default backend capable of scaling applications to zero and wake them up when they receive traffic.\n\nIt has three main dependencies:\n\n- The nginx-ingress controller\n- A redis database\n- Prometheus collecting metrics of `nginx-ingress-controller`\n\nThe easiest way of using it is by deploying it using our `helm` chart.\n\n# Setup with Helm\n\nThe helm chart will install redis and prometheus for you and configure a job to scrap nginx-ingress metrics.\n\nYou need to make a couple of changes on `nginx-ingress` though.\n\n- You need to make sure `nginx-ingress` is configured to collect metrics\n- You need to configure `nginx-ingress` to send `503` errors to the default backend\n\nHopefully, if you've deployed `nginx-ingress` using a helm chart, you basically need to change below values:\n\n```bash\nTEMP_FILE=$(mktemp)\ncat \u003c\u003cEOF \u003e $TEMP_FILE\ndefaultBackend:\n  enabled: false\ncontroller:\n  podAnnotations:\n    prometheus.io/port: \"10254\"\n    prometheus.io/scrape: \"true\"\n  defaultBackendService: default/downscaler-apps-backend\n  image:\n    repository: bernardovale/nginx-ingress-controller\n    tag: 0.18.0\n  stats:\n    enabled: true\n  metrics:\n    enabled: true\n  config:\n    custom-http-errors: \"503\"\nEOF\nhelm upgrade --install downscaler-ingress -f $TEMP_FILE stable/nginx-ingress\n```\n\nDeploy downscaler configuring the interval (`downscaler.sleeper.interval`) where sleeper will run and put idle apps to sleep and the amount of time we should use to consider an app idle (`downscaler.sleeper.max.idle`).\n\n```\nhelm upgrade --install downscaler-apps \\\ndeployments/helm/downscaler \\\n--set downscaler.sleeper.interval=45s \\\n--set downscaler.sleeper.max.idle=30s\n```\n\n\n# Activating Ingresses\n\n`downscaler` will only put apps to sleep that were labeled `downscaler.active=true`. You need to manually set the\nlabel to all ingresses that you wish to scale to zero.\n\nYou can use the above command to set the label to all ingresses of current namespace:\n\n```\nkubectl label ingress downscaler.active=true --all\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernardovale%2Fdownscaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernardovale%2Fdownscaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernardovale%2Fdownscaler/lists"}