{"id":13644729,"url":"https://github.com/hiddeco/cronjobber","last_synced_at":"2025-04-21T10:34:14.066Z","repository":{"id":34578202,"uuid":"173391399","full_name":"hiddeco/cronjobber","owner":"hiddeco","description":"Cronjobber is a cronjob controller for Kubernetes with support for time zones","archived":true,"fork":false,"pushed_at":"2024-08-21T23:39:11.000Z","size":224,"stargazers_count":243,"open_issues_count":20,"forks_count":38,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-25T01:43:44.342Z","etag":null,"topics":["k8s","kubernetes","kubernetes-controller","kubernetes-operator","timezone"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hiddeco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-02T01:53:52.000Z","updated_at":"2024-11-02T11:46:58.000Z","dependencies_parsed_at":"2024-11-09T17:32:55.371Z","dependency_job_id":"28d8535d-18dd-43c6-b4d9-881e86d11f04","html_url":"https://github.com/hiddeco/cronjobber","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddeco%2Fcronjobber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddeco%2Fcronjobber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddeco%2Fcronjobber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiddeco%2Fcronjobber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiddeco","download_url":"https://codeload.github.com/hiddeco/cronjobber/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040716,"owners_count":21365153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["k8s","kubernetes","kubernetes-controller","kubernetes-operator","timezone"],"created_at":"2024-08-02T01:02:11.608Z","updated_at":"2025-04-21T10:34:09.053Z","avatar_url":"https://github.com/hiddeco.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Cronjobber\n\n[![CircleCI](https://circleci.com/gh/hiddeco/cronjobber/tree/master.svg?style=shield)](https://circleci.com/gh/hiddeco/cronjobber/tree/master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hiddeco/cronjobber)](https://goreportcard.com/report/github.com/hiddeco/cronjobber)\n[![Docker Repository on Quay](https://quay.io/repository/hiddeco/cronjobber/status \"Docker Repository on Quay\")](https://quay.io/repository/hiddeco/cronjobber)\n[![License](https://img.shields.io/github/license/hiddeco/cronjobber.svg)](https://github.com/hiddeco/cronjobber/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/hiddeco/cronjobber.svg)](https://github.com/hiddeco/cronjobber/releases)\n\nCronjobber is the cronjob controller from Kubernetes patched with time zone support.\n\n## Installation\n\n```sh\n# Install CustomResourceDefinition\n$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/crd.yaml\n# Setup service account and RBAC\n$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/rbac.yaml\n# Deploy Cronjobber (using the timezone db from the node)\n$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/deploy.yaml\n```\n\n### Keeping your timezone database up-to-date\n\n\u003e :warning: **Note:** the approach below does not work at present due to an\n\u003e issue with Go which causes it to silently fail on `slim` timezone database\n\u003e formats (the default since `tzdata\u003e=2020-b`) ([go#42138](https://github.com/golang/go/issues/42138)).\n\u003e\n\u003e It is therefore advised to use the `deploy.yaml` with the embedded timezone\n\u003e database until this issue has been resolved.\n\nCronjobber embeds a default timezone database in its binary, this database is\nhowever not updated regularly. To help your overcome this issue there is an\n[`cronjobber-updatetz`](https://quay.io/repository/hiddeco/cronjobber-updatetz)\nimage available that can be used as a sidecar.\n\n```sh\n# Deploy Cronjobber (using the updatetz sidecar)\n$ kubectl apply -f https://raw.githubusercontent.com/hiddeco/cronjobber/master/deploy/deploy-updatetz.yaml\n```\n\nYou may want to tweak the following environment variables to control\nhow often it looks for updates and where it puts the timezone database.\n\n- `TZPV` (default: `/tmp/zoneinfo`) is where the timezone database\n  is extracted\n- `REFRESH_INTERVAL` (default: `7d`) is how often it looks for updates\n\n## Usage\n\nInstead of creating a [`CronJob`](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/)\nlike you normally would, you create a `TZCronJob`, which works exactly\nthe same but supports an additional field: `.spec.timezone`. Set this\nto the time zone you wish to schedule your jobs in and Cronjobber will\ntake care of the rest.\n\n```yaml\napiVersion: cronjobber.hidde.co/v1alpha1\nkind: TZCronJob\nmetadata:\n  name: hello\nspec:\n  schedule: \"*/1 * * * *\"\n  timezone: \"Europe/Amsterdam\"\n  jobTemplate:\n    spec:\n      template:\n        spec:\n          containers:\n            - name: hello\n              image: busybox\n              args:\n                - /bin/sh\n                - -c\n                - date; echo \"Hello, World!\"\n          restartPolicy: OnFailure\n```\n\n## Reasoning\n\nThere has been a [long outstanding (and now closed) issue](https://github.com/kubernetes/kubernetes/issues/47202)\nto add time zone support to the `CronJob` kind in Kubernetes, including\na [fully working PR](https://github.com/kubernetes/kubernetes/pull/47266)\nwhich actually made it possible. SIG Apps and in SIG Architecture\ndecided however against adding it because of the downside of having\nto manage and distribute time zone databases.\n\n\u003e People are now encouraged to innovate and solve these kinds of problems in the ecosystem rather than core.\n\u003e\n\u003e Instead of putting this in Kubernetes the ask is to:\n\u003e 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\n\u003e 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\n\u003e\n\u003e -- \u003ccite\u003e[mattfarina (Matt Farina) on Jan 26, 2018](https://github.com/kubernetes/kubernetes/issues/47202#issuecomment-360820586)\u003c/cite\u003e\n\nCronjobber is the most simple answer to this: it is the original PR\non top of a more recent version of the cronjob controller, with some\nglue added to make it an independent controller.\n\n## Credits\n\nThis application is derived from open source components. You can find\nthe original source code of these components below.\n\n* [Kubernetes CronJob controller](https://github.com/kubernetes/kubernetes/tree/v1.13.3/pkg/controller/cronjob)\n* [kubernetes/kubernetes#47266](https://github.com/kubernetes/kubernetes/pull/47266) by Adam Sunderland\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiddeco%2Fcronjobber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiddeco%2Fcronjobber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiddeco%2Fcronjobber/lists"}