Skip to content

Commit e410633

Browse files
committed
disable jenkins auto-deployment
1 parent 681c6f2 commit e410633

File tree

9 files changed

+524
-325
lines changed

9 files changed

+524
-325
lines changed

examples/jenkins/jenkins-ephemeral-template.json

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"name": "jenkins-ephemeral",
66
"creationTimestamp": null,
77
"annotations": {
8-
"description": "Jenkins service, without persistent storage.\nThe username is 'admin' and the tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
8+
"description": "Jenkins service, without persistent storage.\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
99
"iconClass": "icon-jenkins",
1010
"tags": "instant-app,jenkins"
1111
}
1212
},
13-
"message": "A Jenkins service has been created in your project. The username/password are admin/${JENKINS_PASSWORD}.",
13+
"message": "A Jenkins service has been created in your project. The username/password are admin/${JENKINS_PASSWORD}. The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.",
1414
"objects": [
1515
{
1616
"kind": "Route",
@@ -26,6 +26,7 @@
2626
},
2727
"tls": {
2828
"termination": "edge",
29+
"insecureEdgeTerminationPolicy": "Redirect",
2930
"certificate": "-----BEGIN CERTIFICATE-----\nMIIDIjCCAgqgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBoTELMAkGA1UEBhMCVVMx\nCzAJBgNVBAgMAlNDMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0Rl\nZmF1bHQgQ29tcGFueSBMdGQxEDAOBgNVBAsMB1Rlc3QgQ0ExGjAYBgNVBAMMEXd3\ndy5leGFtcGxlY2EuY29tMSIwIAYJKoZIhvcNAQkBFhNleGFtcGxlQGV4YW1wbGUu\nY29tMB4XDTE1MDExMjE0MTk0MVoXDTE2MDExMjE0MTk0MVowfDEYMBYGA1UEAwwP\nd3d3L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----"
@@ -75,6 +76,7 @@
7576
}
7677
},
7778
"spec": {
79+
"serviceAccountName": "${JENKINS_SERVICE_NAME}",
7880
"containers": [
7981
{
8082
"name": "jenkins",
@@ -89,7 +91,7 @@
8991
},
9092
"livenessProbe": {
9193
"timeoutSeconds": 3,
92-
"initialDelaySeconds": 60,
94+
"initialDelaySeconds": 120,
9395
"httpGet": {
9496
"path": "/login",
9597
"port": 8080
@@ -99,6 +101,14 @@
99101
{
100102
"name": "JENKINS_PASSWORD",
101103
"value": "${JENKINS_PASSWORD}"
104+
},
105+
{
106+
"name": "KUBERNETES_MASTER",
107+
"value": "https://kubernetes.default:443"
108+
},
109+
{
110+
"name": "KUBERNETES_TRUST_CERTIFICATES",
111+
"value": "true"
102112
}
103113
],
104114
"resources": {
@@ -135,20 +145,43 @@
135145
}
136146
}
137147
},
148+
{
149+
"kind": "ServiceAccount",
150+
"apiVersion": "v1",
151+
"metadata": {
152+
"name": "${JENKINS_SERVICE_NAME}"
153+
}
154+
},
155+
{
156+
"kind": "RoleBinding",
157+
"apiVersion": "v1",
158+
"metadata": {
159+
"name": "${JENKINS_SERVICE_NAME}_edit"
160+
},
161+
"groupNames": null,
162+
"subjects": [
163+
{
164+
"kind": "ServiceAccount",
165+
"name": "${JENKINS_SERVICE_NAME}"
166+
}
167+
],
168+
"roleRef": {
169+
"name": "edit"
170+
}
171+
},
138172
{
139173
"kind": "Service",
140174
"apiVersion": "v1",
141175
"metadata": {
142-
"name": "${JENKINS_SERVICE_NAME}",
143-
"creationTimestamp": null
176+
"name": "jenkins-jnlp"
144177
},
145178
"spec": {
146179
"ports": [
147180
{
148-
"name": "web",
181+
"name": "agent",
149182
"protocol": "TCP",
150-
"port": 8080,
151-
"targetPort": 8080,
183+
"port": 50000,
184+
"targetPort": 50000,
152185
"nodePort": 0
153186
}
154187
],
@@ -159,6 +192,35 @@
159192
"type": "ClusterIP",
160193
"sessionAffinity": "None"
161194
}
195+
},
196+
{
197+
"kind": "Service",
198+
"apiVersion": "v1",
199+
"metadata": {
200+
"name": "${JENKINS_SERVICE_NAME}",
201+
"annotations": {
202+
"service.alpha.openshift.io/dependencies": "[{\"name\": \"jenkins-jnlp\", \"namespace\": \"\", \"kind\": \"Service\"}]",
203+
"service.openshift.io/infrastructure": "true"
204+
},
205+
"creationTimestamp": null
206+
},
207+
"spec": {
208+
"ports": [
209+
{
210+
"name": "web",
211+
"protocol": "TCP",
212+
"port": 80,
213+
"targetPort": 8080,
214+
"nodePort": 0
215+
}
216+
],
217+
"selector": {
218+
"name": "${JENKINS_SERVICE_NAME}"
219+
},
220+
"portalIP": "",
221+
"type": "ClusterIP",
222+
"sessionAffinity": "None"
223+
}
162224
}
163225
],
164226
"parameters": [

examples/jenkins/jenkins-persistent-template.json

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"name": "jenkins-persistent",
66
"creationTimestamp": null,
77
"annotations": {
8-
"description": "Jenkins service, with persistent storage.\nThe username is 'admin' and the tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.\nYou must have persistent volumes available in your cluster to use this template.",
8+
"description": "Jenkins service, with persistent storage.\nYou must have persistent volumes available in your cluster to use this template.",
99
"iconClass": "icon-jenkins",
1010
"tags": "instant-app,jenkins"
1111
}
1212
},
13-
"message": "A Jenkins service has been created in your project. The username/password are admin/${JENKINS_PASSWORD}.",
13+
"message": "A Jenkins service has been created in your project. The username/password are admin/${JENKINS_PASSWORD}. The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.",
1414
"objects": [
1515
{
1616
"kind": "Route",
@@ -26,6 +26,7 @@
2626
},
2727
"tls": {
2828
"termination": "edge",
29+
"insecureEdgeTerminationPolicy": "Redirect",
2930
"certificate": "-----BEGIN CERTIFICATE-----\nMIIDIjCCAgqgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBoTELMAkGA1UEBhMCVVMx\nCzAJ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qzFKVR4OS/6lCJ8YncxoFpTntbvjgojf1DEataKFUN196PAANc3yz8cWHF4uvjPv\nWkgFqbIjb+7D1YgglNyovXkRDlRZl0LD1OQ0ZWhd4Ge1qx8mmmanoBeYZ9+DgpFC\nj9tQAbS867yeOryNe7sEOIpXAAqK/DTu0hB6+ySsDfMo4piXCc2aA/eI2DCuw08e\nw17Dz9WnupZjVdwTKzDhFgJZMLDqn37HQnT6EemLFqbcR0VPEnfyhDtZIQ==\n-----END CERTIFICATE-----"
@@ -92,6 +93,7 @@
9293
}
9394
},
9495
"spec": {
96+
"serviceAccountName": "${JENKINS_SERVICE_NAME}",
9597
"containers": [
9698
{
9799
"name": "jenkins",
@@ -106,7 +108,7 @@
106108
},
107109
"livenessProbe": {
108110
"timeoutSeconds": 3,
109-
"initialDelaySeconds": 60,
111+
"initialDelaySeconds": 120,
110112
"httpGet": {
111113
"path": "/login",
112114
"port": 8080
@@ -116,6 +118,14 @@
116118
{
117119
"name": "JENKINS_PASSWORD",
118120
"value": "${JENKINS_PASSWORD}"
121+
},
122+
{
123+
"name": "KUBERNETES_MASTER",
124+
"value": "https://kubernetes.default:443"
125+
},
126+
{
127+
"name": "KUBERNETES_TRUST_CERTIFICATES",
128+
"value": "true"
119129
}
120130
],
121131
"resources": {
@@ -152,20 +162,43 @@
152162
}
153163
}
154164
},
165+
{
166+
"kind": "ServiceAccount",
167+
"apiVersion": "v1",
168+
"metadata": {
169+
"name": "${JENKINS_SERVICE_NAME}"
170+
}
171+
},
172+
{
173+
"kind": "RoleBinding",
174+
"apiVersion": "v1",
175+
"metadata": {
176+
"name": "${JENKINS_SERVICE_NAME}_edit"
177+
},
178+
"groupNames": null,
179+
"subjects": [
180+
{
181+
"kind": "ServiceAccount",
182+
"name": "${JENKINS_SERVICE_NAME}"
183+
}
184+
],
185+
"roleRef": {
186+
"name": "edit"
187+
}
188+
},
155189
{
156190
"kind": "Service",
157191
"apiVersion": "v1",
158192
"metadata": {
159-
"name": "${JENKINS_SERVICE_NAME}",
160-
"creationTimestamp": null
193+
"name": "jenkins-jnlp"
161194
},
162195
"spec": {
163196
"ports": [
164197
{
165-
"name": "web",
198+
"name": "agent",
166199
"protocol": "TCP",
167-
"port": 8080,
168-
"targetPort": 8080,
200+
"port": 50000,
201+
"targetPort": 50000,
169202
"nodePort": 0
170203
}
171204
],
@@ -176,6 +209,35 @@
176209
"type": "ClusterIP",
177210
"sessionAffinity": "None"
178211
}
212+
},
213+
{
214+
"kind": "Service",
215+
"apiVersion": "v1",
216+
"metadata": {
217+
"name": "${JENKINS_SERVICE_NAME}",
218+
"annotations": {
219+
"service.alpha.openshift.io/dependencies": "[{\"name\": \"jenkins-jnlp\", \"namespace\": \"\", \"kind\": \"Service\"}]",
220+
"service.openshift.io/infrastructure": "true"
221+
},
222+
"creationTimestamp": null
223+
},
224+
"spec": {
225+
"ports": [
226+
{
227+
"name": "web",
228+
"protocol": "TCP",
229+
"port": 80,
230+
"targetPort": 8080,
231+
"nodePort": 0
232+
}
233+
],
234+
"selector": {
235+
"name": "${JENKINS_SERVICE_NAME}"
236+
},
237+
"portalIP": "",
238+
"type": "ClusterIP",
239+
"sessionAffinity": "None"
240+
}
179241
}
180242
],
181243
"parameters": [

examples/jenkins/pipeline/README.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ To walk through the example:
1515
jenkins template represented by jenkinstemplate.json by running these commands as a cluster admin:
1616

1717
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/image-streams/image-streams-centos7.json -n openshift
18-
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/jenkinstemplate.json -n openshift
18+
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/jenkins-ephemeral-template.json -n openshift
19+
20+
Note: If you have persistent volumes available in your cluster and prefer to use persistent storage (recommended) for your Jenkins server, register the jenkins-persistent-template.json file as well:
21+
22+
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/jenkins-persistent-template.json -n openshift
1923

2024
2. login as a normal user (any username is fine)
2125

@@ -25,29 +29,37 @@ jenkins template represented by jenkinstemplate.json by running these commands a
2529

2630
$ oc new-project pipelineproject
2731

28-
4. run this command to instantiate the template which will create a pipeline buildconfig and some other resources in your project:
32+
4. run this command to instantiate a Jenkins server and service account in your project:
33+
34+
If your have persistent volumes available in your cluster:
35+
36+
$ oc new-app jenkins-persistent
37+
38+
Otherwise:
39+
40+
$ oc new-app jenkins-ephemeral
41+
42+
Make a note of the Jenkins password reported by new-app.
2943

30-
If you used cluster up:
44+
Note: eventually this will be done automatically when you create a pipeline buildconfig.
45+
46+
5. run this command to instantiate the template which will create a pipeline buildconfig and some other resources in your project:
47+
48+
If you used cluster up:
49+
3150
$ oc new-app jenkins-pipeline-example
3251

33-
Otherwise:
52+
Otherwise:
53+
3454
$ oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/samplepipeline.json
3555

3656
At this point if you run `oc get pods` you should see a jenkins pod, or at least a jenkins-deploy pod. (along with other items in your project) This pod was created as a result of the new pipeline buildconfig being defined by the sample-pipeline template.
3757

38-
5. View/Manage Jenkins (optional)
58+
6. View/Manage Jenkins (optional)
3959

4060
You should not need to access the jenkins console for anything, but if you want to configure settings or watch the execution,
4161
here are the steps to do so:
4262

43-
First you must determine the jenkins password which was randomly generated for you:
44-
45-
$ oc env dc/jenkins --list | grep JENKINS_PASSWORD
46-
47-
The value will appear as:
48-
49-
JENKINS_PASSWORD=faUXMOFUhRYXO2Gx
50-
5163
If you have a router running (`oc cluster up` provides one), run:
5264

5365
$ oc get route
@@ -56,7 +68,7 @@ jenkins template represented by jenkinstemplate.json by running these commands a
5668

5769
If you do not have a router, you can access jenkins directly via the service ip. Determine the jenkins service ip ("oc get svc") and go to it in your browser on port 80. Do not confuse it with the jenkins-jnlp service.
5870

59-
Login with the user name is `admin` and the password as determined above.
71+
Login with the user name is `admin` and the password as recorded earlier.
6072

6173
6. Launch a new build
6274

0 commit comments

Comments
 (0)