Skip to content
Deploy pull requests on a Kubernetes cluster before merged.
Go Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
cmd test: Refactor tests May 12, 2019
deployment docs: Update readme and deployment May 17, 2019
docs docs: Update docs May 26, 2019
hack
internal feat(webhook): Record events in webhook May 16, 2019
pkg test: Refactor github webhook tests May 14, 2019
.gitignore test: Integration tests May 2, 2019
.golangci.yml refactor: Split controller and webhook cmd May 5, 2019
.goreleaser.yml
CONTRIBUTING.md
Dockerfile fix(release): Fix invalid Docker images May 15, 2019
LICENSE
README.md docs: Update docs May 26, 2019
go.mod chore: Update codegen script May 16, 2019
go.sum

README.md

pullup

GitHub release CircleCI codecov

Pullup is a Kubernetes add-on that helps you deploy pull requests on a Kubernetes cluster based on existing resources and cleanup resources automatically when pull requests are closed or merged.

Prerequisites

Pullup requires Kubernetes 1.7 and later which supports Custom Resource Definitions (CRD).

Installation

First, create a new namespace.

kubectl create namespace pullup

Install CRDs.

kubectl apply -f https://github.com/tommy351/pullup/blob/master/deployment/crds/webhook.yml
kubectl apply -f https://github.com/tommy351/pullup/blob/master/deployment/crds/resource-set.yml

Create a new service account and RBAC if it is enabled on your Kubernetes cluster. This enables Pullup to access Pullup resources.

kubectl apply -f https://github.com/tommy351/pullup/blob/master/deployment/rbac.yml

Create deployments. This will create two deployments. One is the controller that monitoring resource changes and the other is a HTTP server receiving GitHub events.

kubectl apply -f https://github.com/tommy351/pullup/blob/master/deployment/deployment.yml

Create a new service exposing the webhook server. You may need to change the service type based on your need.

kubectl apply -f https://github.com/tommy351/pullup/blob/master/deployment/service.yml

RBAC

Besides the RBAC settings you have installed in the previous section, you also have to grant access of the resources that you defined in webhooks. If your Kubernetes cluster is not RBAC enabled, you can skip this section.

You have to create Role and RoleBinding (or ClusterRole and ClusterRoleBinding for all namespaces), set verbs to ["get", "create", "update"] for each kind of resources and bind the role to the pullup service account.

The following example includes Deployment and Service. See here for more details about RBAC.

---
apiVersion: rbac.authorization.k8s.io/v1
# Change this to ClusterRole to apply in all namespaces.
kind: Role
metadata:
  name: pullup-deployment
rules:
  # Deployment
  - apiGroups: ["apps", "extensions"]
    resources: ["deployments"]
    verbs: ["get", "create", "update"]
  # Service
  - apiGroups: [""]
    resources: ["services"]
    verbs: ["get", "create", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
# Change this to ClusterRoleBinding to apply in all namespaces.
kind: RoleBinding
metadata:
  name: pullup-deployment
# Bind to the pullup service account
subjects:
  - kind: ServiceAccount
    name: pullup
    namespace: pullup
# Refer to the role above
roleRef:
  kind: Role
  name: pullup-deployment
  apiGroup: rbac.authorization.k8s.io

Documentation

Contributing

See CONTRIBUTING.md for information about setting environment.

Todos

You can’t perform that action at this time.