Skip to content

raif-ahmed/fuse_on_OCP_7.x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Understand Fuse 7.x on OpenShift

Goals
  • Benefits of Fuse on OpenShift Benefits

  • Understand Administrating tasks for Fuse on OpenShift

  • Explaining how to start developing for Fuse on OpenShift

1. Benefits Fuse on OpenShift

  • Native integration with Docker, Kubernetes, OpenShift

  • Transparency in platform changes for developers

  • Self-service, scaling, CI/CD for administrators

  • Application runtime built for microservice deployments

overview

2. Administrators Tasks

The main administrating tasks will typically be

  • Installing Fuse imagestreams and templates on the OpenShift 4.x server

  • Set up the Fuse Console on OpenShift 4.x

  • Installing API Designer on OpenShift 4.x - (Apicurio) (Optional, through OperatorHub)

2.1. Installing Fuse imagestreams and templates on the OpenShift 4.x server

  • ImageStrams, is an OpenShift API object that represent Single virtual view of related images.

  • For Installing Fuse imagestreams and templates, You must have the administrator role for the OpenShift project.

    1. Type of Red Hat Fuse 7 images:

      1. fuse-karaf-openshift: Camel applications based on Karaf

      2. fuse-java-openshift: Camel applications based on standalone Java™ flat file or Spring Boot

      3. fuse-eap-openshift: Camel applications based on JBoss EAP

    2. Install Red Hat Fuse 7 images:

2.2. Setting up the Fuse Console on OpenShift 4.x

On OpenShift 4.x, you can choose one of these Fuse Console deployment options:

  1. cluster - The Fuse Console can discover and connect to Fuse applications deployed across multiple namespaces (projects) on the OpenShift cluster. To deploy this template, you must have the administrator role for the OpenShift cluster.

  2. namespace - The Fuse Console has access to a specific OpenShift project (namespace). To deploy this template, you must have the administrator role for the OpenShift project.

3. Getting Start for Developer

3.1. Maven Archetypes

Used to generate new project with required resources and POM dependencies

3.2. Archetype types

3.2.1. Karaf & Spring Boot 1.5

Example command to create project:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate \
  -DarchetypeCatalog=https://maven.repository.redhat.com/ga/io/fabric8/archetypes/archetypes-catalog/2.2.0.fuse-750020-redhat-00002/archetypes-catalog-2.2.195.redhat-000032-archetype-catalog.xml \
  -DarchetypeGroupId=org.jboss.fuse.fis.archetypes \
  -DarchetypeVersion=2.2.0.fuse-750020-redhat-00002 \
  -DarchetypeArtifactId=<archetype-name>
Table 1. Available Archetypes
Archetype Name Template Application Created

spring-boot-camel-archetype

Demonstrates how to use Apache Camel with Spring Boot based on a fabric8 Java base image.

spring-boot-camel-amq-archetype

Demonstrates how to connect a Spring Boot application to an ActiveMQ broker and use JMS messaging between two Camel routes using Kubernetes or OpenShift.

spring-boot-camel-config-archetype

Demonstrates how to configure a Spring Boot application using Kubernetes ConfigMaps and Secrets.

spring-boot-camel-drools-archetype

Demonstrates how to use Apache Camel to integrate a Spring Boot application running on Kubernetes or OpenShift with a remote Kie Server.

spring-boot-camel-infinispan-archetype

Demonstrates how to connect a Spring Boot application to a JBoss Data Grid or Infinispan server using the Hot Rod protocol.

spring-boot-camel-rest-3scale-archetype

Demonstrates how to use Camel’s REST DSL to expose a RESTful API and expose it to 3scale.

spring-boot-camel-rest-sql-archetype

Demonstrates how to use SQL via JDBC along with Camel’s REST DSL to expose a RESTful API.

spring-boot-camel-xa-archetype

Spring Boot, Camel and XA Transactions. This example demonstrates how to run a Camel Service on Spring Boot that supports XA transactions on two external transactional resources: a JMS resource (A-MQ) and a database (PostgreSQL). This quickstart requires the PostgreSQL database and the A-MQ broker have been deployed and running first, one simple way to run them is to use the templates provided in the Openshift service catalog

spring-boot-camel-xml-archetype

Demonstrates how to configure Camel routes in Spring Boot via a Blueprint configuration file.

spring-boot-cxf-jaxrs-archetype

Demonstrates how to use Apache CXF with Spring Boot based on a fabric8 Java base image. The quickstart uses Spring Boot to configure an application that includes a CXF JAXRS endpoint with Swagger enabled.

spring-boot-cxf-jaxws-archetype

Demonstrates how to use Apache CXF with Spring Boot based on a fabric8 Java base image. The quickstart uses Spring Boot to configure an application that includes a CXF JAXWS endpoint.

karaf2-cxf-rest-archetype

RESTful web service example using CXF

karaf2-camel-rest-sql-archetype

Camel example using REST DSL with SQL database

karaf2-camel-amq-archetype

ActiveMQ and Camel Example

karaf2-camel-log-archetype

Camel log example

3.2.2. Spring Boot 2

Tip

Example command to create project:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate \
  -DarchetypeCatalog=https://maven.repository.redhat.com/ga/io/fabric8/archetypes/archetypes-catalog/2.2.0.fuse-sb2-750011-redhat-00006/archetypes-catalog-2.2.0.fuse-sb2-750011-redhat-00006-archetype-catalog.xml \
  -DarchetypeGroupId=org.jboss.fuse.fis.archetypes \
  -DarchetypeVersion=2.2.0.fuse-sb2-750011-redhat-00006 \
  -DarchetypeArtifactId=<archetype-name>
Table 2. Available Archetypes
Archetype Name Template Application Created

spring-boot-camel-archetype

Demonstrates how to use Apache Camel with Spring Boot based on a fabric8 Java base image.

spring-boot-camel-amq-archetype

Demonstrates how to connect a Spring Boot application to an ActiveMQ broker and use JMS messaging between two Camel routes using Kubernetes or OpenShift.

spring-boot-camel-drools-archetype

Demonstrates how to use Apache Camel to integrate a Spring Boot application running on Kubernetes or OpenShift with a remote Kie Server.

spring-boot-camel-infinispan-archetype

Demonstrates how to connect a Spring Boot application to a JBoss Data Grid or Infinispan server using the Hot Rod protocol.

spring-boot-camel-rest-3scale-archetype

Demonstrates how to use Camel’s REST DSL to expose a RESTful API and expose it to 3s750029cale.

spring-boot-camel-rest-sql-archetype

Demonstrates how to use SQL via JDBC along with Camel’s REST DSL to expose a RESTful API.

spring-boot-camel-xml-archetype

Demonstrates how to configure Camel routes in Spring Boot via a Blueprint configuration file.

spring-boot-cxf-jaxrs-archetype

Demonstrates how to use Apache CXF with Spring Boot based on a fabric8 Java base image. The quickstart uses Spring Boot to configure an application that includes a CXF JAXRS endpoint with Swagger enabled.

spring-boot-cxf-jaxws-archetype

Demonstrates how to use Apache CXF with Spring Boot based on a fabric8 Java base image. The quickstart uses Spring Boot to configure an application that includes a CXF JAXWS endpoint.

3.2.3. Set Up Maven Archetype Catalog in JBoss Developer Studio/Code Ready

  1. From JBoss Developer Studio, select Preferences.

  2. Select Maven → Archetypes.

  3. Select Add Remote Catalog and complete the fields with these values:

  4. Catalog File: https://maven.repository.redhat.com/ga/io/fabric8/archetypes/archetypes-catalog/2.2.0.fuse-000092-redhat-2/archetypes-catalog-2.2.0.fuse-000092-redhat-2-archetype-catalog.xml

  5. Description: Fuse EA Archetypes

3.2.4. Packaging Process

packaging process

3.2.5. Deployment with S2I

s2i build
Workflow process for S2I Code Workflow
  1. Code pulled from Git repository, or from developer machine after compression, and copied onto S2I builder image

  2. S2I builder image pulled from registry into node where build takes place

  3. Maven build takes place, pulling required dependencies and generating application artifacts

  4. Docker image created, based on Red Hat Fuse S2I image and containing application artifacts

  5. Docker image pushed into OpenShift registry

  6. Container started on OpenShift node

Workflow process for S2I Binary Workflow

It is called binary because you Bypass Git repository, and do the build on your local machine and then push the generated binary directly to OpenShift

Table 3. S2I Binary Build Types
Build Type Build From Note

from-dir

Specified directory

oc start-build BUILDCONFIG --follow --from-dir=.

from-repo

Local Git repository

oc start-build BUILDCONFIG --follow --from-repo=.

from-file

Project JAR archive

oc start-build BUILDCONFIG --follow --from-file=.
Fabric8

fabric8 makes it easy to create Microservices, build, test and deploy them via Continuous Delivery pipelines then run and manage them with Continuous Improvement and ChatOps

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages