-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
jenkins_operator.yaml
166 lines (165 loc) · 4.03 KB
/
jenkins_operator.yaml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Needs the jenkins-tokens secret for authenticating with Jenkins.
# Needs the oauth-token secret for commenting on Github and updating PR statuses.
apiVersion: template.openshift.io/v1
kind: Template
parameters:
- description: The name of the component.
name: NAME
value: jenkins-operator
- description: The name of the component.
name: NAME_ORIGIN
value: jenkins-origin-operator
objects:
- apiVersion: v1
kind: Service
metadata:
name: "${NAME}"
annotations:
prometheus.io/scrape: "true"
spec:
selector:
app: prow
component: "${NAME}"
ports:
- port: 80
targetPort: 8080
type: ClusterIP
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: "${NAME}"
labels:
app: prow
component: "${NAME}"
spec:
# Do not scale up.
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
template:
metadata:
labels:
app: prow
component: "${NAME}"
spec:
serviceAccountName: "${NAME}"
containers:
- name: "${NAME}"
image: "${NAME}"
args:
- --jenkins-url=https://ci.openshift.redhat.com/jenkins
- --jenkins-user=openshift-ci-robot
- --jenkins-token-file=/etc/jenkins/basic
- --label-selector=master=ci.openshift.redhat.com
- --dry-run=false
ports:
- name: logs
containerPort: 8080
volumeMounts:
- mountPath: /etc/jenkins
name: jenkins
readOnly: true
- name: oauth
mountPath: /etc/github
readOnly: true
- name: config
mountPath: /etc/config
readOnly: true
volumes:
- name: jenkins
secret:
defaultMode: 420
secretName: jenkins-tokens
- name: oauth
secret:
secretName: oauth-token
- name: config
configMap:
name: config
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- "${NAME}"
from:
kind: ImageStreamTag
name: "${NAME}:latest"
type: ImageChange
- apiVersion: v1
kind: Service
metadata:
name: "${NAME_ORIGIN}"
annotations:
prometheus.io/scrape: "true"
spec:
selector:
app: prow
component: "${NAME_ORIGIN}"
ports:
- port: 80
targetPort: 8080
type: ClusterIP
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: "${NAME_ORIGIN}"
labels:
app: prow
component: "${NAME_ORIGIN}"
spec:
# Do not scale up.
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
template:
metadata:
labels:
app: prow
component: "${NAME_ORIGIN}"
spec:
serviceAccountName: "${NAME}"
containers:
- name: "${NAME_ORIGIN}"
image: "${NAME}"
args:
- --jenkins-url=https://jenkins-origin-ci.svc.ci.openshift.org
- --jenkins-bearer-token-file=/etc/jenkins/bearer
- --label-selector=master=jenkins-origin-ci
- --dry-run=false
ports:
- name: logs
containerPort: 8080
volumeMounts:
- mountPath: /etc/jenkins
name: jenkins
readOnly: true
- name: oauth
mountPath: /etc/github
readOnly: true
- name: config
mountPath: /etc/config
readOnly: true
volumes:
- name: jenkins
secret:
defaultMode: 420
secretName: jenkins-tokens
- name: oauth
secret:
secretName: oauth-token
- name: config
configMap:
name: config
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- "${NAME_ORIGIN}"
from:
kind: ImageStreamTag
name: "${NAME}:latest"
type: ImageChange