This project shows how to develop an application using Red Hat Fuse on Karaf. Both OpenShift based and standard deployments are supported. This project shows how to build applications with database access using the integrated postgreSQL database of the OpenShift platform.
First install MiniShift on your computer for your platform
-
Start minishift with the following parameters
minishift profile set redhatfuse minishift config set memory 8GB minishift config set cpus 4 minishift config set image-caching true minishift config set disk-size 50g minishift start
-
You can stop and start minishift Installation:
minishift stop
minishift start
It is required to install the current Red Hat Fuse templates first
-
Login as system admin and create the Red Hat Fuse 7.2 templates
oc login -u system:admin BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.fuse-720018-redhat-00001 oc create -n openshift -f ${BASEURL}/fis-image-streams.json oc create -n openshift -f https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.fuse-720018-redhat-00001/fis-console-namespace-template.json oc create -n openshift -f ${BASEURL}/fuse-apicurito.yml
The postgresql database is used by the crm demo application to persist the data for both the standalone and OpenShift version. To install the database the following steps are required:
-
Start the postgresql database by applying the postgesql tempate provided by OpenShift
oc new-app postgresql-persistent -p POSTGRESQL_USER=admin -p POSTGRESQL_PASSWORD=admin
-
Open the postgresql service port to connect to from outside minishift
-
First get thename of the created postgresql pod by typing
oc get pods
-
Now create a port forward by typing
oc port-forward [name of postgesql pod] 5432:5432
-
-
Connect to the postgresql using a postgresql client (PGAdmin)
- Host: localhost, User: admin, Password: admin, database: sampledb
-
Run the following database script to create the database
-
Optional with the following step the Red Hat Fuse console can be installed.
oc new-app fuse70-console
-
Build the application using maven (project root)
mvn clean install
-
Download and start Red Hat Fuse 7.2
-
On the Fuse console install the features (be aware that postgesql must be running)
features:addurl mvn:ch.adesso/crm-features/1.0.0-SNAPSHOT/xml/features features:install crm-standalone
-
Be aware that the fuse templates for openshift must be installed
-
Build the application using maven (project root)
mvn clean install
-
Deploy the application (project crm-os-starter)
cd crm-os-starter mvn clean fabric8:deploy
-
To undeploy the application:
mvn clean fabric8:undeploy
You can add Jenkins to openshift to build and deploy the project with jenkins
-
To add jenkins use the following command
oc new-app -e JENKINS_PASSWORD=admin openshift/jenkins-2-centos7
-
Create a route to access jenkins
You can login into jenkins with admin/admin
To support the fabric8 deploy add the admin role to myproject
oc adm policy add-role-to-user admin system:serviceaccount:myproject:default
minishift ssh -> Windows putty [email protected] Password: tcuser
sudo -i
mkdir /opt/certs
chmod 777 /opt/certs
oc login -u systemå:admin
oc project myproject
oc create -f certspv.yaml
oc create -f certspvc.yaml
scp *.jks [email protected]:/opt/certs -> Windows pscp
Password: tcuser
oc get templates
oc process --parameters -n openshift fuse72-console