Fixes typos (#1557)

* rebase

* undo commit to assets/**/*

* undo commit in script/test/*

* Apply suggestions from code review

Co-authored-by: AhmedGrati <48932084+AhmedGrati@users.noreply.github.com>

* removes webrick

---------

Co-authored-by: AhmedGrati <48932084+AhmedGrati@users.noreply.github.com>
This commit is contained in:
Patrick Rachford
2023-02-08 14:51:09 -05:00
committed by GitHub
co-authored by AhmedGrati
parent b3d4aec3ee
commit 35a430614f
18 changed files with 388 additions and 356 deletions
+24 -13
View File
@@ -2,45 +2,52 @@
layout: default
permalink: /maven-example/
title: Maven Example
redirect_from:
redirect_from:
- /docs/maven-example.md/
- /docs/maven-example/
---
# Fabric8 Maven Plugin + Kompose:
Let's deploy a Springboot Java application with Docker Compose file using Fabric8 Maven Plugin to Kubernetes or OpenShift.
##### Requirements
* Linux or MacOS or Windows
* JDK 1.7+ - [JDK Quick Installation Guide](http://openjdk.java.net/install/)
* Maven 3.x+ - [Maven Installation Guide](http://www.baeldung.com/install-maven-on-windows-linux-mac)
* Kompose - [Kompose Installation Guide](/docs/installation.md)
__1. Clone the example project from GitHub__
- Linux or MacOS or Windows
- JDK 1.7+ - [JDK Quick Installation Guide](http://openjdk.java.net/install/)
- Maven 3.x+ - [Maven Installation Guide](http://www.baeldung.com/install-maven-on-windows-linux-mac)
- Kompose - [Kompose Installation Guide](/docs/installation.md)
**1. Clone the example project from GitHub**
```bash
$ git clone https://github.com/piyush1594/kompose-maven-example.git
```
Change current directory to `kompose-maven-example` directory.
```bash
$ cd kompose-maven-example
```
__2. Add Fabric8 Maven Plugin to your project__
**2. Add Fabric8 Maven Plugin to your project**
```bash
$ mvn io.fabric8:fabric8-maven-plugin:3.5.28:setup
```
Add the Fabric8 Maven Plugin configuration to `pom.xml` of project. `pom.xml` is manifest or deployment descriptor file of a maven project.
__3. Install Kompose through Maven__
**3. Install Kompose through Maven**
```bash
$ mvn fabric8:install
```
This command installs the `kompose` on the host.
__4. Configure Fabric8 Maven Plugin to use a Docker Compose file__
**4. Configure Fabric8 Maven Plugin to use a Docker Compose file**
```bash
<plugin>
<groupId>io.fabric8</groupId>
@@ -61,19 +68,22 @@ __4. Configure Fabric8 Maven Plugin to use a Docker Compose file__
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`
__5. Deploy application on Kubernetes or OpenShift__
**5. Deploy application on Kubernetes or OpenShift**
Make sure that Kubernetes/OpenShift cluster or Minikube/Minishift is running. In case, if anything of this is not running, you can run Minishift to test this application by using the following command.
Make sure that Kubernetes/OpenShift cluster or Minikube/minishift is running. In case, if anything of this is not running, you can run minishift to test this application by using following command.
```bash
$ minishift start
```
Below command deploys this application on Kubernetes or OpenShift.
Below command deploys this application on Kubernetes or OpenShift.
```bash
$ mvn fabric8:deploy
$ mvn fabric8:deploy
```
Now that your service has been deployed, let's access it by querying `pod`, `service` from Kubernetes or OpenShift.
```bash
$ oc get pods
NAME READY STATUS RESTARTS AGE
@@ -88,6 +98,7 @@ springboot-docker-compose 172.30.205.137 <none> 8080/TCP 6m
```
Let's access the Springboot service.
```bash
$ minishift openshift service --in-browser springboot-docker-compose
Created the new window in existing browser session.