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
__Description:__ "To bring docker-compose based Java application to Kubernetes/Openshift Cluster using Maven Plugin"
37
+
__Description:__ "The fabric8-maven-plugin is used to bring your Java applications onto Kubernetes or Openshift. The main task of this plugin is to build Docker Images and generate Kubernetes or Openshift resource descriptors. A docker-compose configuration is one of the method to bring up docker compose deployments on a Kubernetes/Openshift cluster. Fabric8-maven Plugin processes the external docker-compose file and generates Kubernetes/Openshift resources using Kompose."
This command adds the fabric8 maven plugin to `pom.xml` of project.
23
+
24
+
__4. Configure the fabric8 maven plugin to use Docker Compose file__
25
+
```
26
+
<plugin>
27
+
<groupId>io.fabric8</groupId>
28
+
<artifactId>fabric8-maven-plugin</artifactId>
29
+
30
+
<!-- ... -->
31
+
32
+
<configuration>
33
+
<composeFile>path for docker compose file</composeFile>
34
+
</configuration>
35
+
36
+
<executions>
37
+
<execution>
38
+
<goals>
39
+
<goal>resource</goal>
40
+
<goal>build</goal>
41
+
</goals>
42
+
</execution>
43
+
</executions>
44
+
</plugin>
45
+
```
46
+
Add the `<configuration>` and `<executions>` sections to `pom.xml` as shown in above `pom.xml` snippet. Update the `<composeFile>` to provide the relative path of Docker Compose file from `pom.xml`
47
+
48
+
__5. Deploy application on Kubernetes/OpenShift__
49
+
50
+
Make sure that Kubernetes/OpenShift cluster or Minikube/MiniShift is running.
51
+
52
+
```bash
53
+
$ mvn fabric8:deploy
54
+
```
55
+
56
+
Now that your service has been deployed, let's access it by querying `pod`, `service` from Kubernetes/OpenShift.
0 commit comments