Add Kompose support
See original GitHub issueKompose is an awesome conversion tool which creates Kubernetes descriptor objects from Docker compose files.
The idea is to extend the fabric8:resource
goal to support Docker compose files via an external CLI call to kompose
. This should be possible to be switched on either explicitly by a configuration option <composeFile>
in the XML configuration or maybe even implicitly by monitoring a directory src/main/fabric8-kompose
for the content of some docker-compose.yml
files.
The flow would be:
- If enabled and present,
kompose
is called externally which creates Kubernetes resource descriptor yaml files in a build directory belowtarget/fabric8
. Configuration forkompose
comes from the plugin configuration. - These descriptors are read in by f-m-p via the kubernetes client
- The so instantiated
KubernetesList
is then used as starting point for the further processing:- Additional fragments can be added
- Information of the XML configuration can add to this list
- The enricher chain is fed with this list so that it can be enriched as usual.
An alternative approach would be to re-implement kompose functionality in Java which would provide a better integration (no external tool is required) but is much more work.
@jstrachan @pradeepto wdyt ? Is this a feasible plan ? Or do you see a better integration point ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
yeah, we should change fabric8-maven-plugin to also look in some canonical directory for generated fragments by other tools like kompose/kedge. Maybe something like
target/fabric8-generated
?@hrishin a few thoughts:
yes the enrichers should kick in unless the user disables them
Check the $PATH and fail if its not there? It might be worth running
kompose -v
or whatever to find the version and failing the build if the version number is too old?We could get the plugin to download on the fly and install the binary; we do this with the setup goal https://maven.fabric8.io/#fabric8:setup
So maybe if the binary is not found, we could recommend to the user they install it by hand and add it to $PATH (maybe with a download URL) - we could add the binary to those installed by
mvn fabric8:setup
?