<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrew Roberts</title>
    <description>The latest articles on DEV Community by Andrew Roberts (@ajr_dev).</description>
    <link>https://dev.to/ajr_dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F272577%2Fd7ce62b7-493f-4783-abe1-a577693de7fb.jpeg</url>
      <title>DEV Community: Andrew Roberts</title>
      <link>https://dev.to/ajr_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ajr_dev"/>
    <language>en</language>
    <item>
      <title>How to Deploy and Connect to a Solace PubSub+ Event Broker Using Minishift</title>
      <dc:creator>Andrew Roberts</dc:creator>
      <pubDate>Thu, 14 Nov 2019 17:18:20 +0000</pubDate>
      <link>https://dev.to/solacedevs/how-to-deploy-and-connect-to-a-solace-pubsub-event-broker-using-minishift-208e</link>
      <guid>https://dev.to/solacedevs/how-to-deploy-and-connect-to-a-solace-pubsub-event-broker-using-minishift-208e</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OZP-7Xls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/blog-featured-image-openshift.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OZP-7Xls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/blog-featured-image-openshift.jpg" alt=""&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The goal of this blog post is to give you a high-level overview of how to deploy Solace-powered event-driven applications using &lt;a href="https://github.com/minishift/minishift/releases"&gt;Minishift&lt;/a&gt;, a tool that lets you run an OpenShift 3.x cluster locally. By using Minishift, we’ll be able to develop OpenShift applications without spending the time required to set up a full-fledged development OpenShift cluster.&lt;/p&gt;

&lt;p&gt;While the example architecture we’ll walk through is not production grade, it demonstrates how to configure both internal and external access to event broker services in OpenShift. Whether you’re trying to deploy and connect event-driven applications in an isolated on-premises environment, or you’re trying to deploy and connect event-driven applications across public and private clouds, the fundamentals covered in this blog post should prove useful to you.&lt;/p&gt;

&lt;p&gt;If you follow along, you’ll learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run an OpenShift cluster locally&lt;/li&gt;
&lt;li&gt;Deploy a singleton Solace PubSub+ Event Broker into an OpenShift cluster&lt;/li&gt;
&lt;li&gt;Establish connectivity between pods in an OpenShift cluster&lt;/li&gt;
&lt;li&gt;Establish connectivity between a pod in an OpenShift cluster (in this case, a Solace PubSub+ Event Broker) and an external application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re reasonably familiar with OpenShift, you could skip this tutorial and check out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solace’s OpenShift template samples found &lt;a href="https://github.com/SolaceLabs/solace-openshift-examples"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Solace’s AWS OpenShift Quickstart found &lt;a href="https://github.com/SolaceProducts/solace-openshift-quickstart"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The templates used in this blog post should not be used in a production-grade environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;In this blog post, the first thing we’re going to do is get an OpenShift cluster running locally.  Then, we’ll deploy both a singleton Solace PubSub+ Event Broker and a Node.js Express server that serves a basic web application to the client’s server. And lastly, we’ll show how both the Express server and the external web application can connect to the Solace PubSub+ Event Broker.&lt;/p&gt;

&lt;p&gt;To get an OpenShift cluster running locally, we’ll be running Minishift with VirtualBox.&lt;/p&gt;

&lt;p&gt;Here’s a visual of what the end product will look like:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T_4aJBPb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find all the source code referenced in this blog post &lt;a href="https://github.com/andrew-j-roberts/openshift-blog-post-example/"&gt;on this GitHub page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, let’s start!&lt;/p&gt;
&lt;h2&gt;
  
  
  Run an OpenShift Cluster Locally
&lt;/h2&gt;

&lt;p&gt;In this section, we’ll walk through how to install Minishift and VirtualBox, and then how to start an OpenShift cluster using them together.&lt;/p&gt;

&lt;p&gt;OpenShift is a great technology, but unlike Docker it’s not something you can run natively on either a Mac or Windows computer.  This is because OpenShift is a Kubernetes application platform that is built on top of Red Hat Enterprise Linux.  If you want to test out OpenShift without paying for a dedicated test environment, you can use Minishift, “a tool that helps you run OpenShift locally by running a single-node OpenShift cluster inside a virtual machine (VM).”  Note that Minishift runs OpenShift 3.x clusters.  If you want to run OpenShift 4.x, there are other projects that you can use.  You can run Minishift’s virtual machine using the hypervisor of your choice, but for the purposes of this blog post we’ll use VirtualBox,  “a free and open-source hosted hypervisor for x86 virtualization, developed by Oracle.”&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install VirtualBox&lt;/strong&gt;
Follow the instructions on the &lt;a href="https://www.virtualbox.org/wiki/Downloads"&gt;Downloads – Oracle VM VirtualBox&lt;/a&gt; page to install VirtualBox.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install Minishift&lt;/strong&gt;
Follow the instructions on the &lt;a href="https://docs.okd.io/latest/minishift/getting-started/installing.html"&gt;Installing Minishift&lt;/a&gt;page to install Minishift.
If you’re using a Mac computer, I’d recommend &lt;a href="https://docs.okd.io/latest/minishift/getting-started/installing.html#installing-with-homebrew"&gt;installing Minishift using Homebrew&lt;/a&gt; Cask.
If you already have Minishift, you should create a new VM by using
&lt;code&gt;minishift delete&lt;/code&gt; and &lt;code&gt;minishift start --cpus 5 --memory 10GB&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start an OpenShift Cluster&lt;/strong&gt;
Once you have VirtualBox and Minishift installed, you can use this command to start a local OpenShift cluster:
&lt;code&gt;minishift start --vm-driver virtualbox --memory 9GB --cpus 5&lt;/code&gt;
Note that we set a couple flags in the command:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--vm-driver virtualbox&lt;/code&gt; tells Minishift how it can run the virtual machine&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--memory 9GB&lt;/code&gt; tells Minishift how much memory to dedicate to the virtual machine&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--cpus 5&lt;/code&gt; tells Minishift how many CPU cores to dedicate to the virtual machine&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wNCUtGFR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then it does some stuff…&lt;/p&gt;

&lt;p&gt;And if Minishift starts successfully (it should), Control–click (Windows) or Command-click (Mac) the URL that the command spits out:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-3.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hd7VlidS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-3.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you navigate to the link, you’ll see a screen that looks like this:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-4.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R4uqvHPW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-4.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you get here, log in using “solace” for both the username and password.  We’re not going to be covering how permissions work in OpenShift, so if you’d like to learn more about that, you can read more &lt;a href="https://docs.openshift.com/container-platform/3.9/admin_guide/manage_users.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You’ll see a screen that looks like this:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-5.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_dniGPEe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-5.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point, you’re ready to deploy some pods!&lt;/p&gt;
&lt;h2&gt;
  
  
  Deploy a PubSub+ Event Broker Using OpenShift
&lt;/h2&gt;

&lt;p&gt;In this section, we’ll walk through how to deploy a Solace PubSub+ Event Broker as a pod into the OpenShift cluster we just started.  The template we’ll be using is an ever-so-slightly modified version of what’s found on &lt;a href="https://github.com/SolaceLabs/solace-openshift-examples/blob/master/SampleTemplates/sol-single-ps%2B-persist-pod.yml"&gt;our sample templates repo&lt;/a&gt;. The modified version we’ll be using assigns a static NodePort to the NodePort service so that the port numbers in this blog post will match what you see locally.  The blog post explains what that means in a bit.&lt;/p&gt;

&lt;p&gt;If you haven’t already done so, &lt;a href="https://github.com/andrew-j-roberts/openshift-blog-post-example.git"&gt;download the source code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you’ve downloaded the source code, navigate to templates/solace-singleton-ps+-broker.yml and take a minute to read over everything there.  You’ll see that in the objects section of the template, three objects are being deployed: a pod, a cluster IP service, and a node port service.&lt;/p&gt;

&lt;p&gt;Here are the descriptions of these three objects in the OpenShift documentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.openshift.com/container-platform/3.3/architecture/core_concepts/pods_and_services.html#pods"&gt;Pod&lt;/a&gt;: OpenShift Enterprise leverages the Kubernetes concept of a pod, which is one or more &lt;a href="https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/containers_and_images.html#containers"&gt;containers&lt;/a&gt; deployed together on one host, and the smallest compute unit that can be defined, deployed, and managed.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.openshift.com/container-platform/3.3/architecture/core_concepts/pods_and_services.html#services"&gt;Cluster IP Service&lt;/a&gt;: A Kubernetes &lt;a href="http://kubernetes.io/docs/user-guide/services"&gt;service&lt;/a&gt; serves as an internal load balancer. The default service clusterIP addresses are from the OpenShift Container Platform internal network and they are used to permit pods to access each other.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.openshift.com/container-platform/3.6/dev_guide/expose_service/expose_internal_ip_nodeport.html#overview"&gt;NodePort Service&lt;/a&gt;: Use NodePorts &lt;a href="https://docs.openshift.com/container-platform/3.6/dev_guide/expose_service/index.html#getting-traffic-into-cluster-index"&gt;to expose the service&lt;/a&gt; nodePort on all nodes in the cluster. A node port exposes the service on a static port on the node IP address. NodePorts are in the 30000-32767 range by default, which means a NodePort is unlikely to match a service’s intended port (for example, 8080 may be exposed as 31020).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the architecture diagram didn’t make sense at first, look at it again now that you have read each object’s description.&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-6.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JgSkzUKe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-6.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hopefully by now you understand what this template is going to deploy, so let’s actually deploy it!  OpenShift makes this step very easy.&lt;/p&gt;

&lt;p&gt;First, create a project by clicking &lt;strong&gt;Create Project&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-7.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vEcHEBQ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-7.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you create your project, click &lt;strong&gt;Import YAML / JSON&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-8.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tBrHaH3---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-8.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then select the &lt;strong&gt;solace-singleton-ps+-broker.yml&lt;/strong&gt; file found in the source code.&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-9.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QZEeBl2r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-9.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt; in the bottom right and then &lt;strong&gt;Continue&lt;/strong&gt; in the nested popup.  Don’t worry about saving the template, only &lt;strong&gt;Process the template&lt;/strong&gt; has to be ticked for the purposes of this tutorial.&lt;/p&gt;

&lt;p&gt;After you click &lt;strong&gt;Continue&lt;/strong&gt; , you’ll see a screen like this:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-10.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---yvAt1IF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-10.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is where you can fill in the parameters that get interpolated into the template file.  For example, the POD_NAME parameter gets interpolated anywhere the ${POD_NAME} variable is found.  This can be useful for adding environment variables, connecting pods together, etc. Overall, it’s a handy tool for dynamically forming deployment templates.&lt;/p&gt;

&lt;p&gt;The default parameter values are just fine for deploying the Solace PubSub+ Event Broker, so click &lt;strong&gt;Create&lt;/strong&gt; and wait a couple seconds for the pod to deploy.&lt;/p&gt;

&lt;p&gt;If you click into the project and look at the &lt;strong&gt;Overview&lt;/strong&gt; tab, you should see a screen like this:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-11.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WxuTXQa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-11.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if you click &lt;strong&gt;Applications &amp;gt; Services&lt;/strong&gt; , you should see this:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-12.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jZtY2U72--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-12.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you see these objects in your console, congrats!  You’ve successfully deployed a Solace PubSub+ Event Broker using OpenShift.&lt;/p&gt;

&lt;p&gt;Now, let’s deploy the Node.js express server pod and services that will connect to our broker.&lt;/p&gt;
&lt;h2&gt;
  
  
  Deploy and Connect a Node.js Application Pod
&lt;/h2&gt;

&lt;p&gt;In this section, we’ll walk through how to deploy a Node.js Express server as a pod into the OpenShift cluster, and then we’ll show how it can connect to the services we created for our Solace PubSub+ Event Broker.&lt;/p&gt;

&lt;p&gt;Follow the same steps from the previous section except this time import the solace-simple-application.yml file found in the templates directory of the source code.  This template will deploy both the Node.js application pod and a NodePort service that will allow us to reach the application externally.  In the case of this example, we’ll be connecting to the Solace PubSub+ Event Broker from our web browser.&lt;/p&gt;

&lt;p&gt;Pause after you click &lt;strong&gt;Process the template&lt;/strong&gt; and look at the parameters that this template expects.&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-13.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hy6sM4-B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-13.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SOLACE_VMR_POD_NAME and SOLACE_SMFWEB_PORT are the variables that we’ll be using to connect the application pod to our Solace PubSub+ Event Broker pod.  If you look inside the template under the pod object, you’ll find the following container environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;containers: - env: -  name: POD\_NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace -  name:"SOLACE\_CLUSTERIP\_SVC\_HOSTNAME" value:${SOLACE\_VMR\_POD\_NAME}-ci-svc.$(POD\_NAMESPACE).svc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here, we’re dynamically forming the host name that we’ll use to connect to the event broker.  When the default parameters are substituted into the template, it forms vmr-ci-svc.testing.svc and will be accessible using the SOLACE_CLUSTERIP_SVC_HOSTNAME environment variable in our application.&lt;/p&gt;

&lt;p&gt;In the SolaceClient.js file of our application code, you’ll see how this environment variable is used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;solaceclient.connectionParams = { url: `ws://${process.env.SOLACE_CLUSTERIP_SVC_HOSTNAME}:${process.env.SOLACE_SMFWEB_PORT}`, vpnName: process.env.SOLACE\_VPN, userName: process.env.SOLACE\_USERNAME, password: process.env.SOLACE\_PASSWORD };
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here, we form the URL that the client will use to connect to the Solace PubSub+ Event Broker using both environment variables.  This host URL resolves to our Solace PubSub+ Event Broker pod within our cluster.&lt;/p&gt;

&lt;p&gt;When the application pod finishes deploying, you’ll see a message indicating whether it was able to connect to the Solace PubSub+ Event Broker. This is what it’ll look like if it successfully connects:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-14.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9buMsbJN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-14.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the message indicates, the pod connects to the Solace router using the internally exposed ClusterIP service. Using this pattern, you can create an entirely self-contained, event-driven OpenShift cluster. This might be useful for on-premises deployments of OpenShift.&lt;/p&gt;

&lt;p&gt;Along with the application, the template created another NodePort service that we can access from our web browsers.  You’ll see it here named solace-simple-app-np-svc:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-15.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LiQ_5O0g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-15.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you click on it for a detailed view of the NodePort service, you’ll see that the service is exposed on NodePort 30100, which we’ve defined statically in the template.&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-16.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5a2mPe1_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-16.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To access this service from our web browser, you’ll need to navigate to&lt;br&gt;&lt;br&gt;
&amp;lt;Minishift IP&amp;gt;:&amp;lt;App Service NodePort&amp;gt;&lt;/p&gt;

&lt;p&gt;A quick way to find your Minishift IP is to copy the IP address you’ve used to connect to the console.&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-17.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--usJ5rjqw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-17.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my case, I’d navigate to 192.168.99.110:30100&lt;/p&gt;

&lt;p&gt;This is what our example Web page looks like:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-18.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z-cKjjo7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-18.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an example app that demonstrates how a Web page might use Solace PubSub+ Event Broker to perform request and reply operations.  The only information you’ll need to change on this page to get started is the Solace router host URL.&lt;/p&gt;

&lt;p&gt;To access the Solace PubSub+ Event Broker externally, we’ll form and use a URL in a way similar to how we did to access our Web page’s landing page, but in this case, we’ll use the NodePort associated with the Solace router.  Since this application is a Web page, we’ll be using the NodePort for Web messaging, which allows communication using the WebSocket protocol.  For the purposes of this example, the template statically maps NodePort 30200 to the corresponding container port that handles WebSocket channels (port 60080).&lt;/p&gt;

&lt;p&gt;Here’s how you’d find this information:&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-19.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YFEYaE65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-19.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, the full Solace router host URL will be &lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-ip.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MVsXeygz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-ip.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note the ws:// prefix, which indicates the protocol that the client will be using to communicate.&lt;/p&gt;

&lt;p&gt;After you plug in the Solace router host URL, click &lt;strong&gt;connect&lt;/strong&gt; , &lt;strong&gt;subscribe&lt;/strong&gt; , and &lt;strong&gt;send request&lt;/strong&gt; :&lt;br&gt;&lt;br&gt;
&lt;a href="https://solace.com/wp-content/uploads/2019/11/minishift-post_image-20.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r4hA9-q8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://solace.com/wp-content/uploads/2019/11/minishift-post_image-20.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your screen looks like the screenshot, your Web browser was able to communicate with the Solace router that you’re running in an OpenShift cluster using Minishift, which demonstrates how you’re able to establish external connectivity to your router.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you followed this tutorial from start to finish, you should have learned how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run an OpenShift cluster locally&lt;/li&gt;
&lt;li&gt;Deploy a singleton Solace PubSub+ Event Broker into an OpenShift cluster&lt;/li&gt;
&lt;li&gt;Establish connectivity between pods in an OpenShift cluster&lt;/li&gt;
&lt;li&gt;Establish connectivity between a pod in an OpenShift cluster and an external application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you found this tutorial useful! If you have any questions, please post them to &lt;a href="https://solace.community"&gt;Solace Developer Community&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://solace.com/blog/deploy-connect-pubsub-plus-event-broker-minishift/"&gt;How to Deploy and Connect to a Solace PubSub+ Event Broker Using Minishift&lt;/a&gt; appeared first on &lt;a href="https://solace.com"&gt;Solace&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>solace</category>
      <category>pubsub</category>
      <category>minishift</category>
      <category>redhat</category>
    </item>
  </channel>
</rss>
