Skip to content

Commit 6a37e25

Browse files
committed
Migration from DeploymentConfig to Deployment
For more information see https://docs.openshift.com/container-platform/4.12/applications/deployments/what-deployments-are.html Since OpenShift 4.14 DeploymentConfigs are deprecated. https://access.redhat.com/articles/7041372 Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent b36dfdb commit 6a37e25

File tree

2 files changed

+14
-48
lines changed

2 files changed

+14
-48
lines changed

examples/postgresql-ephemeral-template.json

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,41 +66,24 @@
6666
}
6767
},
6868
{
69-
"kind": "DeploymentConfig",
70-
"apiVersion": "apps.openshift.io/v1",
69+
"kind": "Deployment",
70+
"apiVersion": "apps/v1",
7171
"metadata": {
7272
"name": "${DATABASE_SERVICE_NAME}",
7373
"annotations": {
74-
"template.alpha.openshift.io/wait-for-ready": "true"
74+
"template.alpha.openshift.io/wait-for-ready": "true",
75+
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
7576
}
7677
},
7778
"spec": {
7879
"strategy": {
7980
"type": "Recreate"
8081
},
81-
"triggers": [
82-
{
83-
"type": "ImageChange",
84-
"imageChangeParams": {
85-
"automatic": true,
86-
"containerNames": [
87-
"postgresql"
88-
],
89-
"from": {
90-
"kind": "ImageStreamTag",
91-
"name": "postgresql:${POSTGRESQL_VERSION}",
92-
"namespace": "${NAMESPACE}"
93-
},
94-
"lastTriggeredImage": ""
95-
}
96-
},
97-
{
98-
"type": "ConfigChange"
99-
}
100-
],
10182
"replicas": 1,
10283
"selector": {
103-
"name": "${DATABASE_SERVICE_NAME}"
84+
"matchLabels": {
85+
"name": "${DATABASE_SERVICE_NAME}"
86+
}
10487
},
10588
"template": {
10689
"metadata": {

examples/postgresql-persistent-template.json

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -83,41 +83,24 @@
8383
}
8484
},
8585
{
86-
"kind": "DeploymentConfig",
87-
"apiVersion": "apps.openshift.io/v1",
86+
"kind": "Deployment",
87+
"apiVersion": "apps/v1",
8888
"metadata": {
8989
"name": "${DATABASE_SERVICE_NAME}",
9090
"annotations": {
91-
"template.alpha.openshift.io/wait-for-ready": "true"
91+
"template.alpha.openshift.io/wait-for-ready": "true",
92+
"image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"postgresql:${POSTGRESQL_VERSION}\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]"
9293
}
9394
},
9495
"spec": {
9596
"strategy": {
9697
"type": "Recreate"
9798
},
98-
"triggers": [
99-
{
100-
"type": "ImageChange",
101-
"imageChangeParams": {
102-
"automatic": true,
103-
"containerNames": [
104-
"postgresql"
105-
],
106-
"from": {
107-
"kind": "ImageStreamTag",
108-
"name": "postgresql:${POSTGRESQL_VERSION}",
109-
"namespace": "${NAMESPACE}"
110-
},
111-
"lastTriggeredImage": ""
112-
}
113-
},
114-
{
115-
"type": "ConfigChange"
116-
}
117-
],
11899
"replicas": 1,
119100
"selector": {
120-
"name": "${DATABASE_SERVICE_NAME}"
101+
"matchLabels": {
102+
"name": "${DATABASE_SERVICE_NAME}"
103+
}
121104
},
122105
"template": {
123106
"metadata": {

0 commit comments

Comments
 (0)