Another Scheduler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified time using a cron annotation.

Overview

Another Scheduler

Another Scheduler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified time using a cron syntax.

Another Scheduler read the annotation of each deployment and performs an increase or decrease in the number of replicas.

Docker image Kubernetes YAML manifests codebeat badge release license

The date and time must be in UTC.

The restart feature execute a rollout restart deployment.

Use cases

  • Deployments with GPU, stop them after working hours.
  • Stop deployments that are not needed on the weekend.
  • Save some money in your Kubernetes cluster after working hours or weekends.
  • Another Scheduler is a perfect combination with Cluster Autoscaler.

Install

# Deploy Another Scheduler into Kubernetes on default namespace
kubectl apply -f https://raw.githubusercontent.com/dignajar/another-scheduler/master/kubernetes/full.yaml

Annotations

Stop pods at 6pm every day:

another-scheduler.io/stop-time: "00 18 * * *"

Start pods at 1pm every day:

another-scheduler.io/start-time: "00 13 * * *"

Start 3 pods at 2:30pm every day:

another-scheduler.io/start-time: "30 14 * * *"
another-scheduler.io/start-replicas: "3"

Restart pods at 9:15am every day:

another-scheduler.io/restart-time: "15 09 * * *"

Restart pods at 2:30am, only on Saturday and Sunday:

another-scheduler.io/restart-time: "00 02 * * 0,6"

Example: How to start pods at 2pm and stop them at 3pm every day

The following example start 5 replicas in total at 2pm and stop 4 of them at 3pm every day, the deployment start with 0 replicas.

The start-replicas is not incremental, the value is the number of replicas will be setup by Another Scheduler at the defined time by start-time.

The date and time must be in UTC.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
  annotations:
    another-scheduler.io/start-time: "00 14 * * *"
    another-scheduler.io/start-replicas: "5"
    another-scheduler.io/stop-time: "00 15 * * *"
    another-scheduler.io/stop-replicas: "1"
spec:
  replicas: 0
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
Releases(0.6)
  • 0.6(Oct 5, 2021)

  • 0.5(Oct 5, 2021)

    • Update Python 3.9.7
    • Rename annotations from another-autoscaler.io to another-autoscaler
    • Add ApiException to catch exceptions from K8s API
    • K8s manifests add namespace another and deploy Another Autoscaler in this new namespace
    Source code(tar.gz)
    Source code(zip)
  • 0.4(Aug 12, 2021)

    This release is for migration from Docker Hub registry to Github registry.

    • Add to the Github actions > Scan vulnerabilities with Trivy
    • Add to the Github actions > Build Docker image
    • Add Deepsource for code review
    • K8s manifest, Image runs as non-root uid 10001 and gid 10001.
    • K8s manifest, create namespace another
    Source code(tar.gz)
    Source code(zip)
  • 0.3(Jul 12, 2021)

    • Project rename to Another Autoscaler.
    • Environment variable (CHECK_EVERY) to configure the number of seconds of each run; By default is 5 seconds.
    • Update ClusterRoleBinding API version to rbac.authorization.k8s.io/v1 on K8s manifest.
    • Refactor of the class AAutoscaler to improve readability.
    Source code(tar.gz)
    Source code(zip)
Owner
Diego Najar
Diego Najar
The easiest way to automate your data

Hello, world! ?? We've rebuilt data engineering for the data science era. Prefect is a new workflow management system, designed for modern infrastruct

Prefect 7.6k Oct 23, 2021
Crontab jobs management in Python

Plan Plan is a Python package for writing and deploying cron jobs. Plan will convert Python code to cron syntax. You can easily manage you

Shipeng Feng 1.1k Aug 22, 2021
Python job scheduling for humans.

schedule Python job scheduling for humans. Run Python functions (or any other callable) periodically using a friendly syntax. A simple to use API for

Dan Bader 9.1k Oct 23, 2021
CoSA: Scheduling by Constrained Optimization for Spatial Accelerators

CoSA is a scheduler for spatial DNN accelerators that generate high-performance schedules in one shot using mixed integer programming

UC Berkeley Architecture Research 20 Sep 22, 2021
Remote task execution tool

Gunnery Gunnery is a multipurpose task execution tool for distributed systems with web-based interface. If your application is divided into multiple s

Gunnery 730 Oct 16, 2021
A calendaring app for Django. It is now stable, Please feel free to use it now. Active development has been taken over by bartekgorny.

Django-schedule A calendaring/scheduling application, featuring: one-time and recurring events calendar exceptions (occurrences changed or cancelled)

Tony Hauber 796 Oct 21, 2021
A powerful workflow engine implemented in pure Python

Spiff Workflow Summary Spiff Workflow is a workflow engine implemented in pure Python. It is based on the excellent work of the Workflow Patterns init

Samuel 1k Oct 20, 2021
Python-Repeated-Timer is an open-source & highly performing timer using only standard-libraries.

Python Repeated Timer Python-Repeated-Timer is an open-source & highly performing timer using only standard-libraries.

TACKHYUN JUNG 3 Sep 8, 2021