/
openshift-template-deploy-only.yml
85 lines (78 loc) · 2.65 KB
/
openshift-template-deploy-only.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This OpenShift template will deploy a pre-build docker image from DockerHub
# Use it from the CLI with:
# $ oc new-app -f openshift-template-deploy-only.yml -p SERVICE_ACCOUNT=xxx,GITHUB_ACCESS_TOKEN=xxx,GITHUB_ORGANIZATION=xxx
kind: Template
apiVersion: v1
metadata:
name: github-hooks-controller-deployer
annotations:
description: Deploys the OpenShift GitHub Hooks Sync controller.
tags: openshift,github,hooks,sync,controller
labels:
template: github-hooks-controller-deployer
parameters:
# mandatory parameters
- name: SERVICE_ACCOUNT
description: The name of a ServiceAccount which has the cluster-reader role
required: true
- name: GITHUB_ACCESS_TOKEN
description: The GitHub token used to authenticate to the API - https://github.com/settings/tokens
required: true
- name: GITHUB_ORGANIZATION
description: The name of the GitHub organization used to authenticate to the API - https://github.com/settings/tokens
required: true
# optional parameters
- name: GITHUB_BASE_URL
description: "The GitHub Base URL - if you use GitHub Enterprise. Format: https://github.domain.tld/api/v3/"
value: https://api.github.com/
- name: RESYNC_PERIOD
description: Define the interval of time to perform a full resync of all the webhooks. Set to 0 to disable.
value: 1h
- name: LOG_LEVEL
description: "Log level. 0 for almost no logs (except warnings/errors), 1 for minimum info logs, 3 for more logs, 5 even more, 8 forget about it ;-)"
value: "1"
# optional deployer options
- name: IMAGE
description: The reference of the Docker image to deploy
value: vbehar/openshift-github-hooks:latest
- name: TIMEZONE
description: The timezone of the pods
value: Europe/Paris
objects:
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: github-hooks-controller
spec:
replicas: 1
strategy:
type: Rolling
rollingParams:
maxUnavailable: 1
maxSurge: 0
template:
metadata:
labels:
deployment-config.name: github-hooks-controller
spec:
serviceAccountName: ${SERVICE_ACCOUNT}
containers:
- name: github-hooks-controller
image: ${IMAGE}
command:
- openshift-github-hooks
- sync
- --github-insecure-skip-tls-verify
- --resync-period=${RESYNC_PERIOD}
- --v=${LOG_LEVEL}
env:
- name: GITHUB_BASE_URL
value: ${GITHUB_BASE_URL}
- name: GITHUB_ACCESS_TOKEN
value: ${GITHUB_ACCESS_TOKEN}
- name: GITHUB_ORGANIZATION
value: ${GITHUB_ORGANIZATION}
- name: TZ
value: ${TIMEZONE}
triggers:
- type: ConfigChange