All Projects → hiddeco → Cronjobber

hiddeco / Cronjobber

Licence: apache-2.0
Cronjobber is a cronjob controller for Kubernetes with support for time zones

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Cronjobber

Sens8
Kubernetes controller for Sensu checks
Stars: ✭ 42 (-75.15%)
Mutual labels:  k8s, kubernetes-operator, kubernetes-controller
Bonny
The Elixir based Kubernetes Development Framework
Stars: ✭ 190 (+12.43%)
Mutual labels:  k8s, kubernetes-operator, kubernetes-controller
Rbacsync
Automatically sync groups into Kubernetes RBAC
Stars: ✭ 197 (+16.57%)
Mutual labels:  k8s, kubernetes-operator, kubernetes-controller
K8gb
A cloud native Kubernetes Global Balancer
Stars: ✭ 113 (-33.14%)
Mutual labels:  k8s, kubernetes-operator, kubernetes-controller
kotary
Managing Kubernetes Quota with confidence
Stars: ✭ 85 (-49.7%)
Mutual labels:  k8s, kubernetes-operator, kubernetes-controller
aws-iam-operator
AWS IAM Operator for Kubernetes
Stars: ✭ 23 (-86.39%)
Mutual labels:  kubernetes-operator, kubernetes-controller
rabbitmq-operator
RabbitMQ Kubernetes operator
Stars: ✭ 16 (-90.53%)
Mutual labels:  k8s, kubernetes-operator
Operator Kit
A library for creating a Kubernetes Operator
Stars: ✭ 275 (+62.72%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Airflow Operator
Kubernetes custom controller and CRDs to managing Airflow
Stars: ✭ 278 (+64.5%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Mysql Operator
Bulletproof MySQL on Kubernetes using Percona Server
Stars: ✭ 527 (+211.83%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Kudo
Kubernetes Universal Declarative Operator (KUDO)
Stars: ✭ 849 (+402.37%)
Mutual labels:  kubernetes-operator, kubernetes-controller
couchdb-operator
prototype kubernetes operator for couchDB
Stars: ✭ 17 (-89.94%)
Mutual labels:  k8s, kubernetes-operator
siddhi-operator
Operator allows you to run stream processing logic directly on a Kubernetes cluster
Stars: ✭ 16 (-90.53%)
Mutual labels:  k8s, kubernetes-operator
port-map-operator
LoadBalancer Service type implementation for home Kubernetes clusters via Port Control Protocol.
Stars: ✭ 25 (-85.21%)
Mutual labels:  kubernetes-operator, kubernetes-controller
wordpress-operator
Bitpoke Kubernetes operator for WordPress
Stars: ✭ 159 (-5.92%)
Mutual labels:  kubernetes-operator, kubernetes-controller
cdap-operator
CDAP Kubernetes Operator
Stars: ✭ 17 (-89.94%)
Mutual labels:  kubernetes-operator, kubernetes-controller
K8s Mediaserver Operator
Repository for k8s Mediaserver Operator project
Stars: ✭ 81 (-52.07%)
Mutual labels:  k8s, kubernetes-operator
Spark On K8s Operator
Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.
Stars: ✭ 1,780 (+953.25%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Captain
A Helm 3 Controller
Stars: ✭ 129 (-23.67%)
Mutual labels:  kubernetes-operator, kubernetes-controller
grafana-operator
An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
Stars: ✭ 449 (+165.68%)
Mutual labels:  k8s, kubernetes-operator

Cronjobber

CircleCI Go Report Card Docker Repository on Quay License GitHub release

Cronjobber is the cronjob controller from Kubernetes patched with time zone support.

Installation

# Install CustomResourceDefinition
$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/crd.yaml
# Setup service account and RBAC
$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/rbac.yaml
# Deploy Cronjobber (using the timezone db from the node)
$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/deploy.yaml

Keeping your timezone database up-to-date

⚠️ Note: the approach below does not work at present due to an issue with Go which causes it to silently fail on slim timezone database formats (the default since tzdata>=2020-b) (go#42138).

It is therefore advised to use the deploy.yaml with the embedded timezone database until this issue has been resolved.

Cronjobber embeds a default timezone database in its binary, this database is however not updated regularly. To help your overcome this issue there is an cronjobber-updatetz image available that can be used as a sidecar.

# Deploy Cronjobber (using the updatetz sidecar)
$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/deploy-updatetz.yaml

You may want to tweak the following environment variables to control how often it looks for updates and where it puts the timezone database.

  • TZPV (default: /tmp/zoneinfo) is where the timezone database is extracted
  • REFRESH_INTERVAL (default: 7d) is how often it looks for updates

Usage

Instead of creating a CronJob like you normally would, you create a TZCronJob, which works exactly the same but supports an additional field: .spec.timezone. Set this to the time zone you wish to schedule your jobs in and Cronjobber will take care of the rest.

apiVersion: cronjobber.hidde.co/v1alpha1
kind: TZCronJob
metadata:
  name: hello
spec:
  schedule: "*/1 * * * *"
  timezone: "Europe/Amsterdam"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: hello
              image: busybox
              args:
                - /bin/sh
                - -c
                - date; echo "Hello, World!"
          restartPolicy: OnFailure

Reasoning

There has been a long outstanding (and now closed) issue to add time zone support to the CronJob kind in Kubernetes, including a fully working PR which actually made it possible. SIG Apps and in SIG Architecture decided however against adding it because of the downside of having to manage and distribute time zone databases.

People are now encouraged to innovate and solve these kinds of problems in the ecosystem rather than core.

Instead of putting this in Kubernetes the ask is to:

  1. Develop this in the ecosystem (e.g., a controller) that others can use. Distribute it, solve the problems there, and see what update looks like
  2. If the solution is widely adopted and can be used by everyone (including small scale, multi-cluster, etc) then it could be considered for core Kubernetes

-- mattfarina (Matt Farina) on Jan 26, 2018

Cronjobber is the most simple answer to this: it is the original PR on top of a more recent version of the cronjob controller, with some glue added to make it an independent controller.

Credits

This application is derived from open source components. You can find the original source code of these components below.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].