{"id":15344859,"url":"https://github.com/teslacn/elasticjob-kubernetes","last_synced_at":"2026-05-04T03:35:27.317Z","repository":{"id":108706742,"uuid":"594582092","full_name":"TeslaCN/elasticjob-kubernetes","owner":"TeslaCN","description":"A new ElasticJob Cloud on Kubernetes","archived":false,"fork":false,"pushed_at":"2023-03-16T08:22:06.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T18:44:14.761Z","etag":null,"topics":["distributed-schedule-system","distributed-scheduling","elasticjob","kubernetes","kubernetes-operator","schedule","scheduler","scheduling"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TeslaCN.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-01-29T01:30:17.000Z","updated_at":"2023-02-20T14:55:13.000Z","dependencies_parsed_at":"2023-04-09T05:19:14.189Z","dependency_job_id":null,"html_url":"https://github.com/TeslaCN/elasticjob-kubernetes","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"a7ba34fb323f04817f469aca1dc3a58321413ad2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeslaCN%2Felasticjob-kubernetes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeslaCN%2Felasticjob-kubernetes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeslaCN%2Felasticjob-kubernetes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeslaCN%2Felasticjob-kubernetes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TeslaCN","download_url":"https://codeload.github.com/TeslaCN/elasticjob-kubernetes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245864587,"owners_count":20685061,"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":["distributed-schedule-system","distributed-scheduling","elasticjob","kubernetes","kubernetes-operator","schedule","scheduler","scheduling"],"created_at":"2024-10-01T11:05:27.297Z","updated_at":"2026-05-04T03:35:22.279Z","avatar_url":"https://github.com/TeslaCN.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= ElasticJob on Kubernetes\n\n== Getting Started\n\n=== Implements Your ElasticJob\n\n[source,java]\n....\nimport org.apache.shardingsphere.elasticjob.api.ShardingContext;\nimport org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;\npublic class MyLogSimpleJob implements SimpleJob {\n    @Override\n    public void execute(final ShardingContext shardingContext) {\n        // Do what you want.\n    }\n}\n....\n\n=== Launch Your Job using ElasticJob-Cloud API\n[source,java]\n....\nimport icu.wwj.elasticjob.example.job.MyLogSimpleJob;\nimport org.apache.shardingsphere.elasticjob.cloud.api.JobBootstrap;\n\npublic class Main {\n    public static void main(String[] args) {\n        JobBootstrap.execute(new MyLogSimpleJob());\n    }\n}\n....\n\n=== Build Image and Make Image Ready in Image Registry\n\nSee example.\n\n=== Deploy ElasticJob Operator\n\nTODO\n\n=== Create ElasticJob CR\n\nSee example.\n\n[source,bash]\n....\nkubectl apply -f https://raw.githubusercontent.com/TeslaCN/elasticjob-kubernetes/main/example/k8s/transient/elasticjob.yaml\n....\n\n[source,yaml]\n....\napiVersion: icu.wwj.elasticjob/v1alpha1\nkind: ElasticJob\nmetadata:\n  name: hello-transient-job\n  namespace: elasticjob-cloud\nspec:\n  template:\n    metadata:\n      labels:\n        app: elasticjob\n    spec:\n      restartPolicy: OnFailure\n      containers:\n        - name: job-container\n          imagePullPolicy: IfNotPresent\n          image: teslacn/elasticjob-kubernetes-example:latest\n  jobExecutionType: TRANSIENT\n  shardingTotalCount: 3\n  shardingItemParameters: \n    1: a\n    2: b\n    0: c\n  jobParameter: 'common parameter'\n  # Transient job only support minute level cron. The second expression would be ignored.\n  cron: '0 * * * * ?'\n  misfire: true\n  description: ''\n  props:\n    a: b\n  disabled: false\n....\n\n=== Scale Job via kubectl\n\n[source,bash]\n....\nkubectl scale --replicas=5 -n elasticjob-cloud elasticjob/hello-transient-job\n....\n\n== Basic Concept\n\n*ElasticJob on Kubernetes* vs *ElasticJob Cloud 3.0 (Mesos)*\n\n|===\n| ElasticJob concept | ElasticJob Kubernetes | ElasticJob Mesos\n| API | CRD elasticjobs.icu.wwj.elasticjob | Restful API\n| Scheduler | ElasticJob Operator | base on Mesos Scheduler \u0026 Executor\n| Application | An Image | A Tarball\n|===\n\nKubernetes resource:\n|===\n| Job Execution Type | DAEMON | TRANSIENT\n| ElasticJob with CRON | ✅ StatefulSet | ✅ CronJob\n| ElasticJob without CRON | ❌ StatefulSet | ✅ Job\n|===\n\n* ✅ means supported\n* ❌ means unsupported for now\n\n== Limitations\n\n[.lead]\nTransient cron job (Kubernetes CronJob) only support UNIX cron. The second expression would be ignored.\n\nFor example, set the following cron in ElasticJob CR:\n[source,yaml]\n....\n  jobExecutionType: TRANSIENT\n  cron: '0/15 * * * * ?'\n....\n\nThe actual cron of CronJob would be:\n....\n* * * * ?\n....\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteslacn%2Felasticjob-kubernetes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteslacn%2Felasticjob-kubernetes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteslacn%2Felasticjob-kubernetes/lists"}