{"id":50292338,"url":"https://github.com/kube-land/kubegit1","last_synced_at":"2026-05-28T06:16:09.018Z","repository":{"id":57565771,"uuid":"187741710","full_name":"kube-land/kubegit1","owner":"kube-land","description":"Easier CI/CD on Kubernetes using GitHooks","archived":false,"fork":false,"pushed_at":"2023-03-07T03:31:44.000Z","size":38554,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-11T08:42:40.508Z","etag":null,"topics":["argo","continuous-delivery","continuous-integration","github","kube-git","kubernetes","slack"],"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/kube-land.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-21T01:48:34.000Z","updated_at":"2021-10-28T08:50:14.000Z","dependencies_parsed_at":"2022-09-03T12:21:20.689Z","dependency_job_id":null,"html_url":"https://github.com/kube-land/kubegit1","commit_stats":null,"previous_names":["appspero/kube-git"],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/kube-land/kubegit1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kube-land%2Fkubegit1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kube-land%2Fkubegit1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kube-land%2Fkubegit1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kube-land%2Fkubegit1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kube-land","download_url":"https://codeload.github.com/kube-land/kubegit1/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kube-land%2Fkubegit1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33596539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["argo","continuous-delivery","continuous-integration","github","kube-git","kubernetes","slack"],"created_at":"2026-05-28T06:16:07.165Z","updated_at":"2026-05-28T06:16:08.982Z","avatar_url":"https://github.com/kube-land.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kube-git\n\nThe kube-git controller allows defining `GitHook` object on Kubernetes to trigger resources that run to completion. The main goal is to make CI/CD more easier on kubernetes. Currently supported resources is:\n\n* Argo Workflows\n* Kubernetes Jobs\n\nSupported SCM that will trigger the resource based on push events:\n* GitHub\n\nSupported notifications:\n* GitHub build status (by personal access tokens)\n* Slack\n\n## Installation\n\nTo configure the controller change `install/deployment.yaml` and `install/service.yaml` to fit your environment.\n\nTo use `kube-git` you have to expose the controller publicly to act as a webhook for GitHub. A secret should be configured with controller deployment and used from by GitHub to secure the webhook. Configure either `github-webhook-secret` argument or `GITHUB_WEBHOOK_SECRET` environment variable.\n\nTo configure the notification, the argument `-notification-config-file` of the controller should be configred with YAML file (eg., `etc/kube-git/notification.yaml`):\n\n```yaml\n# notification.yaml\ngithub:\n  github-example:\n    # notification URL\n    url: \"https://argo.example.com/workflows/${NAMESPACE}/${NAME}\"\n    # personal access token\n    token: ...\n  github-example-1:\n    ...\nslack:\n  slack-ci:\n    url: \"https://k8s.example.com/#!/job/${NAMESPACE}/${NAME}?namespace=${NAMESPACE}\"\n    webhookURL: ...\n    channel: \"#ci\"\n  slack-ci-1:\n    ...\n```\n\nUsing variables `${NAMESPACE}` and `${NAME}` in url will be replaced by `kube-git` with the resource (Job/Workflow) namespace and name.\n\nFinally install the controller (after configuration):\n\n```bash\nkubectl apply -k install\n```\n\n## Usage\n\nThere is a simple example in `examples` for `kube-git` CI.\n\nTo configure GitHub webhook use `DOMAIN/github` URL (for example: `https://kubegit.example.com/github`) and `application/json` content type.\n\nThen you deploy a `GitHook`. For example:\n\n```yaml\napiVersion: kubegit.appspero.com/v1alpha1\nkind: GitHook\nmetadata:\n  name: githook-example\n  namespace: ci\nspec:\n  # for SSH\n  repository: git@github.com:appspero/kube-git.git\n  # for http\n  #repository: https://github.com/appspero/kube-git.git\n  branches:\n    - \"*\"\n  # manifest that will be applied\n  manifest: argo.yaml\n  # append timestamp to resource name\n  #timestampSuffix: true\n  argoWorkflow:\n    revisionParameterName: revision\n    branchParameterName: branch\n  #usernameSecret:\n  #  name: secret-example\n  #  key: username\n  #passwordSecret:\n  #  name: secret-example\n  #  key: password\n  sshPrivateKeySecret:\n    name: secret-example\n    key: key\n  notification:\n    github: github-example\n    slack: slack-example\n```\n\nThe manifest file should have either one `Workflow` or one `Job`. If the defined manifest is of type Argo `Workflow`, you can use `argoWorkflow.revisionParameterName` and `argoWorkflow.branchParameterName` to substitute `arguments.parameters` in the Workflow . That could be used to apply conditions on branches, or to checkout the repository revision of the commit that triggered the Workflow.\n\nWhen you specify branches in `GitHook` you can use wildcard names or specfic names which should be full ref name of git branch (`refs/heads/BRANCH_NAME`). Further the `argoWorkflow.branchParameterName` will be replaced by the full ref name of the git branch.\n\n*Note:* It is recommended to use `generateName` instead of `name` for the defined resource (Job/Workflow) in the manifest file. If `generateName` is not used, you can set `timestampSuffix: true` to append timestamp to resource name.\n\n## Build\n\n```bash\nGOPATH=~/goappspero bash -xe hack/update-codegen.sh\ndocker build -t appspero/kube-git:latest .\ndocker push appspero/kube-git:latest\n```\n\n## Memory Utilization\n\nOriginally we have used `memfs` form `gopkg.in/src-d/go-billy.v4/memfs` to clone the repository that have a push event to get the manifest file. If the repository size is not small (like `kube-git` which is bigger than 100MB), the controller will have a high memory utilization. To reduce the memory usage the clone behaviour has changed to plain clone (`gopkg.in/src-d/go-git.v4`) to tmp directory and then we fetch the manifest file.\n\nTo analyse the heap memory of the controller we used `pprof` by adding it to `cmd/kubegit/main.go`:\n\n```go\nimport _ \"net/http/pprof\"\nimport (\n  \"log\"\n  ...\n)\n...\ngo func() {\n  log.Println(http.ListenAndServe(\"localhost:6060\", nil))\n}()\n```\n\nThen enable the port-forwarding:\n\n```bash\nkubectl port-forward kube-git-... 6060:6060\n```\n\nThen we profile the memory as follow:\n\n```bash\ngo tool pprof -alloc_space http://localhost:6060/debug/pprof/heap\n```\n\nThe previous command will output the `pb.gz` profileing data which could be viewed as follow:\n\n```bash\ngo tool pprof -http=:8090 /path/to/\u003cFILE_NAME\u003e.pb.gz\n```\n\n## TODO\n* Support leader election for high-availability mode\n* Adding support for more notification\n* Adding support for Bitbucket\n* Controller shutdown\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkube-land%2Fkubegit1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkube-land%2Fkubegit1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkube-land%2Fkubegit1/lists"}