pullup

module
v1.0.0-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2020 License: Apache-2.0

README

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

Install Pullup CRDs and components in pullup namespace.

# Install the latest version
kubectl apply -f https://github.com/tommy351/pullup/releases/latest/download/pullup-deployment.yml

# Install a specific version
kubectl apply -f https://github.com/tommy351/pullup/releases/download/v0.3.3/pullup-deployment.yml

The YAML file is generated with kustomize. You can see source files in deployment folder. It contains:

  • Pullup custom resource definitions (CRD).
  • A Service account.
  • RBAC for accessing Pullup CRD, writing events and the leader election.
  • Deployments of the controller and the webhook.
  • A service exposing the webhook server.

RBAC

After Pullup is installed, you 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

Directories

Path Synopsis
cmd
internal
k8s
log
pkg
apis/pullup/v1alpha1
Package v1alpha1 is the v1alpha1 version of the API.
Package v1alpha1 is the v1alpha1 version of the API.
apis/pullup/v1beta1
Package v1beta1 is the v1beta1 version of the API.
Package v1beta1 is the v1beta1 version of the API.
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL