Reputation: 3380
I need to vary the deployment config of an application, by adding an extra YAML section within it (in the example the section name: ping and its two attributes)
containers:
- name: openshift-wf-cluster
image: 172.30.1.1:5000/demo/openshift-wf@sha256:5d7e13e981f25b8933d54c8716d169fadf1c4b9c03468a5b6a7170492d5b9d93
ports:
- containerPort: 8080
protocol: TCP
- name: ping
containerPort: 8888
protocol: TCP
Is it possible to do it from the oc shell command ?(without manually editing the file) A sort of adding an extra node to one section of the YAML ?
Upvotes: 4
Views: 8240
Reputation: 945
Yes. You can edit your deployment config in place with the openshift tools
oc edit dc/deployment-1-name
will open an editor for you to change your config.
Upvotes: -3
Reputation: 1769
You can use the oc patch
command to achieve this. See oc patch --help
for more info. Try the following with your own deployment config name:
oc patch dc/YOURDC -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/ports/1", "value":{"name":"ping","containerPort":8888,"protocol":"TCP"}}]' --type=json
Upvotes: 8