{"id":13416027,"url":"https://github.com/hasura/gitkube","last_synced_at":"2025-05-14T21:09:53.489Z","repository":{"id":39607870,"uuid":"124346949","full_name":"hasura/gitkube","owner":"hasura","description":"Build and deploy docker images to Kubernetes using git push","archived":false,"fork":false,"pushed_at":"2023-08-31T07:48:24.000Z","size":37242,"stargazers_count":3814,"open_issues_count":44,"forks_count":208,"subscribers_count":97,"default_branch":"master","last_synced_at":"2025-04-06T13:08:02.359Z","etag":null,"topics":["ci-cd","continuous-deployment","developer-tools","docker","git","golang","k8s","kubernetes"],"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/hasura.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-08T06:25:53.000Z","updated_at":"2025-04-04T14:33:37.000Z","dependencies_parsed_at":"2024-01-07T10:38:11.340Z","dependency_job_id":null,"html_url":"https://github.com/hasura/gitkube","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fgitkube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fgitkube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fgitkube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fgitkube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasura","download_url":"https://codeload.github.com/hasura/gitkube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741201,"owners_count":21154255,"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":["ci-cd","continuous-deployment","developer-tools","docker","git","golang","k8s","kubernetes"],"created_at":"2024-07-30T21:00:53.764Z","updated_at":"2025-04-13T16:10:30.088Z","avatar_url":"https://github.com/hasura.png","language":"Go","readme":"\n![Gitkube Logo](artifacts/gitkube-h-w.png)\n\n# Gitkube\n\nGitkube is a tool for building and deploying Docker images on Kubernetes using `git push`. \n\nAfter a simple initial setup, users can simply keep `git push`-ing their repos to build and deploy to Kubernetes automatically.\n\n[![GoDoc](https://godoc.org/github.com/hasura/gitkube?status.svg)](https://godoc.org/github.com/hasura/gitkube) \n\n![Gitkube](https://raw.githubusercontent.com/hasura/gitkube/master/artifacts/gitkube.gif)\n\n## When should I use gitkube?\n1. Ideal for development where you can push your WIP branch to the cluster to test.\n2. Reference implementation for writing git-based automation on your server. Fork this repo and create your own CRD + controller + git remote hook that can do things on the Kubernetes cluster.\n\n## Features:\n- No dependencies except native tooling (git, kubectl)\n- Plug and play installation\n- Simple public key based authentication\n- RBAC ready - Control access to git remotes using RBAC\n- Support for namespace based multi-tenancy - Remotes can only deploy to their own namespace\n- No assumptions about repository structure \n\n## Getting started\n\nGitkube will run on any Kubernetes vendor/distribution AS IS. In case you find any difficulties in the setup, please comment on [#33](https://github.com/hasura/gitkube/issues/33) \n\n#### Install gitkube\n\n##### Using kubectl\n\n```sh\nkubectl create -f https://raw.githubusercontent.com/hasura/gitkube/master/manifests/gitkube-setup.yaml\n\n#expose gitkubed service\nkubectl --namespace kube-system expose deployment gitkubed --type=LoadBalancer --name=gitkubed\n```\n\n##### Using gitkube CLI (DEPRECATED)\n\n1. Install Gitkube CLI:\n   - Linux/MacOS\n   ``` bash\n   curl https://raw.githubusercontent.com/hasura/gitkube/master/gimme.sh | bash\n   ```\n   - Windows (using [scoop](https://scoop.sh))\n   ```bat\n   scoop install gitkube\n   ```\n   Or download the latest [release](https://github.com/hasura/gitkube/releases) and add it to your `PATH`.\n\n2. Use Gitkube CLI to install Gitkube on the cluster:\n   ```bash\n   gitkube install\n   ```\n\n## Workflow\n- Local dev: User creates a base git repo for the application with Dockerfile and K8s deployment\n- Setting Remote: User defines a spec for Remote containing the rules for `git push` \n- Deploying application: Once a Remote is setup, application can be deployed to K8s using `git push \u003cremote\u003e master`\n\n### Local dev\nUser should have a git repo with source code and a Dockerfile. User should also create a base K8s deployment for the application.\n\n### Setting Remote\nA Remote resource consists of 3 parts:\n\n1. authorizedKeys: List of ssh-keys for authorizing `git push`.\n2. registry: Details of docker registry where images are pushed post-build.\n3. deployments: Spec for building docker image and updating corresponding K8s deployment.\n\nHere is a typical spec for a Remote:\n```yaml\napiVersion: gitkube.sh/v1alpha1\nkind: Remote\nmetadata:\n  name: sampleremote\n  namespace: default\nspec:\n\n# Insert ssh-keys for allowing users to git push\n  authorizedKeys:\n  - \"ssh-rsa your-ssh-public-key\"\n\n# Provide registry details: https://github.com/hasura/gitkube/blob/master/docs/registry.md\n  registry:\n    url: \"docker.io/user\"\n    credentials:\n      secretRef: regsecret                # Name of docker-registry secret\n\n# Define deployment rules\n  deployments:\n  - name: www                             # Name of K8s deployment which is updated on git push\n    containers: \n    - name: www                           # Name of container in the deployment which is built during git push\n      path: example/www                   # Docker build context path in the git repo\n      dockerfile: example/www/Dockerfile  # Location of Dockerfile for the source code\n```\n\n### Deploying application\n\nOnce a Remote is created, it gets a git remote URL which you can find in its `status` spec\n\n```sh\n$ kubectl get remote sampleremote -o yaml\n...\nstatus:\n  remoteUrl: ssh://default-sampleremote@35.225.226.96/~/git/default-sampleremote\n  remoteUrlDesc: \"\"\n```\n\nAdd the generated `remoteUrl` in git\n\n```sh\n$ git remote add sampleremote ssh://default-sampleremote@35.225.226.96/~/git/default-sampleremote\n```\n\nAnd finally, `git push`\n\n```sh\n$ git push sampleremote master\n```\n\n### More examples\nFollow this [example](https://github.com/hasura/gitkube-example) repo for more workflows with gitkube.\n\n## How it works\n\nGitkube has three components:\n\n1. Remote: Custom resource defined by a K8s CRD\n2. gitkube-controller: Controller that manages Remote objects and propogates changes to gitkubed \n3. gitkubed: Git host that builds docker image from the repo and rolls out deployment\n\n### High-level architecture\n\n![Architecture](https://raw.githubusercontent.com/hasura/gitkube/master/artifacts/gitkube-v0.1.png)\n\n\n## Contributing\n\nGitkube is an open source project licensed under Apache License 2.0\n\nContributions are welcome.\n\n## Community and Support\n\n- Join the [Gitkube channel](https://kubernetes.slack.com/messages/CA68R8ZBN/) in the Kubernetes Slack group\n\n- \u003ca href=\"https://twitter.com/intent/follow?screen_name=gitkube\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/gitkube.svg?style=social\u0026logo=twitter\" alt=\"follow on Twitter\"\u003e\u003c/a\u003e\n\n## Maintainers\n\nThis project has come out of the work at [hasura.io](https://hasura.io). \nCurrent maintainers [@Tirumarai](https://twitter.com/Tirumarai), [@shahidh_k](https://twitter.com/shahidh_k). \n\nFollow [@gitkube](https://twitter.com/gitkube) to stay updated.\n\nGitkube logo concept and design by [Samudra Gupta](https://www.linkedin.com/in/samudra-gupta-b6a3a238/). \n","funding_links":[],"categories":["Container Operations","Go","Go (531)","Operators vs Controllers","HarmonyOS","kubernetes","golang","Configuration Management","Continuous Delivery \u0026 GitOps"],"sub_categories":["Deployment and Infrastructure","GitOps","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasura%2Fgitkube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasura%2Fgitkube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasura%2Fgitkube/lists"}