Automatically scale RQ Workloads in Kubernetes
This repository has been archived on 2026-09-02. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Python 88.7%
  • Dockerfile 9.6%
  • Shell 1.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
renovate[bot] 95c9765234
chore(deps): update dependency ruff to v0.5.2 (#25)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-14 21:17:04 +01:00
.github/workflows chore(deps): update docker/build-push-action action to v6 (#17) 2024-06-17 13:11:59 +01:00
deploy Run as a Kubernetes Deployment, instead of CronJob 2024-04-15 14:11:53 +01:00
rq_autoscaler Update rq_autoscaler/__init__.py 2024-04-15 14:11:53 +01:00
scripts Run as a Kubernetes Deployment, instead of CronJob 2024-04-15 14:11:53 +01:00
.gitignore Initial Commit 2023-11-28 15:25:02 +00:00
Dockerfile chore(deps): update docker.io/python docker tag to v3.12 (#11) 2024-06-07 12:49:52 +01:00
LICENSE Initial Commit 2023-11-28 15:25:02 +00:00
poetry.lock chore(deps): update dependency ruff to v0.5.2 (#25) 2024-07-14 21:17:04 +01:00
pyproject.toml fix(deps): update dependency kr8s to ^0.17.0 (#22) 2024-07-09 00:27:36 +01:00
README.md Run as a Kubernetes Deployment, instead of CronJob 2024-04-15 14:11:53 +01:00
renovate.json Add renovate.json (#6) 2024-06-07 12:38:58 +01:00

RQ Autoscaler

Automatically scales RQ based Kubernetes Deployments based on the number of items in the queue.

Configuration

The following settings are currently available:

Setting Description
REDIS_URL The URL of the Redis Server, example: redis://:mypassword@redis:6379/0
DEPLOYMENT The namespace and name of the deployment to use, example: my-namespace/my-deployment
QUEUE The name of the RQ queue to use, example: my-queue
MIN_REPLICAS The minimum number of replicas you want to allow, example: 1
MAX_REPLICAS The maximum number of replicas you want to allow, example: 100
TASKS_PER_REPLICA The split of tasks to replicas, uses queue_length / tasks_per_replica, example: 10000
INTERVAL How often to check queue size and perform scaling operations, example 10

Usage

Via Kustomize/Flux for Kubernetes

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - github.com/cpressland/rq-autoscaler/deploy
namespace: your-namespace
patches:
  - target:
      kind: Deployment
    patch: |
      - op: replace
        path: /spec/template/spec/containers/0/env
        value:
          - name: REDIS_URL
            value: redis://my-redis-server:6379/0
          - name: DEPLOYMENT
            value: my-deployment
          - name: QUEUE
            value: my-queue
          - name: MIN_REPLICAS
            value: "1"
          - name: MAX_REPLICAS
            value: "10"
          - name: TASKS_PER_REPLICA
            value: "10000"
          - name: INTERVAL
            value: "10"