Excerpts from Randy Barlow's message of 2017-07-05 13:42 -04:00:
On Tue, 2017-07-04 at 11:16 -0600, Kevin Fenzi wrote:
> I am pretty sure you can get it to dump out the json
> of the existing config, so you could in theory set things up, adjust
> the web interface and get it the way you want it, then dump the json
> we can use that in prod.
I think this is the right workflow, but I wanted to point out that the
JSON will have to be "massaged" in some way. I recently took an
OpenShift course at Red Hat and we learned that this JSON export/import
process does require some hand editing, but the course was an intro
course and so we didn't go into the details about what exactly needed
to be edited or in what way.
Speaking only from my very limited experience -- I think the reason it
needs massaging is that when you export an object with oc, it includes
various (read-only) status properties -- ones which reflect the current
state in time and are not configurable. You wouldn't want those to be
tracked in git or posted back when you update the object, because that's
kind of meaningless.
Here is an example below (and btw I suggest YAML over JSON because it's
easier to edit, oc happily deals in either format). You can see large
parts are not configuration, for example the top-level "status" key,
"creationTimestamp", the JSON blob in
"selfLink", "uid", etc.
I think oc knows to ignore those when you post an object back, but you
would want to edit them out before you commit it to git I guess.
$ oc -n waiverdb-stg get route waiverdb-stg-web -o yaml
- lastTransitionTime: 2017-06-22T00:18:48Z
- lastTransitionTime: 2017-06-30T09:50:58Z
Dan Callaghan <dcallagh(a)redhat.com>
Senior Software Engineer, Products & Technologies Operations