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:
- Automatic Scaling: Scale down Deployments and StatefulSets during specific time windows
- Resource Cleanup: Automatically clean up test resources based on annotations and schedules
- Kubernetes 1.16+
- Helm 3.0+
helm repo add cronschedules https://cronschedules.github.io/charts
helm repo update📦 Also available on Artifact Hub
# 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-operatorhelm install cronjob-scale-down-operator cronschedules/cronjob-scale-down-operator \
--set image.tag=0.3.0 \
--set resources.requests.memory=128MiThis chart includes comprehensive testing using chart-testing and GitHub Actions.
Run the included test script to validate the chart locally:
./scripts/test-chart.shThe chart is tested with multiple configuration scenarios:
ci/testing-values.yaml: CI-optimized configuration with reduced resourcesci/default-values.yaml: Standard production-like settingsci/minimal-values.yaml: Minimal resource allocationci/ha-values.yaml: High availability configuration
This repository uses chart-testing and GitHub Actions for comprehensive chart validation.
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-operatorTo render templates locally:
helm template cronjob-scale-down-operator ./cronjob-scale-down-operatorTo validate the chart:
helm lint ./cronjob-scale-down-operator