pod-scheduler

command module
v0.0.0-...-a2ec6d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

Pod Scheduler

automates the number of replicas of pods with cron expression

Schedule CR example

apiVersion: pod.loop.dev/v1alpha1
kind: Schedule
metadata:
  name: deployment-sample
spec:
  matchLabels:
    schedule: scalein-at-1-scaleout-at-5
  matchType: Deployment
  schedules:
    - cron: 0,10,20,30,40,50 * * * *
      name: scale-in
      replicas: 1
    - cron: 5,15,25,35,45,55 * * * *
      name: scale-out
      replicas: 2

apiVersion: pod.loop.dev/v1alpha1
kind: Schedule
metadata:
  name: hpa-sample
spec:
  matchLabels:
    schedule: lower-at-1-higher-at-5
  matchType: HorizontalPodAutoscaler
  schedules:
    - cron: 0,10,20,30,40,50 * * * *
      name: lower-min
      minReplicas: 1
      maxReplicas: 5
    - cron: 5,15,25,35,45,55 * * * *
      name: higher-min
      minReplicas: 3
      maxReplicas: 5

apiVersion: pod.loop.dev/v1alpha1
kind: ClusterSchedule
metadata:
  name: hpa-cluster-sample
spec:
  matchLabels:
    schedule: lower-at-1-higher-at-5
  matchType: HorizontalPodAutoscaler
  namespaces:
    - default
  schedules:
    - cron: 0,10,20,30,40,50 * * * *
      name: lower-min
      minReplicas: 1
      maxReplicas: 5
    - cron: 5,15,25,35,45,55 * * * *
      name: higher-min
      minReplicas: 3
      maxReplicas: 5

Installation

# installing CRDs
kubectl apply -f https://raw.githubusercontent.com/d3vlo0p/pod-scheduler/main/config/crd/bases/pod.loop.dev_schedules.yaml
kubectl apply -f https://raw.githubusercontent.com/d3vlo0p/pod-scheduler/main/config/crd/bases/pod.loop.dev_clusterschedules.yaml

# installing operator with helm
helm install my-scheduler oci://ghcr.io/d3vlo0p/pod-scheduler-operator

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the pod v1alpha1 API group +kubebuilder:object:generate=true +groupName=pod.loop.dev
Package v1alpha1 contains API Schema definitions for the pod v1alpha1 API group +kubebuilder:object:generate=true +groupName=pod.loop.dev

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL