-
Notifications
You must be signed in to change notification settings - Fork 202
Add support for "runtime fragments" #932
Comments
I'm not yet sure of the difference between the new runtime stuff and non-runtime. e.g. if a If something is environment specific (such as location of a registry or a secret or whatnot) then its probably simpler to, say, use a Template or Helm Chart to add that level of environment specific parameterisation. One area missing though is there's no such thing as a Another missing area is when using TLS with certs we should not generate a Route; as we need a controller to do that stuff for us - but we can disable Maybe we need a way to specify template parameters in source code? e.g. if you want to store the dev / test / staging / prod values for template parameters we could maybe have some folder with environments inside so that e.g. if you have a few parameters for things like, where is keycloak, where is the database URL or whatnot (assuming we're not using kubernetes service discovery here) - we may have |
Instantiating OpenShift So, all in all, I'm for One goal imo is to keep I'm not yet very familiar with Helm charts, but would it make sense to put them into the artefacts, too and we process these on Another idea: We could introduce a special parameter syntax for the fragments (e.g. We could leave these parameters unprocessed in |
yeah - we used to instantiate templates in the mvn plugin; guess its not been used yet in 3.x. Or folks can apply them via e.g. here's a few templates we're making right now and applying them with AFAIK no OpenShift specific resources ever end up in the kubernetes.yml. I guess the kubernetes equivalent to a Template would be a Helm Chart which has similar parameterisation - though kinda better as it keeps track of previous parameter values when doing updates. e.g. you can upgrade a Chart to a new version without worrying about re-specifying previous parameter values. Another alternative could be - if its just about parameterising environment variables - to use a ConfigMap and have a way to override values in the ConfigMap on a per environment basis (or just assume a user will do that separately). On the helm front; am not sure we need to put the helm chart inside the jars since helm charts are a versioned distribution already (they are versioned tarballs of parameterized yamls with parameters and metadata etc). We could add a I guess if folks want parameterisation and wanna work with kubernetes and openshift then we should probably promote Helm Charts for the kubernetes case; they work really well for that. Though I guess we could maybe also generate a kubernetes-template.yml too which isn't usable via kubectl but could be processed via |
@ro14nd not sure this makes more contextual here, but it would be great to have |
@kameshsampath I saw this come up on IRC recently and never had chance to dive into the use case. So the Or is it just case of wanting to import a git repo into OpenShift as a pipeline? |
@jstrachan may am wrong understanding a bit here .. but what i was trying to know - how to create the build config objects via f8-m-p, though the phases are different my thought was around how-to, if f8:import does then let me give shot at it and see what it does and see what we might need |
so try use e.g. if its already in git then it just tries to create a BC to refer to the git repo: if its not in git then it first tries to do the project creation in, say, gogs. |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
@fabric8io/fmp-core-team should we pick up the discussion again ? After we have gained now some experiences over the years, I think the it's still valid, that there are two kinds of deployment configuration: One which is independent on the target platform where the application is deployed (like deployments, services, etc.) and some which are very specific of the final cluster where the application is deployed to (best example is the "namespace"). So, should the "namespace" part of the generated resource descriptors which are stored also in the jars and distributed via Maven or should it be specified somewhere else (these kind of runtime fragments, or in the configuration for 'fabric8:apply'). I think it should be separated. For other things like configmaps or secrets which differ from environment to environment its similar but not so clear. I really think that configmaps should be added only as templates to the generated resources, which are filled when applied. It's a larger, principal discussion in which direction f-m-p should go, so I don't expect a quick solution. |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
Since all generated resource objects end up in the artifact jars within
META-INF/fabric8
they have to be independent of any concrete cluster installation (i.e. the must not contain the value of certain namespaces or private registries)However, for
fabric8:apply
it make sense also to apply runtime specific objects which e.g. references also the namespace / project.For example, consider role bindings, which contains the namespace in their values.
Build configs and Image Stream are other examples which are platform specific. These are not used during
fabric8:apply
but forfabric8:build
and generated automatically. It would be nice if those could be enriched as well.So I suggest introducing an extra runtime fragments directory, parallel to
src/main/fabric8
. E.g. asrc/main/fabric8-rt
. This could contain e.g. the role bindings required and they would be enriched whenfabric8:apply
orfabric8:build
is called.@jstrachan wdyt? I believe this is a good solution to keep separate and we can even add more fanciness when we are doing the deployment. E.g. we can introduce pre-defined variables (like ${namespace} or ${registry} which we then can put into the spots needed.
The text was updated successfully, but these errors were encountered: