{"id":19011601,"url":"https://github.com/graphql-editor/jobscontroller","last_synced_at":"2026-04-25T02:30:18.671Z","repository":{"id":57616034,"uuid":"382329097","full_name":"graphql-editor/jobscontroller","owner":"graphql-editor","description":"A very simple controller to launch one off jobs in kubernetes cluster","archived":false,"fork":false,"pushed_at":"2021-08-26T08:49:17.000Z","size":111,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-01T21:46:31.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphql-editor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-02T11:44:54.000Z","updated_at":"2021-08-26T08:49:19.000Z","dependencies_parsed_at":"2022-08-27T07:30:45.114Z","dependency_job_id":null,"html_url":"https://github.com/graphql-editor/jobscontroller","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-editor%2Fjobscontroller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-editor%2Fjobscontroller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-editor%2Fjobscontroller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-editor%2Fjobscontroller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-editor","download_url":"https://codeload.github.com/graphql-editor/jobscontroller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240042834,"owners_count":19738962,"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":[],"created_at":"2024-11-08T19:14:58.337Z","updated_at":"2026-04-25T02:30:18.616Z","avatar_url":"https://github.com/graphql-editor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nA very simple controller to launch one off jobs in kubernetes cluster.\n\nIt's purpose is to start a simple job on request, collect logs from pods ran by job, and clean up the resources after the job has finished. Main motivation was that I needed a simple way to run abstract tasks in relatively isolated environment and be able to inspect results while not worrying about cleanup after the task. Something which default Job resource does not do.\n\n# Usage\n\n## CRD\n\nAdd crd by simply running\n\n```\n$ kubectl apply -f artifacts/crd.yaml\n```\n\n## Run against cluster\n\nYou can run it against resources in default namespace with:\n\n```\n$ go run ./cmd/jobscontroller/main.go --kubeconfig $HOME/.kube/config --namespace default\n```\n\n\n## Sample job:\n\n```\napiVersion: jobscontroller.graphqleditor.com/v1alpha1\nkind: FunctionJob\nmetadata:\n  name: functionjobtest\nspec:\n  template:\n    spec:\n      template:\n        spec:\n          restartPolicy: Never\n          containers:\n          - name: busybox\n            image: busybox\n            args:\n            - echo\n            - \"1\"\n```\n\nAnd the result is:\n```\n$ kubectl get functionjobs.jobscontroller.graphqleditor.com functionjobtest -o yaml\napiVersion: jobscontroller.graphqleditor.com/v1alpha1\nkind: FunctionJob\nmetadata:\n  annotations:\n    kubectl.kubernetes.io/last-applied-configuration: |\n      {\"apiVersion\":\"jobscontroller.graphqleditor.com/v1alpha1\",\"kind\":\"FunctionJob\",\"metadata\":{\"annotations\":{},\"name\":\"functionjobtest\",\"namespace\":\"default\"},\"spec\":{\"template\":{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"args\":[\"echo\",\"1\"],\"image\":\"busybox\",\"name\":\"busybox\"}],\"restartPolicy\":\"Never\"}}}}}}\n  creationTimestamp: \"2021-07-02T12:45:24Z\"\n  generation: 4\n  name: functionjobtest\n  namespace: default\n  resourceVersion: \"171123634\"\n  selfLink: /apis/jobscontroller.graphqleditor.com/v1alpha1/namespaces/default/functionjobs/functionjobtest\n  uid: 788d4c76-7219-4008-ac84-5dbace423107\nspec:\n  template:\n    metadata: {}\n    spec:\n      template:\n        metadata: {}\n        spec:\n          containers:\n          - args:\n            - echo\n            - \"1\"\n            image: busybox\n            name: busybox\n            resources: {}\n          restartPolicy: Never\nstatus:\n  condition: Succeeded\n  logs: |\n    1\n  startTime: \"2021-07-02T12:45:24Z\"\n```\nOr\n```\n$ kubectl get functionjobs.jobscontroller.graphqleditor.com functionjobtest -o jsonpath=\"{.status.logs}\"\n1\n```\n\n# Limitations\n* Saves only up to 256kB of logs to keep the etcd object size resonable\n* For jobs which run multiple pods only logs from from the first successful pod are stored. If all pods failed, logs from the first failed pod are stored.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-editor%2Fjobscontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-editor%2Fjobscontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-editor%2Fjobscontroller/lists"}