Project: Hazelcast Jet (App Definition and Development / Streaming & Messaging)
File: operator-openshift.md

title: Installation on Red Hat OpenShift description: Step-by-step guide to install Hazelcast Jet Enterprise Operator on Red Hat Openshift and deploying a sample job. id: version-4.5-operator-openshift original_id: operator-openshift is a hybrid cloud, enterprise Kubernetes application platform from RedHat. , an open cloud marketplace that enables discovery and access to a certified software which is available to deploy on any Red Hat OpenShift cluster. [Hazelcast Jet Enterprise](https://marketplace.redhat.com/en-us/products/hazelcast-jet) is available to you on Red Hat Marketplace as a Certified Enterprise Ready Software. A running OpenShift cluster with administration rights. Hazelcast Jet Enterprise operator needs to be installed to create and manage Hazelcast Jet Enterprise clusters. To install the operator, navigate to the OperatorHub page under Operators section in the Administrator view. Find the `Hazelcast Jet Enterprise Operator` in the catalog either by scrolling down or you can filter by typing in `jet` Click to `Hazelcast Jet Enterprise Operator` card to continue the installation process. Hazelcast Jet Enterprise Operator Install Screen Click to `Install` button. When clicked you'd see a screen with various configuration options regarding the installation. Hazelcast Jet Enterprise Operator can be installed to a specific namespace and operates only in that namespace. It cannot respond to requests from any other namespace. Hazelcast Jet Enterprise Operator can be installed to all namespaces and operates Hazelcast Jet Enterprise clusters in any namespace on the cluster. In this mode, operator will be installed to `openshift-operators` namespace, but it will listen for changes in all namespaces. After you've selected the installation mode, then click to `Subscribe` button, it will create necessary resources to make the operator work properly. You should be able to see `Hazelcast Jet Enterprise` operator in the `Installed Operators` section under `Operators` menu. Note: In this example we choose to install the operator to all namespaces so it's installed in the `openshift-operators` namespace. Let's switch to the `Developer` view and follow the instructions below to create a Hazelcast Jet Enterprise cluster. You'll need a license key to start a Hazelcast Jet Enterprise cluster. To pass the license key to the cluster to be started, we need to create a `Secret` object which holds our license key. To create a License Key Secret, click to `Add` link from left menu then click `From YAML` card. ```yaml apiVersion: v1 kind: Secret metadata: name: jet-license-key-secret stringData: key: YOURLICENSEKEY ``` Paste the YAML content above with your License Key replaced to the editor on the screen like below and click `Create`

Alternatively, if you do have an access to the `oc` command line utility, you can run the command below: ```bash oc create secret generic jet-license-key-secret --from-literal=key=your-license-key ``` Click to `Add` from left menu then click `From Catalog` card. Find the `Hazelcast Jet Enterprise` in the catalog either by scrolling down or you can filter items by typing in `jet` Click to `Hazelcast Jet Enterprise` card, then click to `Create` button on the new section. It will show a YAML editor like below, you can configure the Hazelcast Jet Enterprise cluster here. Default configuration will create a 2 node cluster. You can use [this file](https://github.com/hazelcast/hazelcast-jet-operator/blob/master/hazelcast-jet-enterprise-operator/hazelcast-jet-enterprise-full.yaml) for configuration options reference. Click to `Create` button at the bottom to create the cluster. Note that we are passing in the name of secret which we created earlier that holds our license key information in the `jet.licenseKeySecretName` property. You should be able to see the cluster has been created like below: If you navigate to the `Topology` view from the left menu, you can see that Hazelcast Jet Enterprise and Hazelcast Jet Management Center deployment/statefulsets has been created by Hazelcast Jet Enterprise Operator. Navigate to the `Topology` view and click to the resource which has the `hazelcast-jet-enterprise` suffix. It will show a section on the right which shows the details of that resource like below: Then click to `View logs` link to see the logs of corresponding pod. As you can verify from the logs that we do have a 2 node Hazelcast Jet Enterprise cluster formed successfully. Navigate to the `Topology` view and click to the resource which has the `hazelcast-jet-enterprise-management-center` suffix. It will show a section on the right which shows the details of that resource like below: Then click to `View logs` link to see the logs of corresponding pod. Hazelcast Jet Management Center Logs As you can verify from the logs that we do have a 2 node Hazelcast Jet Enterprise cluster and Management Center application connected to it successfully. To access this cluster inside Openshift environment from outside, we need do port forwarding. Port forwarding makes a port of a pod in the remote Kubernetes cluster available to the local environment. To submit a job, we'll make port forwarding from a Hazelcast Jet Enterprise pod on port 5701 to local port 5701. The command requires to use a pod name to be forwarded. We will retrieve the pod name from the `Topology` view. Click to the `jet-hazelcast-jet-enterprise` stateful set, a new panel will be shown on the right side. You can use any pods listed in the `Pods`

If you've installed operator into a specific namespace, switch to that namespace first with the following: ```bash $ oc project my-namespace Now using project "my-namespace" on server "XXXXXX" ``` Run the command below with to make port forwarding happen: ```bash $ oc port-forward pods/jet-hazelcast-jet-enterprise-0 5701:5701 Forwarding from 127.0.0.1:5701 -> 5701 Forwarding from [::1]:5701 -> 5701 ... ``` Download and unpack Hazelcast Jet distribution from [Jet Website](https://jet-start.sh/) to use sample job packaged with it. In a different terminal window, unpack and navigate to the distribution folder with the commands below: ```bash tar xf hazelcast-jet-4.5.tar.gz cd hazelcast-jet-4.5/ ``` Verify that CLI can connect to the cluster with the command below: ```bash $ bin/jet cluster State: ACTIVE Version: 4.5 Size: 2 ADDRESS UUID ``` Then you can submit the example job from the distribution package with the command below: ```bash $ bin/jet submit examples/hello-world.jar Submitting JAR 'examples/hello-world.jar' with arguments [] Top 10 random numbers in the latest window: 8,898,539,899,168,029,424 7,720,861,389,917,424,780 7,625,232,857,233,015,099 6,777,278,758,369,921,301 6,265,041,662,117,114,223 6,181,674,658,021,839,025 5,639,320,479,621,760,652 5,251,546,821,760,470,933 4,544,929,439,891,010,872 4,513,471,017,811,828,408 ... ``` That's it, you've successfully deployed a job from your local machine to the Hazelcast Jet Enterprise cluster running inside Openshift environment. In the next section we'll show how to connect Hazelcast Jet Management Center to monitor and manage your jobs. Navigate to the `Topology` view and click to the resource which has the `hazelcast-jet-enterprise-management-center` suffix. It will show a section on the right which shows the details of that resource like below: Then click to `jet-hazelcast-jet-enterprise-management-center` link in the `Services` section to view the details of the service like below: Hazelcast Jet Management Center Service In the `Service Routing` section you can see the `LoadBalancer` location for the Hazelcast Jet Management Center service. Open your favorite browser and navigate to `http://<Location>:8081` to access Hazelcast Jet Management Center. You should see the login page at `http://<Location>:8081` like below and use `admin` as both username and password to login. Hazelcast Jet Management Center Login You can see various details regarding cluster and the job in the dashboard. Click to running job named `hello-world`, which we've submitted earlier, in the `Active Jobs` section to see the details of it. You can also see information regarding Hazelcast Jet Enterprise Cluster on the `Cluster` link in the side menu. You can stop the job when you are done with it. To stop the job we need to know it's name or id. List the jobs running in the cluster with the command below: ```bash $ bin/jet list-jobs ID STATUS SUBMISSION TIME NAME 045e-25d1-b680-0001 RUNNING 2020-05-18T14:47:04.595 hello-world ``` Then you can cancel it using either name or id of the job like following: ```bash $ bin/jet cancel hello-world Cancelling job id=045e-25d1-b680-0001, name=hello-world, submissionTime=2020-05-18T14:47:04.595 Job cancelled. ```