Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Fabric8 Maven Plugin in Integration #836

Merged
merged 1 commit into from
Oct 10, 2017

Conversation

piyush-garg
Copy link
Contributor

Changes for #732

  • added fabric8-maven-plugin kompose integration links and basic description

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please email the CNCF helpdesk: [email protected]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 4, 2017
@surajnarwade
Copy link
Contributor

hey @piyush1594 , you have to sign CLA first


### Fabric8 Maven Plugin by Red Hat

__Description:__ "To bring docker-compose based JAVA application to Kubernetes/Openshift Cluster using Maven Plugin"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 'Java' instead of 'JAVA'. It is a registered trademark.

@cdrage
Copy link
Member

cdrage commented Oct 4, 2017

@piyush1594 Ideally it would be nice to add a longer description (paragraph length) as well as quick tutorial on how to use this. Since ideally, this would be one of the "top" integrations for Kompose that's most widely used.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 5, 2017
Copy link
Member

@cdrage cdrage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey all!

Good work so far.

I'm pretty straight-forward when doing reviews, but please elaborate on the installation instructions. Was difficult to understand from someone who has never used Maven or Fabric8 before, and that's what most of our users will be experiencing too.

I've gone ahead and made comments!


### Fabric8 Maven Plugin by Red Hat

__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."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Openshift -> OpenShift
Images -> images
There's an extra spec between or Openshift
A Docker Compose configuration is one of the methods to bring up deployments on a Kubernetes or OpenShift cluster
Fabric8-maven -> Fabric8 Maven Plugin
The Fabric8-maven plugin processes the external docker-compose.yaml file and generates Kubernetes or OpenSHift resources via Kompose.

Please separate sentences too, it's quite long. Markdown doesn't cut-off sentences if there is a newline.

__Links:__

* [Quickstart](https://kompose.io/maven-example/)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove newline

# Fabric8 Maven Plugin + Kompose:

Lets deploy a Springboot Java application with Docker Compose file using fabric8 maven plugin to Kubernetes/Openshift.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add a "requirements" section.
ex:
Required:

  • Linux/macOS/Windows (or whatever platform Maven runs on)
  • Kompose
  • etc..

Figure out the requirements.

Also have installation instructions for maven (just a link would do).

Try to make it so that if someone has NO IDEA how to use Maven / Fabric8, they can easily follow this tutorial (example: me)


__1. Clone the example project from github__
```bash
$ git clone https://github.com/piyush1594/Kompose-Example.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, but would be better having Kompose-Example lowercase, could you change the name of your repo?


Lets deploy a Springboot Java application with Docker Compose file using fabric8 maven plugin to Kubernetes/Openshift.

__1. Clone the example project from github__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub needs to be capitalized

```
$ mvn fabric8:install
```
This command installs the `kompose` and other binaries on the host.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what other binaries? link?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this command: mvn fabric8:install has no description... What are we doing here? I believe the sentence "This command installs.." should be above it. Also needs to be changed to "This command installs Fabric8 and Kompose" or something similar.

This command installs the `kompose` and other binaries on the host.


__3. Add the fabric8 maven plugin to project__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fabric8 needs to be capitalized?

```
$ mvn io.fabric8:fabric8-maven-plugin:3.5.28:setup
```
This command adds the fabric8 maven plugin to `pom.xml` of project.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to start sentences with "This command".

You can simply say: "Add the Fabric8 maven plugin to the pom.xml of the project.

Speaking of pom.xml, as someone who has never used Maven, can you describe what this does? Need to elaborate on the instructions.


__5. Deploy application on Kubernetes/OpenShift__

Make sure that Kubernetes/OpenShift cluster or Minikube/MiniShift is running.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MiniShift is suppose to be minishift

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add instructions to "start" minishift or minikube.

$ mvn fabric8:deploy
```

Now that your service has been deployed, let's access it by querying `pod`, `service` from Kubernetes/OpenShift.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the instructions on how to access it?


__Links:__

* [Quickstart](https://kompose.io/maven-example/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change link to /docs/maven-example

@piyush-garg
Copy link
Contributor Author

@cdrage updated integrations.md and maven-example.md

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 6, 2017
### Fabric8 Maven Plugin by Red Hat

__Description:__ "Maven is one of the widely used build tool for Java applications. The Fabric8 Maven Plugin is a maven extension that simplifies the deployment of Java applications to Kubernetes or OpenShift cluster. The main task of this plugin is to build Docker images, generate Kubernetes or OpenShift resource descriptors and run/deploy the application on Kubernetes or OpenShift cluster. Plugin has wide range of configuration options and Docker Compose is one of them to bring up deployments on Kubernetes or OpenShift cluster. The Fabric8 Maven Plugin processes the external `docker-compose.yml` file and generates Kubernetes or OpenShift resources via Kompose."
__Links:__
Copy link
Contributor

@surajnarwade surajnarwade Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add blank line before __link:__


* [Quickstart](/docs/maven-example)

* [Documentation](https://maven.fabric8.io/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be better if you point towards part of maven docs where kompose is being used.
like, https://maven.fabric8.io/#fabric8:resource


Now that your service has been deployed, let's access it by querying `pod`, `service` from Kubernetes or OpenShift.
```bash
$ kubectl get pods
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show output of these commands as well

$ kubectl get pods
```
```bash
$ kubectl get svc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, show output of command

```bash
$ kubectl get svc
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra line


__1. Clone the example project from GitHub__
```bash
$ git clone https://github.com/piyush1594/kompose-example.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name of repo kompose-maven-example will be good, I think

Lets 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+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openjdk installation link will be better here, https://openjdk.java.net/install/

```bash
$ git clone https://github.com/piyush1594/kompose-example.git
```
Navigate (cd) to `kompose-example` directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention command

$ cd kompose-example

@piyush-garg
Copy link
Contributor Author

@surajnarwade @cdrage Updates done.

Copy link
Member

@cdrage cdrage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs improvement on how to use Maven.. Add tutorial on how to use Maven + Kompose from a total beginners perspective.

$ kubectl get pods
NAME READY STATUS RESTARTS AGE
springboot-docker-compose-1-vk80j 1/1 Running 0 5m
springboot-docker-compose-s2i-1-build 0/1 Completed 0 7m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still hasn't completed? 0/1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add instructions on how to actually access these services.

hint: minikube service sprintboot would possibly bring it up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its s2i-1-build pod as I have observed numerous time shows readiness like this only
But status column shows Completed

May be we can remove the build pod entry or give the hint: minikube service sprintboot

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay.

No. It wouldn't be wise to remove an entry or else people would be wondering what in the world it this other container.

Yes, adding an instruction on how to access via minikube service would be wise!


### Fabric8 Maven Plugin by Red Hat

__Description:__ "Maven is one of the widely used build tool for Java applications. The Fabric8 Maven Plugin is a maven extension that simplifies the deployment of Java applications to Kubernetes or OpenShift cluster. The main task of this plugin is to build Docker images, generate Kubernetes or OpenShift resource descriptors and run/deploy the application on Kubernetes or OpenShift cluster. Plugin has wide range of configuration options and Docker Compose is one of them to bring up deployments on Kubernetes or OpenShift cluster. The Fabric8 Maven Plugin processes the external `docker-compose.yml` file and generates Kubernetes or OpenShift resources via Kompose."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, please separate this into different sentences... add some newlines.

@@ -0,0 +1,74 @@
# Fabric8 Maven Plugin + Kompose:
Lets deploy a Springboot Java application with Docker Compose file using Fabric8 Maven Plugin to Kubernetes or OpenShift.
##### Requirements
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need newline

* Linux or MacOS or Windows
* JDK 1.7+ - [JDK Quick Installation Guide](https://openjdk.java.net/install/)
* Maven 3.x+ - [Maven Installation Guide](https://maven.apache.org/install.html)
* Kompose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no link to kompose

Copy link
Contributor Author

@piyush-garg piyush-garg Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really needed? as the tutorial is on Kompose website only.

Copy link
Member

@cdrage cdrage Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Other ones have links. May as well add one. It doesn't hurt.

@cdrage
Copy link
Member

cdrage commented Oct 6, 2017

can you add a WIP (work in progress) into your title since you're still working on this @piyush1594

@cdrage
Copy link
Member

cdrage commented Oct 6, 2017

you also need to merge your commits (one commit)

* JDK 1.7+ - [JDK Quick Installation Guide](https://openjdk.java.net/install/)
* Maven 3.x+ - [Maven Installation Guide](https://maven.apache.org/install.html)
* Kompose

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a previous step here saying that you must install Maven, here are the links to install to windows, etc. Add some commands here, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+* Maven 3.x+ - [Maven Installation Guide] here we have given the link for installation guide. Isn't it sufficient?
In that way it would stay consistent with Java installation link in the same section.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. 👍 Let's just keep it like this for-now.

$ cd kompose-maven-example
```
__2. Install Kompose through Maven__
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs some spacing here, try to always keep a newline between ``` and new headers.

```
$ mvn fabric8:install
```
This command installs the `kompose` and 'fabric8' on the host.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fabric8 should be

`fabric8`

```
This command installs the `kompose` and 'fabric8' on the host.

__3. Add Fabric8 Maven Plugin to project__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to your project

```
$ mvn io.fabric8:fabric8-maven-plugin:3.5.28:setup
```
Adds the Fabric8 Maven Plugin configuration to `pom.xml` of project. `pom.xml` is manifest or deployment descriptor file of maven project.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of a maven project

```
Adds the Fabric8 Maven Plugin configuration to `pom.xml` of project. `pom.xml` is manifest or deployment descriptor file of maven project.

__4. Configure Fabric8 Maven Plugin to use Docker Compose file__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to use a Docker Compose file

<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>

<!-- ... -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this?

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__
Make sure that Kubernetes/OpenShift cluster or Minikube/minishift is running. In case, if anything of this is not running, you can run Minikube to test this application by using following command.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be minishift

Make a newline here for separated sentences.

$ minikube start
```
Below command deploys this application on Kubernetes or OpenShift.
```bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, add some newlines between "```" and sentences

$ kubectl get svc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
springboot-docker-compose 172.30.205.137 <none> 8080/TCP 6m
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add a tutorial on how to actually access these... bringing up the web interface aka minikube service foobar or minishift openshift service foobar if a route has been made.

@piyush-garg piyush-garg changed the title Added Fabric8 Maven Plugin in Integration [WIP] Added Fabric8 Maven Plugin in Integration Oct 6, 2017
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 6, 2017
@piyush-garg
Copy link
Contributor Author

@cdrage done changes.

Created the new window in existing browser session.
```

It will open your application endpoint in default browser.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add screenshot of output screen ?


### Fabric8 Maven Plugin by Red Hat

__Description:__ "Maven is one of the widely used build tool for Java applications. The Fabric8 Maven Plugin is a maven extension that simplifies the deployment of Java applications to Kubernetes or OpenShift cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of the widely used build tools

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 9, 2017

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__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add blank line here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piyush1594 please fix this comment then LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cdrage I already fixed it in the last commit.

$ git clone https://github.com/piyush1594/kompose-maven-example.git
```

Change current directory to `kompose-maven-example` directory. Use command
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would better if we remove 'use command'

Fixed typo

Updated documents

Updated integrations.md and maven-example.md

Added output for commands and some minor updates

Added coomand to access service and minor updates

Fixed minor typing errors

Added screenshot of output

Added output image in image folder and minor typing errors

Fixed typo

Updated minor typos
@surajnarwade surajnarwade changed the title [WIP] Added Fabric8 Maven Plugin in Integration Added Fabric8 Maven Plugin in Integration Oct 10, 2017
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 10, 2017
@piyush-garg
Copy link
Contributor Author

@cdrage Review needed.

@cdrage
Copy link
Member

cdrage commented Oct 10, 2017

LGTM after minor comment fix.

@cdrage
Copy link
Member

cdrage commented Oct 10, 2017

LGTM.

@cdrage cdrage merged commit 903acfd into kubernetes:master Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants