https://github.com/hackgt/beekeeper
:bee: HackGT's application deployment service
https://github.com/hackgt/beekeeper
Last synced: about 1 year ago
JSON representation
:bee: HackGT's application deployment service
- Host: GitHub
- URL: https://github.com/hackgt/beekeeper
- Owner: HackGT
- Created: 2019-03-21T06:07:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T20:10:29.000Z (about 3 years ago)
- Last Synced: 2025-02-03T04:29:44.727Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 101 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Beekeeper
HackGT's application deployment service.
## Introduction and Motivation
HackGT stores all deployment configuration in [Beehive](https://github.com/HackGT/beehive), a special repository inside our GitHub organization. Each deployment file in Beehive corrseponds to a single deployment of an application running in our Kubernetes cluster. Beekeeper serves as an intermediary between Beehive and Kubernetes. The service is responsible for reading in new application configurations from Beehive and generating appropriate Kubernetes objects that can be fed to the cluster orchestrator.
## Jobs
### UpdateDeploymentJob
This job is responsible for creating or updating a single deployment. This involves templating out Kubernetes configurations, wiring DNS via Cloudflare's API, and reporting status via the GitHub deployment API.
### DeleteDeploymentJob
This job is responsible for cleaning up a deployment that is removed. The job removes the corresponding Kubernetes `Deployment` and `Service` objects and removes the DNS entry for the deployment.
## Endpoints
### `/api/github_webhooks`
This endpoint recieves webhooks when GitHub pushes are made to `HackGT/beehive`. The push is diffed with the previous repository head, and jobs are spanwed for added/modified (UpdateDeploymentJob) and deleted (DeleteDeploymentJob) application configurations.
### `/api/version_updates`
This endpoints recieves hooks from Google Cloud Build when a commit is finished building for any HackGT application. The commit a list of running deployments, and, if any are from the same repository, an UpdateDeploymentJob is initiated for the deployments matching. For example, if a new commit was pushed to `master` of `HackGT/registration`, any currently deployed instances of `HackGT/registration` that track the `master` branch would be updated to the new commit.
## Development
To develop locally, your computer must be acessible to the internet so you can recieve GitHub webhooks. Setup webhooks [here](https://github.com/HackGT/beehive/settings/hooks) to `https:///api/github_webhooks/`. I recommend [ngrok](https://ngrok.com). You'll need to set all the environment secrets referenced in `kubernetes/deployment.yaml`.
Keep in mind that the production instance may be running already. To stop the production instance run `kubectl --namespace=beekeeper delete deployment beekeeper-default`
### Deployment
To deploy, push to master and wait for the GitHub actions job to complete