Skip to content

pop/buildbot-on-kubernetes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buildbot on Kubernetes

Not sure what this is? There's a blogpost that might give some context. In sort, this repo contains all the stuff you should need to deploy buildbot on a kuberentes cluster.

Before getting started you may want to get aquainted with the [Buildbot Documentation][buildbot-docs] and specifically their Buildbot on Docker-compose tutorial.

Getting started

  1. Get a kubernetes cluster up and running. For testing purposes, I suggest minikube.
  2. Setup your local volumes.
$ kubectl create -f simple/volumes.yaml
<output>

Warning: For a long-term maintainable cluster you should consider using NFS or some other backend for your storage.

  1. Setup the kubernetes database.
$ kubectl create -f simple/postgres.yaml
<output>
  1. Start the kubernetes master.
$ kubectl create -f simple/master.yaml
<output>
  1. Start the kubernetes worker.
$ kubectl create -f simple/worker.yaml
<output>

Note: This setup uses local volumes which are probably owned by the root user on your cluster. You'll most likely need to change the permissions on the directories being used so the buildbot worker can use it to store data.

$ minikube ssh
$ sudo chown -R 1000:1000 /data/pv-1 /data/pv-2 /data/pv-3

NOTE This step may fail as /data/pv-1, /data/pv-2, or /data/pv-3 haven't been created yet. You may need to repeat this step after testing your buildbot cluster out a bit after step 5 below.

If you decide to use something else like NFS or Glusterfs this step may not be necessary as you may be able to specify the permissions of the block device as in a kubernetes configuration file.

  1. Check out your cluster locally with:
$ kubectl get pods -l app=buildbot -l tier=master -o template --template="{{range.items}}{{.metadata.name}}{{end}}" | xargs -I{} kubectl port-forward {} 8080
  1. Test out your cluster! Go to http://localhost:8080/#/builders/ and force a new build.

  2. (Optional) Fork this repository and customize it to your needs. All of the necessary buildbot configuration file can be found and modified for your project's needs.

For something a bit more complicated take a look at the configurtion in the robust/ directory.

Contributing

If feedback or a fix, that's great! Create an Issue or a Pull Request. If you choose the latter, this is a good workflow to follow:

  1. Fork the repository.
  2. Make whatever changes you want on your branch.
  3. Create a pull request from your_remote:your_branch to ElijahCaine:master.

I'll give feedback and once everything looks good we'll squash the commits and merge them in.

Origin

The Kubernetes setup outlined here is almost a 1:1 mapping with the configuration in docker-compose/simple/. If you're up for a challenge try implementing the setup in docker-compose/multimaster/!

Licensing

This repository is a fork a repo from the buildbot org (upstream) which wasn't licensed. The additions I've made are licensed under MIT, Elijah C. Voigt.

Happy hacking!

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%