native openshift: support for passing in answers.conf
Right now not sure of the way we are going to pass in answers when someone runs oc new-app <IMAGE>. Figuring this out might not involve code work but certainly will need some docs so opening an issue to track it is fair.
The pattern to inject local files, available today, is to use secrets. This mounts a local file into a pod.
oc secrets new <service_name> <local_file.yaml>=<pod_file_path>
So the question then is how to generate the answerfile in the first place. This is a general problem not specific to atomicapp. I have an application with a complex config file (example). I want to generate a file locally as a place to start, update values, check into source control, create secret, deploy.
The pattern to inject local files, available today, is to use secrets.
right. but to use them with oc new-app we have to add the secret to a service account right? We can't just add the secrets to the "install" pod because it hasn't been created yet. we then have to delete the answers.conf from the service account afterwards.. This is a bit cumbersome on the user but I don't have a better answer right now.
as far as creating the answers.conf we could just have oc new-app print out the answers.conf file contents to stdout and have the user create a file out of that.
@dustymabe right. Not ideal, for sure.
One recent update: people can now embed answers.conf file in a container if they want to. Though not ideal, this would allow for passing in answers to OpenShift. This was done in 438ad78e.
Another update: you can now specify an answer file via url and you can also pass in args to oc new-app via environment variables. So to pass in an answers file that is accessible via http you can use oc new-app --grant-install-rights -e ATOMICAPP_APPEND_ARGS="--answers=http://example.com/answers.conf"
While we want to have a better answer for this in the future there are currently two ways to pass in answers to oc new-app. Moving the milestone from GA for now.