You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
easy way to import apps into the OpenShift template library? #1629
in the fabric8 console you can drag and drop zip files into the console library; or drag and drop from the console to the desktop for a simple kind of "Apps Library" a little like your iTunes library for mobile apps.
It would be pretty handy for folks to be able to run all the fabric8 apps from inside the OpenShift console too; using the 'create template' stuff; we'd just need a way to be able to import the apps (templates) into OpenShift.
Is there an easy way to do such a thing; or can we add it?
We're encouraging java folks using Maven to reuse the same maven tooling to generate their own apps / app zips as well; so this tool would be reusable by customers & users too I should think.
I don't see why not. One way (maybe not the best way, but a possible way) is to do the following transformation:
The name of the directory becomes a template name
The body of the template is kubernetes.json (the "objects" field can be the config "items" field)
Store the readme as the description (we should supported limited markdown in descriptions, or have a way to indicate the description is markdown)
Store the app icon as a base64 encoded annotation, maybe as a data URI, named "openshift.io/icon-image" or similar on the template - the console should be able to then use it as a base64 url. Data URI is best because we can use it directly.
Store other files as annotations if needed.
Templates don't need to have parameters - seems like a good way to bundle them. If you change the build output to also generate the template.json (or generate a directory of json) someone could then osc create -f it all at once.
thanks @smarterclayton that sounds good to me. I'm a little nervous of the size of pod / RC json having icons in there by value rather than reference; I'd prefer a real URI path to icons but I guess thats a more long term optimisation. e.g. to avoid loading a 30k icon for every pod when you've lots of pods with the same icon.
I'm gonna take a stab porting the fabric8 maven plugin that generates the kubernetes.json / app zips to generate an OpenShift template for each app.
I wonder if we had, say, 20 templates is there gonna be an easy way to import them all into an OpenShift installation easily? I can certainly make a zip of them so they are easy to download/unpack at least; I guess they can be placed somewhere on the file system so the openshift master & console can find them?
thanks @smarterclayton that sounds good to me. I'm a little nervous of the size of pod / RC json having icons in there by value rather than reference; I'd prefer a real URI path to icons but I guess thats a more long term optimisation. e.g. to avoid loading a 30k icon for every pod when you've lots of pods with the same icon.
Oh, I wasn't expecting to put that into the pod. We should be able to tie image repositories to icons maybe.
I'm gonna take a stab porting the fabric8 maven plugin that generates the kubernetes.json / app zips to generate an OpenShift template for each app.
I wonder if we had, say, 20 templates is there gonna be an easy way to import them all into an OpenShift installation easily? I can certainly make a zip of them so they are easy to download/unpack at least; I guess they can be placed somewhere on the file system so the openshift master & console can find them?
Yeah, it should be a single command "osc create -f " which will bulk import all the files.
—
Reply to this email directly or view it on GitHub.
I'm cool with annotating just the templates. What worries me is the 64k limit on annotations; that rules out lots of possible icons already; many PNG icons are over 30k before they get base64 encoded (and some are over 64k as binaries).
I'm thinking we need a place to store icons out of band from the annotations then we can just use links in the annotations. I guess anyone can plugin in a microservice to do this at any time (we did this months ago with our app library in fabric8) but I'd love to have some standard canonical way for a template author or installer to put them and to minimise the number of moving pieces
we could allow putting an actual network URL in the icon annotation (it's a URL already, just a data: URL)... there were just implications we hadn't fully thought through, so we didn't enable that immediately:
mixed-mode errors (or blocked icon loads) if the console is https and the url is http
security implications of loading images from remote URLs specified in templates
@liggitt yeah, it feels like there should be a safe place we can put icons to avoid using remote URLs and so that it works nicely with OpenShift Routes so the URLs can be shared with browsers etc
Import icons provided by the URL (how to store them? wouldn't be easier to just have them as links to external locations in UI?
README as annotation... Isn't better to just link the README.md from the external location as well and fetch it in UI? The only drawback might be when OpenShift is behind proxy or firewall (which applies to the item above as well).
@mfojtik agreed. For public open source projects we can just link to docs and images on github. Thats not going to work too well for private on premise projects though; which may be behind a proxy/firewall or even not have internet access.
Incidentally the fabric8 maven fabric8:json goal now generates OpenShift templates with annotations for the documentation, summary and icon URL.
We default to using a data URL for icons which base64 encoded are less than 40K (its configurable how big is too big); then for larger icons it tries to link to github (by default) to provide an external URL and you can configure it to specify the absolute URL or prefix relative to the source code etc. Ideally I'd still love some place within OpenShift to put the icons; but I guess thats gonna take a while to figure out.
Then we've updated the hawtio-kubernetes console and the fabric8 console to query templates in a namespace and reuse any icons for a template on the apps, services, controllers and pods tabs.
So whenever the OpenShift console starts to reuse views from hawtio-kubernetes we'll get nice per-pod/service/controller/app icons which really helps users grok what pods are what.
BTW we had to effectively disable the dataurls for fabric8 due to the 64k limit for OpenShift templates. The reason is we're composing various applications together into composite OpenShift templates which meant we needed to put multiple icons inside a single template (e.g. jenkins + nexus + gogs + sonarqube + gerrit in a CD template) and soon blew the 64k limit.
So right now - unfortunately - we're having to rely on external links to the icons; referencing them from github; otherwise templates and apps stop being able to be composed into a template.
@liggitt we're combining various RCs and services, as I described, into a single template; each resource typically needs its own icon (e.g. jenkins, nexus, gogs, sonarqube et al). Hence the need for multiple icons per template
HTML in a description will not be rendered correctly by OpenShift (to prevent XSS):
"description" : "Creates an instance of the <a href=\"http://fabric8.io/v2/console.html\">Fabric8 Console</a> for working with fabric8 and kubernetes.",
its also implemented in the hawtio console for kubernetes too which hopefully one day will get integrated into the OpenShift console.
If you have 1 icon per template; then either
you're gonna have to use the same icon for jenkins + nexus + gogs + sonarqube et al which sucks :)
force users to use lots of individual templates for everything (e.g. 1 for your database, 1 for your ElasticSearch, 1 for your web app etc)
One of the nice things about templates is you can compose apps together into a single easy to install template.
e.g. the entire fabric8 Continuous Deployment environment is a single openshift template for easy install
I guess we could encourage users not to compose templates and just keep them really small; so a template only contains something that may have a different icon? Then just have lots and lots of templates. But that kinda breaks the 1 click deploy/run thing for composite apps.
Activity
smarterclayton commentedon Apr 8, 2015
I don't see why not. One way (maybe not the best way, but a possible way) is to do the following transformation:
Templates don't need to have parameters - seems like a good way to bundle them. If you change the build output to also generate the template.json (or generate a directory of json) someone could then osc create -f it all at once.
The UI changes after that should be easy.
jstrachan commentedon Apr 8, 2015
thanks @smarterclayton that sounds good to me. I'm a little nervous of the size of pod / RC json having icons in there by value rather than reference; I'd prefer a real URI path to icons but I guess thats a more long term optimisation. e.g. to avoid loading a 30k icon for every pod when you've lots of pods with the same icon.
I'm gonna take a stab porting the fabric8 maven plugin that generates the kubernetes.json / app zips to generate an OpenShift template for each app.
I wonder if we had, say, 20 templates is there gonna be an easy way to import them all into an OpenShift installation easily? I can certainly make a zip of them so they are easy to download/unpack at least; I guess they can be placed somewhere on the file system so the openshift master & console can find them?
smarterclayton commentedon Apr 8, 2015
jstrachan commentedon Apr 8, 2015
@smarterclayton oh you mean just annotate the template; but not annotate the pod / RC right? If so sure thats good ;)
Am just wondering how we'd find the icon URL for a pod/RC/service; do kubernetes resources get annotated with the template ID?
smarterclayton commentedon Apr 8, 2015
We could annotate the service actually - that one seems like the natural fit. So the template itself could put the annotation on its services.
jwforres commentedon Apr 17, 2015
CC @liggitt
liggitt commentedon May 9, 2015
one thing to be aware of is the size limit on annotations... 64k, I think
smarterclayton commentedon May 9, 2015
Total, across all values
danmcp commentedon May 11, 2015
Any remaining issues here?
jstrachan commentedon May 14, 2015
I'm cool with annotating just the templates. What worries me is the 64k limit on annotations; that rules out lots of possible icons already; many PNG icons are over 30k before they get base64 encoded (and some are over 64k as binaries).
I'm thinking we need a place to store icons out of band from the annotations then we can just use links in the annotations. I guess anyone can plugin in a microservice to do this at any time (we did this months ago with our app library in fabric8) but I'd love to have some standard canonical way for a template author or installer to put them and to minimise the number of moving pieces
liggitt commentedon May 14, 2015
we could allow putting an actual network URL in the icon annotation (it's a URL already, just a
data:URL)... there were just implications we hadn't fully thought through, so we didn't enable that immediately:jstrachan commentedon May 14, 2015
@liggitt yeah, it feels like there should be a safe place we can put icons to avoid using remote URLs and so that it works nicely with OpenShift Routes so the URLs can be shared with browsers etc
5 remaining items
mfojtik commentedon May 18, 2015
@liggitt @jstrachan @smarterclayton so to summarize here what have to be done:
jstrachan commentedon May 18, 2015
@mfojtik agreed. For public open source projects we can just link to docs and images on github. Thats not going to work too well for private on premise projects though; which may be behind a proxy/firewall or even not have internet access.
jstrachan commentedon May 22, 2015
Incidentally the fabric8 maven fabric8:json goal now generates OpenShift templates with annotations for the documentation, summary and icon URL.
We default to using a data URL for icons which base64 encoded are less than 40K (its configurable how big is too big); then for larger icons it tries to link to github (by default) to provide an external URL and you can configure it to specify the absolute URL or prefix relative to the source code etc. Ideally I'd still love some place within OpenShift to put the icons; but I guess thats gonna take a while to figure out.
Then we've updated the hawtio-kubernetes console and the fabric8 console to query templates in a namespace and reuse any icons for a template on the apps, services, controllers and pods tabs.
So whenever the OpenShift console starts to reuse views from hawtio-kubernetes we'll get nice per-pod/service/controller/app icons which really helps users grok what pods are what.
jstrachan commentedon May 22, 2015
Am thinking we can close this issue now; thanks for all the feedback!
jstrachan commentedon Jun 10, 2015
BTW we had to effectively disable the dataurls for fabric8 due to the 64k limit for OpenShift templates. The reason is we're composing various applications together into composite OpenShift templates which meant we needed to put multiple icons inside a single template (e.g. jenkins + nexus + gogs + sonarqube + gerrit in a CD template) and soon blew the 64k limit.
So right now - unfortunately - we're having to rely on external links to the icons; referencing them from github; otherwise templates and apps stop being able to be composed into a template.
mfojtik commentedon Jun 10, 2015
@liggitt ^^
liggitt commentedon Jun 10, 2015
Can you describe how you were adding multiple icons to a template? I thought the 64k limit was for the annotations on a particular object
liggitt commentedon Jun 10, 2015
Though I don't disagree that data: URI icons probably aren't what we want
jstrachan commentedon Jun 10, 2015
@liggitt we're combining various RCs and services, as I described, into a single template; each resource typically needs its own icon (e.g. jenkins, nexus, gogs, sonarqube et al). Hence the need for multiple icons per template
jstrachan commentedon Jun 10, 2015
FWIW here's the templates if you wanna play: http://fabric8.io/guide/fabric8OnOpenShift.html
liggitt commentedon Jun 10, 2015
Ok, looking at those examples, see a few issues:
HTML in a description will not be rendered correctly by OpenShift (to prevent XSS):
What is consuming the iconUrl annotations?
liggitt commentedon Jun 10, 2015
OpenShift would only show a single icon per template, in the "icon" annotation
jstrachan commentedon Jun 10, 2015
Right now the fabric8 console is using those icons to generate a nice UI; whether folks compose apps together into single templates or separate them:
http://fabric8.io/guide/console.html
its also implemented in the hawtio console for kubernetes too which hopefully one day will get integrated into the OpenShift console.
If you have 1 icon per template; then either
One of the nice things about templates is you can compose apps together into a single easy to install template.
e.g. the entire fabric8 Continuous Deployment environment is a single openshift template for easy install
I guess we could encourage users not to compose templates and just keep them really small; so a template only contains something that may have a different icon? Then just have lots and lots of templates. But that kinda breaks the 1 click deploy/run thing for composite apps.
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…