Skip to content

Commit 340ed41

Browse files
committed
Parameterize service name and fix route
2 parents 9f5a3cc + 0324c24 commit 340ed41

File tree

1 file changed

+25
-68
lines changed

1 file changed

+25
-68
lines changed

openshift/templates/nodejs.json

Lines changed: 25 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,39 @@
11
{
22
"kind": "Template",
3-
"apiVersion": "v1beta3",
3+
"apiVersion": "v1",
44
"metadata": {
55
"name": "nodejs-example",
6-
"creationTimestamp": null,
76
"annotations": {
8-
"description": "A simple Node.js application that responds with information about the server.",
7+
"description": "A simple Node.js application with no database",
98
"iconClass": "icon-nodejs",
109
"tags": "instant-app,nodejs"
1110
}
1211
},
1312
"objects": [
1413
{
1514
"kind": "Service",
16-
"apiVersion": "v1beta3",
15+
"apiVersion": "v1",
1716
"metadata": {
18-
"name": "${FRONTEND_SERVICE_NAME}",
19-
"creationTimestamp": null
17+
"name": "${FRONTEND_SERVICE_NAME}"
2018
},
2119
"spec": {
2220
"ports": [
2321
{
2422
"name": "web",
25-
"protocol": "TCP",
2623
"port": 8080,
27-
"targetPort": 8080,
28-
"nodePort": 0
24+
"targetPort": 8080
2925
}
3026
],
3127
"selector": {
3228
"name": "${FRONTEND_SERVICE_NAME}"
33-
},
34-
"portalIP": "",
35-
"type": "ClusterIP",
36-
"sessionAffinity": "None"
37-
},
38-
"status": {
39-
"loadBalancer": {}
29+
}
4030
}
4131
},
4232
{
4333
"kind": "Route",
44-
"apiVersion": "v1beta3",
34+
"apiVersion": "v1",
4535
"metadata": {
46-
"name": "${FRONTEND_ROUTE}",
47-
"creationTimestamp": null
36+
"name": "${FRONTEND_ROUTE}"
4837
},
4938
"spec": {
5039
"host" : "${FRONTEND_ROUTE}",
@@ -56,57 +45,46 @@
5645
},
5746
{
5847
"kind": "ImageStream",
59-
"apiVersion": "v1beta3",
48+
"apiVersion": "v1",
6049
"metadata": {
61-
"name": "nodejs-example",
62-
"creationTimestamp": null
63-
},
64-
"spec": {},
65-
"status": {
66-
"dockerImageRepository": ""
50+
"name": "nodejs-example"
6751
}
6852
},
6953
{
7054
"kind": "ImageStream",
71-
"apiVersion": "v1beta3",
55+
"apiVersion": "v1",
7256
"metadata": {
73-
"name": "nodejs-010-centos7",
74-
"creationTimestamp": null
57+
"name": "nodejs-010-centos7"
7558
},
7659
"spec": {
7760
"dockerImageRepository": "openshift/nodejs-010-centos7"
78-
},
79-
"status": {
80-
"dockerImageRepository": ""
8161
}
8262
},
8363
{
8464
"kind": "BuildConfig",
85-
"apiVersion": "v1beta3",
65+
"apiVersion": "v1",
8666
"metadata": {
8767
"name": "nodejs-example",
88-
"creationTimestamp": null,
8968
"labels": {
9069
"name": "nodejs-example"
9170
}
9271
},
9372
"spec": {
9473
"triggers": [
9574
{
96-
"type": "github",
75+
"type": "GitHub",
9776
"github": {
9877
"secret": "secret101"
9978
}
10079
},
10180
{
102-
"type": "generic",
81+
"type": "Generic",
10382
"generic": {
10483
"secret": "secret101"
10584
}
10685
},
10786
{
108-
"type": "imageChange",
109-
"imageChange": {}
87+
"type": "ImageChange"
11088
}
11189
],
11290
"source": {
@@ -130,19 +108,14 @@
130108
"kind": "ImageStreamTag",
131109
"name": "nodejs-example:latest"
132110
}
133-
},
134-
"resources": {}
135-
},
136-
"status": {
137-
"lastVersion": 0
111+
}
138112
}
139113
},
140114
{
141115
"kind": "DeploymentConfig",
142-
"apiVersion": "v1beta3",
116+
"apiVersion": "v1",
143117
"metadata": {
144-
"name": "nodejs-example",
145-
"creationTimestamp": null
118+
"name": "nodejs-frontend"
146119
},
147120
"spec": {
148121
"strategy": {
@@ -151,8 +124,7 @@
151124
"updatePeriodSeconds": 1,
152125
"intervalSeconds": 1,
153126
"timeoutSeconds": 120
154-
},
155-
"resources": {}
127+
}
156128
},
157129
"triggers": [
158130
{
@@ -165,8 +137,7 @@
165137
"from": {
166138
"kind": "ImageStreamTag",
167139
"name": "nodejs-example:latest"
168-
},
169-
"lastTriggeredImage": ""
140+
}
170141
}
171142
}
172143
],
@@ -176,7 +147,6 @@
176147
},
177148
"template": {
178149
"metadata": {
179-
"creationTimestamp": null,
180150
"labels": {
181151
"name": "nodejs-example"
182152
}
@@ -188,26 +158,14 @@
188158
"image": "nodejs-example",
189159
"ports": [
190160
{
191-
"containerPort": 8080,
192-
"protocol": "TCP"
161+
"containerPort": 8080
193162
}
194-
],
195-
"resources": {},
196-
"terminationMessagePath": "/dev/termination-log",
197-
"imagePullPolicy": "IfNotPresent",
198-
"capabilities": {},
199-
"securityContext": {
200-
"capabilities": {},
201-
"privileged": false
202-
}
163+
]
203164
}
204-
],
205-
"restartPolicy": "Always",
206-
"dnsPolicy": "ClusterFirst"
165+
]
207166
}
208167
}
209-
},
210-
"status": {}
168+
}
211169
}
212170
],
213171
"parameters": [
@@ -231,4 +189,3 @@
231189
"template": "nodejs-example"
232190
}
233191
}
234-

0 commit comments

Comments
 (0)