1

I am new to openshift and was going through the interactive tutorialat https://learn.openshift.com/middleware/fis-deploy-app/.

This tutorial uses the source code from https://github.com/jbossdemocentral/katacoda-fuse-getting-started.git and builds the docker image and deploys the app to openshift environment.

I tempalte file mentioned in the tutorial defines the "Routes,Services,BuildConfig, etc" thats required for the deployment. However I could see them defined in /src/main/fabric folder too.

It looks like the fabric folder is not used in the build process. The Route,services,etc created/shown in Openshift console matches the template file.

Can someone clarify whats the use of fabric8 folder and the files inside? I am assuming there should be another way to create the app that takes the configurations from fabric8 - is this correct? Should template file refer to the configs in fabric8?

Can you share some good example which deploys the application into openshift using fabric8?

Basically I have springboot application in my local and trying to figure out the best deployment approach.

Thanks.

kenorb
  • 155,785
  • 88
  • 678
  • 743
jack
  • 803
  • 3
  • 15
  • 26

1 Answers1

1

/src/main/fabric8 folder is only used by fabric8. Files in this folder are called "resource fragments", in which you can customize kubernetes resource definiton. For example, this resource fragment enriches default fabric8 deployment with custom volumes, environment variables and service account.

The following configuration in pom.xml is required to deploy application into openshift using fabric8 maven plugin.

<properties>
    <fabric8.mode>openshift</fabric8.mode>
    <!-- Modify this configration as your openshift project name -->
    <fabric8.namespace>THE_OPENSHIFT_PROJECT_TO_DEPLOY</fabric8.namespace>
</properties>

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

Then, run mvn fabric8:deploy to deploy packaged jar file.

For more details, please refer to fabric8 maven plugin.

ccshih
  • 1,190
  • 3
  • 17
  • 25
  • I got fabric8 maven plugin in local machine. Should fabric8 be installed on top of openshift ? Am connecting to openshift env remotely. – jack May 16 '18 at 02:36
  • You dont need fabric8 on OpenShift. You can connect directly. Before that run `oc login ` – Hrishikesh May 25 '18 at 09:28