|
1 | | -# revision-controller |
| 1 | +# Revision Controller |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Revision Controller is a tool that trigger build when the source code changed, or rerun the application when the image changed. |
| 6 | + |
| 7 | +- Watch the source code in github, gitlab or gitee, rebuild the function when source code changed. |
| 8 | +- Watch the bundle container image which include the soucre code, rebuild the function when image changed. |
| 9 | +- Watch the images of functions that without builder, rerun the image when image changed. |
| 10 | + |
| 11 | +## Quick start |
| 12 | + |
| 13 | +### Install |
| 14 | + |
| 15 | +We assume you already have a Kubernetes cluster (v1.20+) with `OpenFunction`. If you don't, you can follow [this](https://openfunction.dev/docs/getting-started/installation/#install-openfunction) to install `OpenFunction`. |
| 16 | + |
| 17 | +Exec the following commands to deploy the Revision Controller. |
| 18 | + |
| 19 | +```shell |
| 20 | +kubectl apply -f deploy/bundle.yaml |
| 21 | +``` |
| 22 | + |
| 23 | +### How to use |
| 24 | + |
| 25 | +To watch a function, just need to add some annotations to it. |
| 26 | + |
| 27 | +```yaml |
| 28 | +apiVersion: core.openfunction.io/v1beta1 |
| 29 | +kind: Function |
| 30 | +metadata: |
| 31 | + annotations: |
| 32 | + openfunction.io/revision-controller: enable |
| 33 | + openfunction.io/revision-controller-params: | |
| 34 | + type: source |
| 35 | + repo-type: github |
| 36 | + polling-interval: 1m |
| 37 | + name: function-http-java |
| 38 | + namespace: default |
| 39 | +spec: |
| 40 | + build: |
| 41 | + ... |
| 42 | + serving: |
| 43 | + ... |
| 44 | +``` |
| 45 | +
|
| 46 | +Annotations |
| 47 | +
|
| 48 | +| Key | Description | |
| 49 | +| ---------------------------------------------- | ---------------------------------------------------------------------------------------------- | |
| 50 | +| **openfunction.io/revision-controller** | Whether to start a revision controller for this function, known values are enable and disable. | |
| 51 | +| **openfunction.io/revision-controller-params** | Parameters for revision controller. | |
| 52 | +
|
| 53 | +Parameters |
| 54 | +
|
| 55 | +| Name | Description | |
| 56 | +| --------------------- | ------------------------------------------------------------------------------------------------------------------ | |
| 57 | +| **type** | The target type to watch, known values are source, source-image, image. | |
| 58 | +| **polling-interval** | The interval to get the image digest or source code head. | |
| 59 | +| **repo-type** | The type of the git server where the source code be in, known values are github, gitlab, gitee, default is github. | |
| 60 | +| **base-url** | The base url of the gitlab server. | |
| 61 | +| **auth-type** | The auth type of the gitlab server. | |
| 62 | +| **project-id** | The project id of a gitlab repo. | |
| 63 | +| **insecure-registry** | If the image registy is insecure, you should set this to true. | |
0 commit comments