Git Product home page Git Product logo

openshift-mqtt-mosquitto's Introduction

OpenShift-MQTT-Mosquitto

Run Mosquitto MQTT Broker on Red Hat OpenShift

To Use

$ oc create -f mosquitto.yaml
configmap/mosquitto-config created
deployment.apps/mosquitto created
service/mosquitto created

This will start up the toke/mosquitto Docker container, with just port 1883 open. You can modify the Deployment part of the mosquitto.yam manifest file to include SSL support (you will need to add your SSL certs to the mosquitto.conf and mosquitto.acl parts of the ConfigMap.)

To connect to the Mosquitto Broker, you will need to know the 'External-IP' address and port:

$ oc get svc
NAME        TYPE           CLUSTER-IP    EXTERNAL-IP                 PORT(S)          AGE
mosquitto   LoadBalancer   172.30.5.13   172.29.175.9,172.29.175.9   1883:32342/TCP   3m

In this case, it is 172.29.175.9:32342. If you do not have MQTT clients that can specify a port besides 1883, you will want to do an 'oc port-forward' command like so:

$ oc port-forward mosquitto-54dc8c9b8c-k4wk4 1883:1883
Forwarding from 127.0.0.1:1883 -> 1883
Forwarding from [::1]:1883 -> 1883

The 'mosquitto-54dc8c9b8c-k4wk4' being the name of the Pod. Keep in mind that this method bypasses the Service Load Balancer and goes straight to the pod.

When you want to connect to the Mosquitto broker, be sure to specify the port:

$ node node_modules/mqtt/mqtt.js pub -h $(minishift ip) -t "test/blatt" -m '{"test": "blatt"}' -p 32342 -v

More info at: https://bigredstack.com/run-mosquitto-mqtt-broker-on-red-hat-openshift/

openshift-mqtt-mosquitto's People

Contributors

john2exonets avatar bigredstack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.