== Fabric8

The Fabric8 extension can be used along with the Kubernetes extension to provide a tighter integration with the link:https://fabric8.io/guide/fabric8DevOps.html[Fabric8 Microservices Platform]

=== Additional Features
- Integration with link:https://fabric8.io/guide/cdelivery.html[Fabric8 CI/CID]
- Management of Secrets via link:https://fabric8.io/guide/secretAnnotations.html[Secret Annotations]
- Integration with Fabric8 Modules:
    - link:https://fabric8.io/guide/mavenPlugin.html[Fabric8 Maven Plugin]
    - link:https://fabric8.io/guide/fabric8DevOps.html[Microservices Platform]

=== Fabric8 Maven Plugin Integration With Cube

If you are using https://maven.fabric8.io/[fabric8-maven-plugin] to build images, generate resources and deploy your application to cluster, then you should use the same approach for integration testing using cube.

However there is way to build images and generate resources using `fabric8-maven-plugin` as a part of test execution.
If you enable `cube.fmp.build` property, cube will build image and generate resources for you by running embedded maven build as per options provided in
`arquillian.xml` using `mvn package fabric8:build fabric8:resource -Dfabric8.namespace=${namespace_configured_for_cube}`.

You can use following configuration options with kubernetes and openshift extension to enable fabric8 maven plugin build in test execution.

*Configuration Options*
[cols="2,1,1,3", options="header"]
|===
| Options                             | Type           | Env | Description
| cube.fmp.build | Bool (false) | Any | Whether to generate resources using fmp when running test from Maven or IDE
| cube.fmp.build.disable.for.mvn | Bool (false) | Any | Whether to generate resources using fmp only when running test from IDE, not from maven
| cube.fmp.pom.path  | String | Any | Path to pom.xml where fmp plugin configuration is present. Defaults to `pom.xml`
| cube.fmp.build.options  | String | Any | Parameters used to start up the JVM running Embedded Maven and can be used to supply additional options to Embedded Maven.
| cube.fmp.debug.output  | Bool (false) | Any | Whether to show debug output(-X) for generating resources using fabric8 maven plugin
| cube.fmp.logs  | Bool (true) | Any | Whether to show logs for generating resources using fabric8 maven plugin
| cube.fmp.profiles  | List | Any | Comma-separated list of profiles which you want to activate while generating resources
| cube.fmp.system.properties  | List | Any | Comma-separated key value pair to use for maven build
|===

*IMPORTANT*

-  Make sure you have fabric8-maven-plugin dependency in plugin section.
```xml
<build>
    <plugins>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-maven-plugin</artifactId>
        <version>${version.fabric8.maven.plugin}</version>
      </plugin>
    </plugins>
  </build>
```
- If you have multiple profiles defined in your pom.xml, you can enable profile in which you have
fabric8-maven-plugin dependency by using `cube.fmp.profiles` in arquillian.xml.

You can see the example using `fabric8-maven-plugin` at: https://github.com/arquillian/arquillian-cube/tree/main/openshift/ftest-openshift-fabric8-maven-plugin
