forked from amitopenwriteup/okd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploymentconfigjson.txt
More file actions
60 lines (54 loc) · 1.62 KB
/
Copy pathdeploymentconfigjson.txt
File metadata and controls
60 lines (54 loc) · 1.62 KB
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
Json file
{
"apiVersion": "apps.openshift.io/v1",
"kind": "DeploymentConfig",
"metadata": {
"name": "my-deployment-config"
},
"spec": {
"replicas": 3,
"template": {
"metadata": {
"labels": {
"app": "my-app"
}
},
"spec": {
"containers": [
{
"name": "my-container",
"image": "my-docker-imagestream:1.14.1"
}
]
}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": ["my-container"],
"from": {
"kind": "ImageStreamTag",
"name": "my-docker-imagestream:1.14.1"
}
}
}
]
}
}
```
In this example:
- `"my-deployment-config"` should be replaced with your desired DeploymentConfig name.
- `"my-docker-imagestream:1.14.1"` should match the name and tag of the ImageStream you created previously.
- The `"replicas"` field indicates the desired number of replicas for your application.
- The `"triggers"` section specifies the triggers for the DeploymentConfig:
- The `"ConfigChange"` trigger is set to respond to changes in the DeploymentConfig's configuration.
- The `"ImageChange"` trigger is set to automatically respond to changes in the referenced image (from the ImageStream) and update the application.
To apply this JSON configuration and create the DeploymentConfig, you can use the `oc create` command:
```bash
oc create -f deploymentconfig.json
```