forked from siamaksade/jenkins-s2i-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins-master-s2i-template.yaml
166 lines (166 loc) · 3.68 KB
/
jenkins-master-s2i-template.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
apiVersion: v1
kind: Template
metadata:
name: jenkins-master-s2i
labels:
template: jenkins-master-s2i
metadata:
annotations:
description: Creates a Jenkins master using S2I for installing plugins and configuring Jenkins
iconClass: icon-jenkins
tags: instant-app,jenkins
name: jenkins-master-s2i
parameters:
- description: Git source URI for Jenkins S2I
name: SOURCE_REPOSITORY_URL
required: true
value: https://github.com/siamaksade/jenkins-s2i-example.git
- description: Git branch/tag reference
name: SOURCE_REPOSITORY_REF
value: master
- description: Path within Git project to build; empty for root project directory.
name: CONTEXT_DIR
value: master
- description: Maximum amount of memory the container can use.
displayName: Memory Limit
name: MEMORY_LIMIT
value: 1Gi
- description: Password for the Jenkins user.
displayName: Jenkins Password
generate: expression
name: JENKINS_PASSWORD
value: password
- description: Volume space available for data, e.g. 512Mi, 2Gi.
displayName: Volume Capacity
name: VOLUME_CAPACITY
required: true
value: 1Gi
objects:
- apiVersion: v1
kind: ImageStream
metadata:
labels:
app: jenkins
name: jenkins
- apiVersion: v1
kind: Service
metadata:
labels:
app: jenkins
name: jenkins
spec:
ports:
- name: web
port: 8080
protocol: TCP
targetPort: 8080
- name: jnlp
port: 50000
protocol: TCP
targetPort: 50000
selector:
app: jenkins
deploymentconfig: jenkins
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: Route
metadata:
labels:
app: jenkins
name: jenkins
spec:
port:
targetPort: 8080
to:
kind: Service
name: jenkins
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
app: jenkins
name: jenkins
spec:
output:
to:
kind: ImageStreamTag
name: jenkins:latest
resources:
limits:
memory: ${MEMORY_LIMIT}
source:
contextDir: ${CONTEXT_DIR}
git:
uri: ${SOURCE_REPOSITORY_URL}
ref: ${SOURCE_REPOSITORY_REF}
secrets: []
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: jenkins:1
namespace: openshift
type: Source
triggers:
- type: ConfigChange
- imageChange: {}
type: ImageChange
status:
lastVersion: 0
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: jenkins
name: jenkins
spec:
replicas: 1
selector:
app: jenkins
deploymentconfig: jenkins
strategy:
type: Recreate
template:
metadata:
labels:
app: jenkins
deploymentconfig: jenkins
spec:
containers:
- env:
- name: JENKINS_PASSWORD
value: ${JENKINS_PASSWORD}
image: jenkins
imagePullPolicy: Always
name: jenkins
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 50000
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /var/lib/jenkins
name: jenkins-data
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: jenkins-data
emptyDir:
medium: ""
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- jenkins
from:
kind: ImageStreamTag
name: jenkins:latest
type: ImageChange