Chapter 2. Installing and deploying AMQ Broker on OpenShift Container Platform
2.1. Installing AMQ Broker on OpenShift Container Platform image streams and application templates
The AMQ Broker on OpenShift Container Platform images are not available in the service catalog. You must manually install them by using the procedures in this section.
Procedure
Log in to OpenShift as a cluster administrator (or as a user that has project administrator access to the global
openshift
project), for example:oc login -u system:admin
$ oc login -u system:admin
Copy to Clipboard Copied! At the command line, run the following commands to update the AMQ Broker on OpenShift Container Platform image stream in the
openshift
project:oc replace --force -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/72-1.2.GA/amq-broker-7-image-streams.yaml oc replace --force -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/72-1.2.GA/amq-broker-7-scaledown-controller-image-streams.yaml oc import-image amq-broker-72-openshift:1.2 oc import-image amq-broker-72-scaledown-controller-openshift:1.0
$ oc replace --force -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/72-1.2.GA/amq-broker-7-image-streams.yaml $ oc replace --force -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/72-1.2.GA/amq-broker-7-scaledown-controller-image-streams.yaml $ oc import-image amq-broker-72-openshift:1.2 $ oc import-image amq-broker-72-scaledown-controller-openshift:1.0
Copy to Clipboard Copied! NoteAMQ Broker on OpenShift Container Platform leverages StatefulSets and Deployments resources for use with the
*-persistence
templates. These are Kubernetes-native resources that can consume image streams only from a local namespace, not the sharedopenshift
namespace. This is because the image streams must be created in the same namespace where the template will be instantiated. Also,-n openshift
is an optional parameter to use if you need to create a template in the shared namespace.Run the following command to update the AMQ Broker templates. Using the
--force
option with theoc replace
command creates or updates the resourcesfor template in amq-broker-72-basic.yaml \ amq-broker-72-ssl.yaml \ amq-broker-72-custom.yaml \ amq-broker-72-persistence.yaml \ amq-broker-72-persistence-ssl.yaml \ amq-broker-72-persistence-clustered.yaml \ amq-broker-72-persistence-clustered-ssl.yaml;
$ for template in amq-broker-72-basic.yaml \ amq-broker-72-ssl.yaml \ amq-broker-72-custom.yaml \ amq-broker-72-persistence.yaml \ amq-broker-72-persistence-ssl.yaml \ amq-broker-72-persistence-clustered.yaml \ amq-broker-72-persistence-clustered-ssl.yaml; do oc replace --force -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/72-1.2.GA/templates/${template} done
Copy to Clipboard Copied!
2.2. Deploying AMQ Broker on OpenShift Container Platform image
The AMQ Broker on OpenShift Container Platform image requires a service account for deployments. Service accounts are API objects that exist within each project. Three service accounts are created automatically in every project:
-
builder
: This service account is used by build pods. It contains thesystem:image-builder
role from which you can push images to any image stream in the project using the internal Docker registry. -
deployer
: This service account is used by deployment pods. It contains thesystem:deployer
role from which you can view and modify replication controllers and pods in the project. -
default
: This service account is used to run all other pods unless you specify a different service account.
Service accounts can be created or deleted like any other API object. For multiple-node deployments, the service account must have the view
role enabled so the various pods in the cluster can be discovered and managed.
In addition, you must configure SSL to enable connections to AMQ Broker from outside of the OpenShift Container Platform instance. The type of discovery protocol that is used for discovering AMQ Broker mesh endpoints is JGroups with OpenShift.dns ping protocol.
Procedure
-
Add the
view
role to the service account:
oc policy add-role-to-user view -z default
$ oc policy add-role-to-user view -z default
Additional resources
- For more information on how to configure SSL, see Configuring SSL.