Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] script for generating templates/pods in YAML format #12402

Closed
phracek opened this issue Jan 6, 2017 · 11 comments
Closed

[RFE] script for generating templates/pods in YAML format #12402

phracek opened this issue Jan 6, 2017 · 11 comments

Comments

@phracek
Copy link
Contributor

phracek commented Jan 6, 2017

I work in modularity team and playing with docker files and OpenShift.
I have to write YML files for templates or even pods. Like POD -> Deployment -> two containers.
It would be nice to have a script or generated which can help me to generate a template, pods, etc.

Current Result

I did not find any script which can do it.
But maybe you have different tools for it.
I will share definitely information from your team to the others if you have something like this.

@PI-Victor
Copy link
Contributor

i remember @rhcarvalho and @php-coder did something similar during a hackaton, not sure what the current official status of that is.
cc @bparees

@rhcarvalho
Copy link
Contributor

@phracek can you describe a bit more your workflow and where is your pain point?

A more precise suggestion or pointer to some existing tool depends on what you need.

@phracek
Copy link
Contributor Author

phracek commented Jan 6, 2017

@rhcarvalho Ok, I will describe it a little bit more. Let's say I am a maintainer of some service like http, postfix, etc. I I have build docker image. It does not matter whether at my local repository or even on Docker Hub. I would like to create a POD with one deployment and one or two containers. Unfortunately I don't have more know-how to write it. The tool could help me a bit during the start.

@bparees
Copy link
Contributor

bparees commented Jan 6, 2017

"oc run yourimage"

@phracek
Copy link
Contributor Author

phracek commented Jan 6, 2017

Ca I run two containers in one POD?
Do I need to call oc new-app ...
What about root privileges? How to setup it etc.

@phracek
Copy link
Contributor Author

phracek commented Jan 6, 2017

I guess, some script/binary would be welcome to help OpenShift users how to deploy their application properly. It would be awesome tool.

@bparees
Copy link
Contributor

bparees commented Jan 6, 2017

as far as i know, oc run is for running single containers in a pod, but new-app allows you to run multiple containers in a pod:

https://docs.openshift.org/latest/dev_guide/application_lifecycle/new_app.html#grouping-images-and-source-in-a-single-pod

@rhcarvalho
Copy link
Contributor

@phracek once you have something running with either oc run, oc new-app, or anything else, then you can export a template with oc export.

https://docs.openshift.org/latest/dev_guide/templates.html#export-as-template

Note that the template may still require some tweaks, like parameterizing certain values.

The use case described is so generic that I cannot imagine a script/tool that would automatically and correctly do what you expect. Have you tried looking at existing example templates and basing your own templates on them?

https://github.com/openshift/origin/tree/master/examples

@php-coder
Copy link
Contributor

php-coder commented Jan 6, 2017

I guess, some script/binary would be welcome to help OpenShift users how to deploy their application properly. It would be awesome tool.

For simple cases there is oc create deployment (and oc create deploymentconfig). Is it what you're looking for?

@phracek
Copy link
Contributor Author

phracek commented Jan 16, 2017

@php-coder oc create deployment shows help. oc create deploymentconfig wants a NAME.
Unfortunately, this is not what I would like to do. Let's say, I will specify PORT, VOLUME in Dockerfile and Docker image and your script will generate a template for later on usage into OpenShift. Data into template will be generated based on my data.

I have created a template like this https://github.com/container-images/container-image-template/blob/master/openshift-template.yml.
I am creating a script which will create working template where:

  • user specifies docker image name
  • if Dockerfile exists in the directory, then it will take its settings (like EXPOSE, VOLUMES) and add then to template
  • etc.

Does it make sense now?

@bparees
Copy link
Contributor

bparees commented Apr 11, 2017

i think you might want to look at the opencompose project, which you can use to produce resource files that you can deploy on openshift:
https://github.com/redhat-developer/opencompose

@bparees bparees closed this as completed Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants