Install IBM Cloud Private 2.1
First, you will need to install IBM Cloud Private 2.1. Detailed instructions are here. Once you have it installed, then the steps will be:
- Create a persistent volume
- Install MQ with advanced options
- Validate with opening the MQ management UI
If IBM Cloud Private is already installed, make sure you have the Kubectl command line installed on your laptop/workstation so you can target any Kubernetes cloud you want. You can get the Kubectl command line here.
OK, letâs continueâŚ
Create Persistent Volume
To deploy IBM MQ-Dev, you need to create a persistent volume that uses the âReadWriteOnceâ (RWO) access mode. You can create the storage volume from the UI, and should ideally be created before the deployment.
To create the volume, log into IBM Cloud Private, and use the upper left menu to navigate to the Storage page
Once on the storage page, click âCreate PersistentVolumeâ
In this example, I created a 2GB NFS volume with âRead Write Onceâ access mode, and it will be retained if the pod is removed. If you are just trying things out, you can also create a HostPath volume, which uses local storage on whatever VM the pod happens to be deployed on.
The value of using a persistent volume is that even though this recipe only deploys a single MQ queue manager, you can still achieve a level of availability in that if the queue manager pod or the node itself were to fail, IBM Cloud Private automatically re-schedules the queue manager to another node.
You will soon see that the default volume size for the MQ deployment specified in the helm chart is 2GB, so if you need more, go ahead and create a larger volume first, then match the size in the installation configuration fields that you will see shortly.
Note: If you have set up Gluster, you can use storage classes to dynamically provision storage when the service is deployed…this can be a great time saver!
Get to the MQ Helm Chart
Next, install MQ itself. With IBM Cloud Private, you have 2 ways to install IBM MQ:
- IBM Cloud Privateâs Catalog UI
- From the command line using âHelmâ commands
For this example, we will use the catalog. However, if you want to use the command line, you can directly access the helm charts here: https://github.com/IBM/charts. Either path is fine, and as we both know, if you love kubectl and helm commands, then using the helm charts directly is a great option (you can get helm command line here)
For the UI path, open IBM Cloud Private, and navigate to the catalog.
Scroll until you see IBM MQ, or search from the top, and click to see the details.
As a general rule, most all services have important fields you need to fill in before you can properly install, and IBM MQ is no different.
From this details view, select the “Install” button at the bottom, then go to the next step.
Specify Advanced Settings
There are quite a few settings in the MQ install, but Iâll just highlight the ones you need to worry about.
Install Options 1 of 2:
In this first section you need to give your deployment a name, then accept the license, otherwise the deployment will fail.
Install Options 2 of 2:
There are 4 fields you should consider in this last section.
This is where you can customize how large you want your storage to be, but remember, it canât be bigger than the persistent volume you created earlier.
If you keep it âClusterIPâ, then only apps running inside the IBM Cloud Private cluster will be able to access the MQ service. However, if you change it to âNodePortâ, then you will be able to call the MQ service from anywhere in the network (your data center, or wherever your firewalls allow).
The name of the queue manager that your app will use.
The admin password. This is not required but useful…otherwise you’ll have to obtain the automatically generated password.
Deploy the MQ Helm Chart
Once you are ready (you have accepted the license, created your persistent volume, and filled in all the advanced installation details) click âInstallâ, and you are installing!
Depending on compute and storage speeds, it may take a few minutes to install, create default queues, and start the management UI. I tend to use the management UI URL (next step), and get frustrated when it says ânot foundâ, but just be patient. It will load up.
To monitor the progress, you have two options:
From the UI, click on âWorkloadsâ, select the MQ application (itâs actually a âdeploymentâ in Kubernetes terms), locate the pod and select it, then select the Logs tab.
From the command line: find the pod name and monitor its log:
kubectl get pods
kubectl logs <podname> -f
Start Using MQ
Once MQ is installed, you can start using MQ in two ways:
- As a developer through the API port
- As an operator through the console UI port
To find the ports, you also need to decide if you want to access MQ from a pod in the private cloud or from another environment in your data center. Remember the âNodePortâ setting I added in the installation? That lets you connect from both while you are developing (then later you can remove the NodePort and only use the internal endpoint.
I like to select NodePort because it is quite useful for developers that want to initially develop their code and run from an existing environment (or in a dev-focused cloud like Mini-Kube) where they can iterate very quickly, access the MQ service, and then once they are ready they can move their application inside IBM Cloud Private and use the internal endpoints.
To find which URLs to use, run the following to get the list of services:
kubectl get svc
Then once you identify the service name, run:
kubectl describe service <service Name>
Here is an example of what you will see: Â
Notice there are 2 sets of ports. MQ uses 1414 for the API, and 9443 for the web UI. Make sure you use the correct NodePort when accessing the UI.
For external access (through NodePort URL), fill in the following with one of your node IP addresses (any of your node IP addresses will doâŚI chose the proxy node IP address):
- Console:Â https://<publicIP>:31049/ibmmq/console Â
- Queue manager: <publicIP>(31935)
Once you see the login on the console, you can start with the default userID and password is âadmin/passw0rdâ
To start using MQ from an application, you will want to use the application user ID, not the admin user ID. The application user ID is “app” (with no default password). Click here to learn more and see examples.
IBM MQ can help you accelerate the integration of diverse applications and business data across multiple platforms. Using this recipe, you can quickly get IBM MQ running in IBM Cloud Private.
Good luck and happy MQâing!