Install Fabric8 on OpenShift
Fabric8 apps have been packaged to make them easy to install on Kubernetes or OpenShift.
Install via the console
If you are already running the fabric8 console you can use it to install all the other Fabric8 apps and quickstarts. If you are not yet running the fabric8 console then try install it via the CLI below.
When you open the fabric8 console select the Apps
tab then click on the Run...
button (top right green butotn).
This will list all of the installed OpenShift Templates on your installation.
- To Run any of the installed templates just click the
Run
button (the green play button). - To install any new OpenShift Templates or
other Kubernetes resources just drag and drop the JSON file onto the
Apps
tab! - You can download the fabric8 templates 2.2.89 distribution
unzip and drag the JSON files you want to install onto the fabric8 console
and they should appear on the
Run...
page You can also install other OpenShift Templates or Kubernetes resources via the oc command line tool:
oc create -f jsonOrYamlFileOrUrl
Install via the CLI
These instructions assume that you have either
- Either setup the fabric8 Vagrant image or have a native OpenShift installation
- You have the local machine setup to talk to OpenShift
Setup domain
- setup the KUBERNETES_DOMAIN environment variable for the domain you are installing to. Usually this is a host name or domain name.
e.g. if you are using the fabric8 Vagrant image then use
export KUBERNETES_DOMAIN=vagrant.f8
Downloading all templates
Download and unzip the fabric8 templates 2.2.89 distribution.
e.g.
curl -o fabric8.zip http://repo1.maven.org/maven2/io/fabric8/devops/distro/distro/2.2.89/distro-2.2.89-templates.zip
unzip fabric8.zip
cd main
Once you have found the kubernetes.json
file for the app you wish to install type the following using the oc
command from OpenShift:
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f kubernetes.json | oc create -f -
For example to install the fabric8 console then type:
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f console-2.2.89.json | oc create -f -
Download templates individually
Or to install from the central repository then choose the commands below to suit the application you wish to install:
Console
Provides the base fabric8 console at the vagrant.f8
domain. On OpenShift run the following command:
export KUBERNETES_DOMAIN=vagrant.f8
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f \
http://repo1.maven.org/maven2/io/fabric8/devops/apps/console/2.2.84/console-2.2.84-kubernetes.json \
| oc create -f -
If you are using kubernetes run:
kubectl create -f http://central.maven.org/maven2/io/fabric8/apps/console-kubernetes/2.2.104/console-kubernetes-2.2.104-kubernetes.json
Then setup the OpenShift Routes
Management
Provides centralised Logging and Metrics
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f \
http://repo1.maven.org/maven2/io/fabric8/devops/packages/management/2.2.89/management-2.2.89-kubernetes.json \
| oc create -f -
Then setup the OpenShift Routes
Logging
Provides just the centralised Logging
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f \
http://repo1.maven.org/maven2/io/fabric8/devops/packages/logging/2.2.89/logging-2.2.89-kubernetes.json \
| oc create -f -
Then setup the OpenShift Routes
Metrics
Provides just the centralised Metrics
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f \
http://repo1.maven.org/maven2/io/fabric8/devops/packages/metrics/2.2.89/metrics-2.2.89-kubernetes.json \
| oc create -f -
Then setup the OpenShift Routes
iPaaS
Provides the fabric8 console and the Integration Platform As A Service
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f \
http://central.maven.org/maven2/io/fabric8/apps/ipaas/2.2.89/ipaas-2.2.89-kubernetes.json \
| oc create -f -
Then setup the OpenShift Routes
Continuous Delivery
Provides a Continuous Integration and Continuous Delivery system.
The complete Continuous Delivery installation.
oc process -v DOMAIN=$KUBERNETES_DOMAIN -f \
http://repo1.maven.org/maven2/io/fabric8/devops/packages/cd-pipeline/2.2.89/cd-pipeline-2.2.89-kubernetes.json \
| oc create -f -
Then setup the OpenShift Routes
Creating Routes
If you install via the command line then you will need to create the OpenShift Routes for any services you created. Note that this is done automatically if you create applications via the fabric8 console.
To do this use the mvn fabric8:create-routes goal.
Note that this command can be run in any folder; it doesn't need to be run from inside a maven project.
Before you start make sure you have setup your local machine have logged in and setup the environment variables etc.
If you have defined the $KUBERNETES_DOMAIN environment variable then you can use the following command:
mvn io.fabric8:fabric8-maven-plugin:2.2.89:create-routes
Otherwise you can be specific and specify the domain you wish to use:
mvn io.fabric8:fabric8-maven-plugin:2.2.89:create-routes -Dfabric8.domain=my.acme.com
You could then setup a wildcard DNS rule on *.$KUBERNETES_DOMAIN
to point to the IP address of your OpenShift
master or HAProxy installation. Or you could add custom entries to your /etc/hosts
file for each service.
If you are using the Vagrant image with Linux or OSX you already have wildcard DNS resoultion. For Windows you have to
add each new route to %WINDIR%\System32\drivers\etc\hosts
. E.g. if your IP address for the OpenShift
master/router is 172.28.128.4
(which it is for the fabric8 Vagrant image) then
add this to your hosts file to expose the routes as host names:
172.28.128.4 vagrant.f8 fabric8.vagrant.f8 docker-registry.vagrant.f8 gogs-http.vagrant.f8
172.28.128.4 gogs-ssh.vagrant.f8 nexus.vagrant.f8 jenkins.vagrant.f8 kibana.vagrant.f8
You should now be able to access the console at http://fabric8.vagrant.f8/