Skip to content

Commit 512ccd0

Browse files
authored
Merge pull request #31 from phracek/migrate_deployment
Migration from DeploymentConfig to Deployment
2 parents 7672c48 + b126e58 commit 512ccd0

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

openshift/templates/nginx.json

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
},
1717
"message": "The following service(s) have been created in your project: ${NAME}.\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/nginx-ex/blob/master/README.md.",
1818
"labels": {
19-
"template": "nginx-example"
19+
"template": "${NAME}",
20+
"app": "${NAME}"
2021
},
2122
"objects": [
2223
{
@@ -126,46 +127,32 @@
126127
}
127128
},
128129
{
129-
"kind": "DeploymentConfig",
130-
"apiVersion": "apps.openshift.io/v1",
130+
"kind": "Deployment",
131+
"apiVersion": "apps/v1",
131132
"metadata": {
132133
"name": "${NAME}",
133134
"annotations": {
134135
"description": "Defines how to deploy the application server",
135-
"template.alpha.openshift.io/wait-for-ready": "true"
136+
"template.alpha.openshift.io/wait-for-ready": "true",
137+
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
136138
}
137139
},
138140
"spec": {
139141
"strategy": {
140-
"type": "Rolling"
142+
"type": "RollingUpdate"
141143
},
142-
"triggers": [
143-
{
144-
"type": "ImageChange",
145-
"imageChangeParams": {
146-
"automatic": true,
147-
"containerNames": [
148-
"nginx-example"
149-
],
150-
"from": {
151-
"kind": "ImageStreamTag",
152-
"name": "${NAME}:latest"
153-
}
154-
}
155-
},
156-
{
157-
"type": "ConfigChange"
158-
}
159-
],
160144
"replicas": 1,
161145
"selector": {
162-
"name": "${NAME}"
146+
"matchLabels": {
147+
"name": "${NAME}",
148+
"app": "${NAME}"
149+
}
163150
},
164151
"template": {
165152
"metadata": {
166-
"name": "${NAME}",
167153
"labels": {
168-
"name": "${NAME}"
154+
"name": "${NAME}",
155+
"app": "${NAME}"
169156
}
170157
},
171158
"spec": {

0 commit comments

Comments
 (0)