This repository contains Helm charts for various CronJob and scheduling-related Kubernetes operators and applications.
This chart installs the CronJob Scale Down Operator on a Kubernetes cluster using the Helm package manager.
The operator provides two main features:
helm repo add cronschedules https://cronschedules.github.io/charts
helm repo update
# Install the chart
helm install cronjob-scale-down-operator cronschedules/cronjob-scale-down-operator
# Clone the repository
git clone https://github.com/cronschedules/charts.git
cd charts
# Install the chart
helm install cronjob-scale-down-operator ./cronjob-scale-down-operator
helm install cronjob-scale-down-operator cronschedules/cronjob-scale-down-operator \
--set image.tag=0.3.0 \
--set resources.requests.memory=128Mi
The following table lists the configurable parameters and their default values:
Parameter | Description | Default |
---|---|---|
replicaCount |
Number of operator replicas | 1 |
image.repository |
Container image repository | cronschedules/z4ck404/cronjob-scale-down-operator |
image.tag |
Container image tag | 0.3.0 |
image.pullPolicy |
Image pull policy | IfNotPresent |
serviceAccount.create |
Create service account | true |
rbac.create |
Create RBAC resources | true |
resources.limits.cpu |
CPU limit | 500m |
resources.limits.memory |
Memory limit | 128Mi |
resources.requests.cpu |
CPU request | 10m |
resources.requests.memory |
Memory request | 64Mi |
metrics.enabled |
Enable metrics service | true |
leaderElection.enabled |
Enable leader election | true |
After installation, you can create CronJobScaleDown resources for different use cases:
Scale down resources during specific time windows:
apiVersion: cronschedules.elbazi.co/v1
kind: CronJobScaleDown
metadata:
name: my-scaler
namespace: default
spec:
targetRef:
name: my-deployment
namespace: default
kind: Deployment
apiVersion: apps/v1
scaleDownSchedule: "0 0 22 * * *" # 10 PM daily
scaleUpSchedule: "0 0 6 * * *" # 6 AM daily
timeZone: "UTC"
Clean up test resources based on annotations:
apiVersion: cronschedules.elbazi.co/v1
kind: CronJobScaleDown
metadata:
name: cleanup-only
namespace: default
spec:
cleanupSchedule: "0 0 */6 * * *" # Every 6 hours
cleanupConfig:
annotationKey: "test.elbazi.co/cleanup-after"
resourceTypes:
- "Deployment"
- "Service"
- "ConfigMap"
labelSelector:
app.kubernetes.io/created-by: "test"
dryRun: true # Set to false to actually delete resources
timeZone: "UTC"
Use both features in one resource:
apiVersion: cronschedules.elbazi.co/v1
kind: CronJobScaleDown
metadata:
name: combined-example
namespace: default
spec:
targetRef:
name: my-deployment
namespace: default
kind: Deployment
scaleDownSchedule: "0 0 22 * * *" # 10 PM daily
scaleUpSchedule: "0 0 6 * * *" # 6 AM daily
cleanupSchedule: "0 0 2 * * *" # 2 AM daily
cleanupConfig:
annotationKey: "test.elbazi.co/cleanup-after"
resourceTypes: ["ConfigMap", "Secret"]
dryRun: false
timeZone: "UTC"
helm uninstall cronjob-scale-down-operator
To render templates locally:
helm template cronjob-scale-down-operator ./cronjob-scale-down-operator
To validate the chart:
helm lint ./cronjob-scale-down-operator