blob: d254436ece3f100d7b63025148213b54c09dda1c [file] [log] [blame]
<!DOCTYPE html>
<html lang="dev" class="js csstransforms3d">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Hugo 0.54.0" />
<meta name="description" content="A set of micro-services for connecting millions of devices.">
<meta name="author" content="The Eclipse Hono Project">
<link rel="apple-touch-icon" sizes="180x180" href="/hono/docs/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="48x48" href="/hono/docs/favicon/favicon-48x48.png">
<link rel="icon" type="image/png" sizes="32x32" href="/hono/docs/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/hono/docs/favicon/favicon-16x16.png">
<link rel="manifest" href="/hono/docs/favicon/site.webmanifest">
<link rel="mask-icon" href="/hono/docs/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/hono/docs/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/hono/docs/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<title>OpenShift / OKD :: Eclipse Hono&trade; Vers.: dev</title>
<link href="/hono/docs/css/nucleus.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/fontawesome-all.min.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/hybrid.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/featherlight.min.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/perfect-scrollbar.min.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/auto-complete.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/theme.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/hugo-theme.css?1568856207" rel="stylesheet">
<link href="/hono/docs/css/theme-hono.css?1568856207" rel="stylesheet">
<script src="/hono/docs/js/jquery-2.x.min.js?1568856207"></script>
<style type="text/css">
:root #header + #content > #left > #rlblock_left{
display:none !important;
}
:not(pre) > code + span.copy-to-clipboard {
display: none;
}
</style>
<link rel="stylesheet" href="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css">
<link rel="stylesheet" href='/hono/docs/css/hono.css'>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@EclipseHono">
<meta name="twitter:title" content="OpenShift / OKD :: Eclipse Hono&amp;trade; Vers.: dev">
<meta name="twitter:image" content="https://www.eclipse.org/hono/docs/images/twitter_image.png">
<meta name="twitter:description" content="A set of micro-services for connecting millions of devices.">
<meta property="og:title" content="OpenShift / OKD :: Eclipse Hono&amp;trade; Vers.: dev" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.eclipse.org/hono/docs/dev/deployment/openshift//" />
<meta property="og:image" content="https://www.eclipse.org/hono/docs/images/twitter_image.png" />
</head>
<body class="" data-url="/hono/docs/dev/deployment/openshift/">
<nav id="sidebar" class="">
<div id="header-wrapper">
<div id="header">
<a href="https://www.eclipse.org/hono">
<img src="/hono/docs/images/HONO-Logo_Bild-Wort_quer-w-310x120px.svg" alt="Hono logo" class="logo-img">
</a>
</div>
<div class="searchbox">
<label for="search-by"><i class="fas fa-search"></i></label>
<input data-search-input id="search-by" type="search" placeholder="Search...">
<span data-search-clear=""><i class="fas fa-times"></i></span>
</div>
<script type="text/javascript" src="/hono/docs/js/lunr.min.js?1568856207"></script>
<script type="text/javascript" src="/hono/docs/js/auto-complete.js?1568856207"></script>
<script type="text/javascript">
var baseurl = "https:\/\/www.eclipse.org\/hono\/docs\/\/dev";
</script>
<script type="text/javascript" src="/hono/docs/js/search.js?1568856207"></script>
</div>
<div class="highlightable">
<ul class="topics">
<li data-nav-id="/hono/docs/dev/concepts/" title="Concepts" class="dd-item
">
<a href="/hono/docs/dev/concepts/">
<i class="far fa-lightbulb"></i> Concepts
</a>
<ul>
<li data-nav-id="/hono/docs/dev/concepts/device-identity/" title="Device Identity" class="dd-item ">
<a href="/hono/docs/dev/concepts/device-identity/">
Device Identity
</a>
</li>
<li data-nav-id="/hono/docs/dev/concepts/tenancy/" title="Multi-Tenancy" class="dd-item ">
<a href="/hono/docs/dev/concepts/tenancy/">
Multi-Tenancy
</a>
</li>
<li data-nav-id="/hono/docs/dev/concepts/device-notifications/" title="Device Notifications" class="dd-item ">
<a href="/hono/docs/dev/concepts/device-notifications/">
Device Notifications
</a>
</li>
<li data-nav-id="/hono/docs/dev/concepts/command-and-control/" title="Command &amp; Control" class="dd-item ">
<a href="/hono/docs/dev/concepts/command-and-control/">
Command &amp; Control
</a>
</li>
<li data-nav-id="/hono/docs/dev/concepts/resource-limits/" title="Resource limits" class="dd-item ">
<a href="/hono/docs/dev/concepts/resource-limits/">
Resource limits
</a>
</li>
<li data-nav-id="/hono/docs/dev/concepts/connection-events/" title="Connection Events" class="dd-item ">
<a href="/hono/docs/dev/concepts/connection-events/">
Connection Events
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/dev/user-guide/" title="User Guide" class="dd-item
">
<a href="/hono/docs/dev/user-guide/">
<i class="fas fa-book-reader"></i> User Guide
</a>
<ul>
<li data-nav-id="/hono/docs/dev/user-guide/device-registry/" title="Device Registry" class="dd-item ">
<a href="/hono/docs/dev/user-guide/device-registry/">
Device Registry
</a>
</li>
<li data-nav-id="/hono/docs/dev/user-guide/http-adapter/" title="HTTP Adapter" class="dd-item ">
<a href="/hono/docs/dev/user-guide/http-adapter/">
HTTP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/dev/user-guide/mqtt-adapter/" title="MQTT Adapter" class="dd-item ">
<a href="/hono/docs/dev/user-guide/mqtt-adapter/">
MQTT Adapter
</a>
</li>
<li data-nav-id="/hono/docs/dev/user-guide/amqp-adapter/" title="AMQP Adapter" class="dd-item ">
<a href="/hono/docs/dev/user-guide/amqp-adapter/">
AMQP Adapter
</a>
</li>
<li data-nav-id="/hono/docs/dev/user-guide/kura-adapter/" title="Kura Adapter" class="dd-item ">
<a href="/hono/docs/dev/user-guide/kura-adapter/">
Kura Adapter
</a>
</li>
<li data-nav-id="/hono/docs/dev/user-guide/sigfox-adapter/" title="Sigfox Adapter" class="dd-item ">
<a href="/hono/docs/dev/user-guide/sigfox-adapter/">
Sigfox Adapter
</a>
</li>
<li data-nav-id="/hono/docs/dev/user-guide/jmeter_load_tests/" title="Load Tests with JMeter" class="dd-item ">
<a href="/hono/docs/dev/user-guide/jmeter_load_tests/">
Load Tests with JMeter
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/" title="Admin Guide" class="dd-item
">
<a href="/hono/docs/dev/admin-guide/">
<i class="fas fa-sliders-h"></i> Admin Guide
</a>
<ul>
<li data-nav-id="/hono/docs/dev/admin-guide/common-config/" title="Common Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/common-config/">
Common Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/auth-server-config/" title="Auth Server Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/auth-server-config/">
Auth Server Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/device-registry-config/" title="Device Registry Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/device-registry-config/">
Device Registry Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/device-connection-config/" title="Configuring the Device Connection Service" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/device-connection-config/">
Device Connection Service Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/http-adapter-config/" title="HTTP Adapter Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/http-adapter-config/">
HTTP Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/amqp-adapter-config/" title="AMQP Adapter Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/amqp-adapter-config/">
AMQP Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/mqtt-adapter-config/" title="MQTT Adapter Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/mqtt-adapter-config/">
MQTT Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/kura-adapter-config/" title="Kura Adapter Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/kura-adapter-config/">
Kura Adapter Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/hono-client-configuration/" title="Hono Client Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/hono-client-configuration/">
Hono Client Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/amqp-network-config/" title="AMQP 1.0 Messaging Network Configuration" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/amqp-network-config/">
AMQP 1.0 Messaging Network Configuration
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/secure_communication/" title="Secure Communication" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/secure_communication/">
Secure Communication
</a>
</li>
<li data-nav-id="/hono/docs/dev/admin-guide/monitoring-tracing-config/" title="Monitoring &amp; Tracing" class="dd-item ">
<a href="/hono/docs/dev/admin-guide/monitoring-tracing-config/">
Monitoring &amp; Tracing
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/dev/dev-guide/" title="Developer Guide" class="dd-item
">
<a href="/hono/docs/dev/dev-guide/">
<i class="fas fa-tools"></i> Developer Guide
</a>
<ul>
<li data-nav-id="/hono/docs/dev/dev-guide/building_hono/" title="Building from Source" class="dd-item ">
<a href="/hono/docs/dev/dev-guide/building_hono/">
Building from Source
</a>
</li>
<li data-nav-id="/hono/docs/dev/dev-guide/java_client_consumer/" title="Consuming Messages from Java" class="dd-item ">
<a href="/hono/docs/dev/dev-guide/java_client_consumer/">
Consuming Messages from Java
</a>
</li>
<li data-nav-id="/hono/docs/dev/dev-guide/custom_http_adapter/" title="Implement a Custom Hono HTTP Protocol Adapter" class="dd-item ">
<a href="/hono/docs/dev/dev-guide/custom_http_adapter/">
Implement a Custom Hono HTTP Protocol Adapter
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/dev/api/" title="API" class="dd-item
">
<a href="/hono/docs/dev/api/">
&nbsp;<i class='fas fa-plug'></i>&nbsp;API
</a>
<ul>
<li data-nav-id="/hono/docs/dev/api/telemetry/" title="Telemetry API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/telemetry/">
Telemetry API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/event/" title="Event API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/event/">
Event API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/command-and-control/" title="Command &amp; Control API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/command-and-control/">
Command &amp; Control API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/tenant/" title="Tenant API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/tenant/">
Tenant API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/device-connection/" title="Device Connection API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/device-connection/">
Device Connection API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/device-registration/" title="Device Registration API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/device-registration/">
Device Registration API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/credentials/" title="Credentials API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/credentials/">
Credentials API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/authentication/" title="Authentication API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/authentication/">
Authentication API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/management/" title="Device Registry Management API Specification" class="dd-item ">
<a href="/hono/docs/dev/api/management/">
Device Registry Management API
</a>
</li>
<li data-nav-id="/hono/docs/dev/api/metrics/" title="Metrics" class="dd-item ">
<a href="/hono/docs/dev/api/metrics/">
Metrics
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/dev/deployment/" title="Deployment" class="dd-item
parent
">
<a href="/hono/docs/dev/deployment/">
<i class="fas fa-shipping-fast"></i> Deployment
</a>
<ul>
<li data-nav-id="/hono/docs/dev/deployment/helm-based-deployment/" title="Helm based Deployment" class="dd-item ">
<a href="/hono/docs/dev/deployment/helm-based-deployment/">
Helm based Deployment
</a>
</li>
<li data-nav-id="/hono/docs/dev/deployment/openshift/" title="OpenShift / OKD" class="dd-item active">
<a href="/hono/docs/dev/deployment/openshift/">
OpenShift / OKD
</a>
</li>
<li data-nav-id="/hono/docs/dev/deployment/create-kubernetes-cluster/" title="Setting up a Kubernetes Cluster" class="dd-item ">
<a href="/hono/docs/dev/deployment/create-kubernetes-cluster/">
Setting up a Kubernetes Cluster
</a>
</li>
<li data-nav-id="/hono/docs/dev/deployment/resource-limitation/" title="Limiting Resource Usage" class="dd-item ">
<a href="/hono/docs/dev/deployment/resource-limitation/">
Limiting Resource Usage
</a>
</li>
</ul>
</li>
<li data-nav-id="/hono/docs/dev/architecture/" title="Architecture" class="dd-item
">
<a href="/hono/docs/dev/architecture/">
<i class="fas fa-landmark"></i> Architecture
</a>
<ul>
<li data-nav-id="/hono/docs/dev/architecture/component-view/" title="Component View" class="dd-item ">
<a href="/hono/docs/dev/architecture/component-view/">
Component View
</a>
</li>
<li data-nav-id="/hono/docs/dev/architecture/auth/" title="Authentication/Authorization" class="dd-item ">
<a href="/hono/docs/dev/architecture/auth/">
Authentication/Authorization
</a>
</li>
</ul>
</li>
</ul>
<section id="prefooter">
<hr/>
<ul>
<li>
<div id="select-box-wrapper">
<div id="select-box">
<a class="padding">
Version:&nbsp;
<div class="select-style">
<select id="select-language" onchange="location = this.value;">
<option id="stable" value="/hono/docs/deployment/openshift/">stable (1.0-M7)</option>
<option id="dev" value="/hono/docs/dev/deployment/openshift/" selected>dev</option>
</select>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
<g>
<g id="arrow-drop-down">
<polygon points="0,63.75 127.5,191.25 255,63.75 " />
</g>
</g>
</svg>
</div>
</a>
</div>
</div>
</li>
</ul>
</section>
<section id="footer">
<p>&copy; 2019 <a href="https://www.eclipse.org/hono">The Eclipse Hono Project</a></p>
<p>
Documentation built with
<a href="https://www.gohugo.io" target="_blank">Hugo</a>
using the
<a href="https://github.com/matcornic/hugo-theme-learn" target="_blank">Learn</a> theme.
</p>
<div class="eclipse-logo">
<a href="https://www.eclipse.org" target="_blank">
<img src="https://www.eclipse.org/hono/docs/images/eclipse_foundation_logo.svg"/>
</a>
</div>
</section>
</div>
</nav>
<section id="body">
<div id="overlay"></div>
<div class="old-version-hint">
<p>This page refers to version <em>dev</em>.
You might want to use the <a href="https://www.eclipse.org/hono/docs/">current stable</a> version.
</p>
</div>
<div class="padding highlightable">
<div>
<div id="top-bar">
<div id="top-github-link">
<a class="github-link" title='Edit this page' href="https://github.com/eclipse/hono/edit/master/site/documentation/content/deployment/openshift.md" target="blank">
<i class="fas fa-code-branch"></i>
<span id="top-github-link-text">Edit this page</span>
</a>
</div>
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle="">
<i class="fas fa-bars"></i>
</a>
</span>
<span id="toc-menu"><i class="fas fa-list-alt"></i></span>
<span class="links">
<a href='/hono/docs/dev/'>Documentation</a> > <a href='/hono/docs/dev/deployment/'>Deployment</a> > OpenShift / OKD
</span>
</div>
<div class="progress">
<div class="wrapper">
<nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#prerequisites">Prerequisites</a>
<ul>
<li><a href="#assumptions">Assumptions</a></li>
<li><a href="#linux-like-environment">Linux like environment</a></li>
<li><a href="#openshift-origin-client-tools">OpenShift Origin client tools</a></li>
<li><a href="#minishift">Minishift</a></li>
<li><a href="#operator-lifecycle-manager">Operator Lifecycle Manager</a></li>
<li><a href="#persistent-volumes">Persistent volumes</a>
<ul>
<li><a href="#minishift-1">Minishift</a></li>
<li><a href="#local">Local</a></li>
<li><a href="#nfs">NFS</a></li>
</ul></li>
<li><a href="#ability-to-create-new-projects">Ability to create new projects</a></li>
<li><a href="#certificates">Certificates</a></li>
</ul></li>
<li><a href="#clone-the-hono-repository">Clone the Hono repository</a></li>
<li><a href="#setting-up-enmasse">Setting up EnMasse</a></li>
<li><a href="#setting-up-hono">Setting up Hono</a></li>
<li><a href="#enabling-metrics">Enabling metrics</a>
<ul>
<li><a href="#adding-prometheus-support">Adding Prometheus support</a></li>
<li><a href="#setting-up-grafana">Setting up Grafana</a></li>
</ul></li>
<li><a href="#configuring-the-installation">Configuring the installation</a>
<ul>
<li><a href="#configure-maximum-number-of-devices-per-tenant">Configure maximum number of devices per tenant</a></li>
<li><a href="#adding-jaeger-support">Adding Jaeger support</a>
<ul>
<li><a href="#enable-the-build-profile">Enable the build profile</a></li>
<li><a href="#add-the-jaeger-agent-sidecar">Add the Jaeger agent sidecar</a></li>
<li><a href="#deploy-jaeger">Deploy Jaeger</a></li>
</ul></li>
</ul></li>
<li><a href="#using-the-installation">Using the installation</a>
<ul>
<li><a href="#extract-certificates">Extract certificates</a></li>
<li><a href="#running-consumer">Running consumer</a></li>
<li><a href="#register-device">Register device</a></li>
<li><a href="#uploading-telemetry-with-http">Uploading Telemetry with HTTP</a></li>
</ul></li>
</ul></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<div id="body-inner">
<h1>OpenShift / OKD</h1>
<p>This guide describes how Eclipse Honoâ„¢ can be deployed on OpenShift with
EnMasse, using the source-to-image (S2I) way. Using this approach, it is possible
to customize and refresh the base images where Hono runs in. It also uses
a more complex, multi-project setup and separates EnMasse and Grafana from
the core Hono project.</p>
<div class="alert alert-warning">
<h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Use for demos only</h4>
<div><p>While this deployment model is closer to a production-ready deployment
it still is missing some important aspects, so please do use this only as a
base for your setup or as a demo setup. The following topics are currently
not covered by this example deployment:</p>
<ul>
<li>Integration between EnMasse and Hono authentication</li>
<li>Use your own versions of the device registry and authorization service</li>
</ul>
<p>These are all subjects to current and future developments in this area. This
document will be updated accordingly with the progress.</p>
</div>
</div>
<h2 id="prerequisites">Prerequisites</h2>
<p>In order to work through this example deployment you will need the OpenShift
client tools installed. Please align the version of the client tools with
the version of your OpenShift cluster. This guide was tested with
OpenShift 3.11.0. It might work with older or newer versions as well, but that
is untested.</p>
<h3 id="assumptions">Assumptions</h3>
<p>This tutorial makes the following assumptions about your environment, if those
assumptions are not true in your specific environment you will need to adapt
the following instructions:</p>
<ul>
<li>The admin URL of your OpenShift cluster is: <code>https://my-cluster:8443</code></li>
<li>The name of your OpenShift user is <code>developer</code></li>
<li>All scripts and paths are relative to the folder
<code>deploy/src/main/deploy/openshift</code></li>
<li>Some parts of this tutorial may need <em>cluster admin</em> privileges. When cluster
admin privileges are required, the tutorial will indicate this by the command
<code>oc login -u admin</code>. It will indicate the end of a section requiring cluster
admin privileges by the command <code>oc login -u developer</code>.
<br /></li>
</ul>
<p><strong>Note:</strong> Those command may be different on your installation. They only act
as an example.</p>
<h3 id="linux-like-environment">Linux like environment</h3>
<p>The deployment guide assumes that you have a Linux like environment with things
like <code>bash</code>, <code>curl</code>, <code>git</code>, … Mac OS X 10.13+ works as well, Windows with
some kind of Unix tooling should also be possible.</p>
<h3 id="openshift-origin-client-tools">OpenShift Origin client tools</h3>
<p>The client tools can be downloaded from the
<a href="https://github.com/openshift/origin/releases">OpenShift Origin</a> project
repository. Simply download the archive, unpack it and drop it into a directory
where it can be found by the local PATH lookup.</p>
<h3 id="minishift">Minishift</h3>
<p>This tutorial is targeted towards running Hono on a production-ready OpenShift
cluster. However it still is possible and useful to run the same setup on
a local test cluster with &ldquo;minishift&rdquo;.</p>
<p>Minishift is a tool that helps you run OpenShift locally by running a
single-node OpenShift cluster inside a VM. Follow
<a href="https://docs.openshift.org/latest/minishift/getting-started/index.html">this guide</a>
for installing and having Minishift up and running.</p>
<p>The default resource limits for Minishift however are to small, so please
ensure that you are running Minishift with the following settings:</p>
<pre><code>minishift start --cpus 4 --memory 16GB --disk-size 40GB
</code></pre>
<div class="alert alert-notice">
<h4 class="alert-heading"><i class="fas fa-info-circle"></i> Resource limits</h4>
<div>Once you created your Minishift cluster instance with <code>minishift start</code> the
resource arguments (like <code>--cpus</code>) are ignored in future calls to
<code>minishift start</code> as the virtual machine has already been created. You will
need to destroy the instance using <code>minishift delete</code> before it will accept
the new resource limits.</div>
</div>
<p>When using minishift you can find your cluster URL by executing the following
command:</p>
<pre><code>minishift console --url
</code></pre>
<p>Some of the operations may require <em>cluster admin</em> privileges. For minishift
an admin user can be created by executing the following commands, having a
running minishift instance:</p>
<pre><code>minishift addons apply admin-user
</code></pre>
<p>This will create a user named <code>admin</code>, with a password of <code>admin</code>, that has
cluster admin privileges.</p>
<h3 id="operator-lifecycle-manager">Operator Lifecycle Manager</h3>
<p>A simple way to install additional operators in your cluster is via the
<a href="https://github.com/operator-framework/operator-lifecycle-manager">Operator Lifecycle Manager</a> (aka OLM).
It can be enabled in OpenShift 3.11+ by setting <code>openshift_enable_olm=true</code>
in the Ansible inventory file.</p>
<p>For Minishift, it can be enabled by execute the following commands as
cluster admin:</p>
<pre><code>git clone https://github.com/operator-framework/operator-lifecycle-manager
cd operator-lifecycle-manager
oc login -u admin
oc new-project operator-lifecycle-manager
oc create -f deploy/okd/manifests/latest/
oc login -u developer
</code></pre>
<p>See also: <a href="https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/install/install.md">https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/install/install.md</a></p>
<p>This guide will use OLM in order to install the optional
<a href="https://github.com/coreos/prometheus-operator">Prometheus Operator</a>,
which enables the aggregation of metrics from different Hono components.</p>
<h3 id="persistent-volumes">Persistent volumes</h3>
<p>You will need two persistent volumes for this deployment. The default
required volumes are:</p>
<table>
<thead>
<tr>
<th>Name</th>
<th align="right">Size</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td>hono-pv</td>
<td align="right">128 Mi</td>
<td>Storing device registry information</td>
</tr>
<tr>
<td>grafana-pv</td>
<td align="right">1 Gi</td>
<td>Grafana configuration database</td>
</tr>
</tbody>
</table>
<p>In the folder <code>admin/storage</code> you will find a set of sub folders containing
YAML files for setting up the persistent volumes (PVs). As there are multiple
storage providers available you need to choose <strong>only one</strong> and must modify it
to match your OpenShift setup (see the following subsections).</p>
<p>It may also be possible that your cluster supports automatic provisioning of
storage, in this case you don&rsquo;t need to create PVs explicitly.</p>
<p>The PVs can be created by executing the following command with a user that
has cluster wide privileges:</p>
<pre><code>oc create -f admin/storage/&lt;type&gt;/grafana-pv.yml
oc create -f admin/storage/&lt;type&gt;/hono-pv.yml
</code></pre>
<h4 id="minishift-1">Minishift</h4>
<p>When you are running minishift, then you have automatic provisioning for PVs
available. There is no need to create any PVs manually.</p>
<h4 id="local">Local</h4>
<p>In the <code>admin/storage/local</code> folder you will find YAML files for setting up
local storage volumes. Those volumes will be kept available when pods are
restarted, but are only available on he local disk of a node. So pods can
only run on this single node and not be migrated throughout a cluster.</p>
<p>If you have a single node cluster anyway, it might still be an easy option.</p>
<p>You will need to change the field <code>.spec.hostPath.path</code> to point to an
existing directory which grants all access to &ldquo;other&rdquo; (<code>chmod a+rwx .</code>).</p>
<p>The storage capacity will only be used for matching PVs with PVCs and is not
being enforced with this storage type.</p>
<h4 id="nfs">NFS</h4>
<p>The folder <code>admin/storage/nfs</code> contains a set of YAML files for setting up
NFS based PVs. For this to work you will need a running NFS server and set up
proper exports. It is possible to re-use the NFS server of your OpenShift
installation if you already have one.</p>
<p>You will need to change the following fields:</p>
<ul>
<li><code>.spec.nfs.server</code> – Hostname of the NFS server</li>
<li><code>.spec.nfs.path</code> – The name of the exported path</li>
</ul>
<div class="alert alert-warning">
<h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Don&#39;t use in production</h4>
<div>Applications running of top of NFS may have issues with things like file locking
behavior, …. So it isn&rsquo;t recommended to use NFS without proper testing and
ensuring that it works the way you expect it. If you accept the risk of
corrupted data, it might still be a simple setup for testing a multi-node setup.</div>
</div>
<p>Also see: <a href="https://docs.openshift.org/latest/install_config/persistent_storage/persistent_storage_nfs.html">https://docs.openshift.org/latest/install_config/persistent_storage/persistent_storage_nfs.html</a></p>
<h3 id="ability-to-create-new-projects">Ability to create new projects</h3>
<p>The following guide requires three projects in the OpenShift cluster. It still
is possible to modify the deployment to deploy to a single project, however this
guide focuses on a setup having multiple projects.</p>
<p>If you don&rsquo;t have permissions to create new projects yourself, then you will
need to request three projects. The guide expects the projects names to be:</p>
<ul>
<li><code>enmasse</code> – Hosting the EnMasse components.</li>
<li><code>hono</code> – For running Eclipse Hono.</li>
<li><code>grafana</code> – For running an instance of Grafana. Primarily
for showing Hono dashboards.</li>
</ul>
<p>Those projects must be allowed to perform internal communication.</p>
<p>If projects will be created for you, then you can ignore the
calls to <code>oc new-project</code> in the following sections.</p>
<h3 id="certificates">Certificates</h3>
<p>Certificates are a difficult topic, as every components brings in its own
concept about how certificates are handled. This deployment guide tries to
align everything with OpenShifts capabilities of managing certificates. That
means that internal communication tries to use cluster generated certificates,
signed by the cluster CA. And externally it tries to re-use the OpenShift
router certificates, which are provided during the installation of OpenShift.
One exception to that are the AMQP and MQTT protocols. As those currently
cannot be re-encrypted.</p>
<p>If you deploy OpenShift without proper certificates, then you will automatically
have self-signed certificates. In this case it is required to disable e.g.
hostname validation later on. This deployment guide assumes that you have
proper certificates set up, and will try to assist if that is not the case.</p>
<div class="alert alert-notice">
<h4 class="alert-heading"><i class="fas fa-info-circle"></i> Let&#39;s encrypt</h4>
<div>As <a href="https://letsencrypt.org/">Let&rsquo;s encrypt</a> now supports wildcard certificates,
having proper certificates may only be a few commands away for you.</div>
</div>
<p>In general, <code>curl</code> commands require the parameter <code>--insecure</code> in order to
work with self-signed certificates.</p>
<div class="alert alert-warning">
<h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Mac OS X 10.13&#43;</h4>
<div><p>The <code>curl</code> binary on Mac OS X before 10.13 suffers from an issue with TLS SNI.
Also see: <a href="https://github.com/curl/curl/issues/1533">https://github.com/curl/curl/issues/1533</a></p>
<p>As the use of SNI is required for Kubernetes/OpenShift, when it comes to routing
requests to services, it is not possible to use the provided version of
<code>curl</code> on Mac OS X before 10.13.</p>
<p>You can install a working <code>curl</code> version using in those Mac OS X released with
the following commands:</p>
<pre><code>brew install curl --with-openssl
</code></pre>
<p>Or upgrade your existing installation using:</p>
<pre><code>brew reinstall curl --with-openssl
</code></pre>
<p>Or use proper certificates.</p>
</div>
</div>
<h2 id="clone-the-hono-repository">Clone the Hono repository</h2>
<p>In order to have access to some of the requires scripts and resource of this
deployment guide, you will need to clone the Hono repository to your local
machine. You can do this with the following command:</p>
<pre><code>git clone https://github.com/eclipse/hono.git
</code></pre>
<p>Or if you want to check out a specific branch (e.g. <code>0.9.x</code>):</p>
<pre><code>git clone -b 0.9.x https://github.com/eclipse/hono.git
</code></pre>
<div class="alert alert-notice">
<h4 class="alert-heading"><i class="fas fa-info-circle"></i> Different branches</h4>
<div><p>This deployment description is based on the master branch of Hono. However this
branch is also the current development and may be unstable at times.</p>
<p>If you experience any problems, it is
recommended to switch to a release branch (e.g. <code>0.9.x</code>) instead of using
the default master branch. However this documentation is only published from
the master branch, so there may be inconsistencies between the repository
content and the documentation. In this case you can read through <code>index.md</code>
file, checked out from the branch you cloned. The file is located in the
directory <code>hono-site/content/deployment/openshift</code>.</p>
</div>
</div>
<h2 id="setting-up-enmasse">Setting up EnMasse</h2>
<p>This section describes how to install EnMasse, the messaging layer which Hono is
based on.</p>
<p>Start by downloading and unpacking EnMasse:</p>
<pre><code>curl -LO https://github.com/EnMasseProject/enmasse/releases/download/0.25.0/enmasse-0.25.0.tgz
tar xzf enmasse-0.25.0.tgz
</code></pre>
<div class="alert alert-notice">
<h4 class="alert-heading"><i class="fas fa-info-circle"></i> Other versions</h4>
<div>Other versions of EnMasse might work as well, but are untested by this deployment
guide. Unless you explicitly want to try out a different version, it is
recommended to use to the version documented in this tutorial.</div>
</div>
<p>First switch to a user with <em>cluster admin</em> privileges, e.g.:</p>
<pre><code>oc login -u admin
</code></pre>
<p>Then create a new project:</p>
<pre><code>oc new-project enmasse-infra --display-name='EnMasse'
</code></pre>
<p>And perform the deployment:</p>
<pre><code>oc apply -f enmasse-0.25.0/install/bundles/enmasse-with-standard-authservice
</code></pre>
<p>Wait for the admin console to completely start up. You can check this with
the following command:</p>
<pre><code>oc get deploy/api-server deploy/keycloak
</code></pre>
<p>Verify that the &ldquo;AVAILABLE&rdquo; column shows &ldquo;1&rdquo;:</p>
<pre><code>NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
api-server 1 1 1 1 1m
keycloak 1 1 1 1 1m
</code></pre>
<p>Finally switch back to your normal application user:</p>
<pre><code>oc login -u developer
</code></pre>
<h2 id="setting-up-hono">Setting up Hono</h2>
<p>Start by creating a new project using:</p>
<pre><code>oc new-project hono --display-name='Eclipse Honoâ„¢'
</code></pre>
<p>Then create the EnMasse address space to use:</p>
<pre><code>oc create -f hono-address-space.yml
</code></pre>
<p>Before proceeding to the next step, ensure that the address space has been
created and is ready. Executing the following command should contain
<code>Is Ready: true</code> in the status section:</p>
<pre><code>oc describe addressspace/default
</code></pre>
<p>You can also quickly check for <code>isReady</code> with a JSON path query:</p>
<pre><code>oc get addressspace/default -o jsonpath='{.status.isReady}'
</code></pre>
<p>Then process and execute the main Hono template in order to deploy the
Hono services:</p>
<pre><code>oc process -f hono-template.yml | oc create -f -
</code></pre>
<p>OpenShift templates allow to use <em>parameters</em> which can customize provided
templates. If you want to specify template parameters from the command line
use the following syntax:</p>
<pre><code>oc process -f hono-template.yml \
-p GIT_REPOSITORY=https://github.com/your/hono.git \
-p GIT_BRANCH=0.9.x| oc create -f -
</code></pre>
<div class="alert alert-notice">
<h4 class="alert-heading"><i class="fas fa-info-circle"></i> Align branches</h4>
<div><p>By default the Hono template uses the <code>master</code> branch for deploying Hono. As
this branch might be unstable this may not be what you are looking for, but it
also is the default branch of the Hono Git repository where you checked out
the deployment template.</p>
<p>It is recommended that when you execute the guide from an alternate branch
(e.g. <code>0.9.x</code>) that you also pass the same branch as <code>GIT_BRANCH</code> to the
template.</p>
</div>
</div>
<p>And register the template for creating new Hono tenants. This only registers
the template, but does not create a new tenant yet:</p>
<pre><code>oc create -f hono-tenant-template.yml
</code></pre>
<p>Next you will need to create a tenant, execute the following command to create
the <em>default tenant</em>:</p>
<pre><code>oc process hono-tenant HONO_TENANT_NAME=DEFAULT_TENANT RESOURCE_NAME=defaulttenant CONSUMER_USER_NAME=consumer CONSUMER_USER_PASSWORD=&quot;$(echo -n verysecret | base64)&quot;| oc create -f -
</code></pre>
<div class="alert alert-notice">
<h4 class="alert-heading"><i class="fas fa-info-circle"></i> Creating tenants</h4>
<div>Creating a new tenant using the template currently only creates the necessary
resources in EnMasse for the tenant. It does not create the tenant in the Hono
device registry.</div>
</div>
<h2 id="enabling-metrics">Enabling metrics</h2>
<p>The default OpenShift deployment of Hono does support the use of Prometheus as
a metrics backend. However it is still required to deploy an instance of
Prometheus and Grafana to your installation in order to actually gather and
visualize the metrics.</p>
<h3 id="adding-prometheus-support">Adding Prometheus support</h3>
<p>This section will explain how to set up Prometheus via the OLM and the
Prometheus Operator. This is only an example, it is possible to install
Prometheus in different ways. Or skip the installation of Prometheus, if you
want to use a different metrics backend.</p>
<p>Run the following commands to register the prometheus operator and create a
new instance:</p>
<pre><code>oc project hono
oc create -f ../resource-descriptors/prometheus/operator.yml
oc create -f ../resource-descriptors/prometheus/instance.yml
</code></pre>
<h3 id="setting-up-grafana">Setting up Grafana</h3>
<p>Start by creating a new project using:</p>
<pre><code>oc new-project grafana --display-name='Grafana Dashboard'
</code></pre>
<p>Create the config resources:</p>
<pre><code>oc create configmap grafana-provisioning-dashboards --from-file=../../config/grafana/provisioning/dashboards
oc create configmap grafana-dashboard-defs --from-file=../../config/grafana/dashboard-definitions
oc label configmap grafana-provisioning-dashboards app=hono-metrics
oc label configmap grafana-dashboard-defs app=hono-metrics
</code></pre>
<p>Then deploy the Grafana instance using:</p>
<pre><code>oc process -f grafana-template.yml \
-p ADMIN_PASSWORD=admin | oc create -f -
</code></pre>
<p>OpenShift templates allow to use <em>parameters</em> which can customize provided
templates. If you want to specify template parameters from the command line
use the following syntax:</p>
<pre><code>oc process -f grafana-template.yml \
-p ADMIN_PASSWORD=admin \
-p HONO_NAMESPACE=hono \
-p GIT_REPOSITORY=https://github.com/your/hono.git \
-p GIT_BRANCH=0.9.x| oc create -f -
</code></pre>
<h2 id="configuring-the-installation">Configuring the installation</h2>
<p>The default installation of Hono can be tweaked in a few ways. The following
sub-sections describe a few aspects that can be modified.</p>
<h3 id="configure-maximum-number-of-devices-per-tenant">Configure maximum number of devices per tenant</h3>
<p>The default settings for the example Hono device registry limit the number of
devices to 100 per tenant. If this is not enough for your setup you can change
the setting by executing the following command, which will increase the number
to 10.000 devices per tenant:</p>
<pre><code>oc set env -n hono dc/hono-service-device-registry HONO_REGISTRY_SVC_MAX_DEVICES_PER_TENANT=10000
</code></pre>
<h3 id="adding-jaeger-support">Adding Jaeger support</h3>
<p>By default Hono has the capability to work with OpenTracing, and it also
provides a build profile for enabling the &ldquo;Jaeger&rdquo; implementation of
OpenTracing.</p>
<p>There are a few manual steps required to modify the default Hono deployment
for OpenShift in order to enable this profile.</p>
<h4 id="enable-the-build-profile">Enable the build profile</h4>
<p>The Hono profile needs to be enabled, to include the Jaeger components in the
S2I builds.</p>
<p>Modify the Hono templates to add the <code>jaeger</code> profile in the builds. e.g.:</p>
<pre><code class="language-diff"> name: fabric8-s2i-java-custom:2.3
env:
- name: MAVEN_ARGS_APPEND
- value: -B -pl org.eclipse.hono:hono-adapter-mqtt-vertx --also-make -Pnetty-tcnative
+ value: -B -pl org.eclipse.hono:hono-adapter-mqtt-vertx --also-make -Pnetty-tcnative -Pjaeger
- name: ARTIFACT_DIR
value: adapters/mqtt-vertx/target
- name: ARTIFACT_COPY_ARGS
</code></pre>
<p>Be sure to trigger new builds if you already built the container images before.</p>
<h4 id="add-the-jaeger-agent-sidecar">Add the Jaeger agent sidecar</h4>
<p>In order to add capture output from the Jaeger client and forward it to the
main Jaeger application, a Jaeger agent is required. This will be deployed
alongside each Hono service, as a dedicated container, but in the same pod
(aka sidecar).</p>
<p>This requires a new image stream:</p>
<pre><code class="language-yml">kind: ImageStream
apiVersion: v1
metadata:
name: jaeger-agent
spec:
lookupPolicy:
local: false
tags:
- name: &quot;latest&quot;
from:
kind: DockerImage
name: docker.io/jaegertracing/jaeger-agent:latest
importPolicy:
scheduled: true
referencePolicy:
type: Source
</code></pre>
<p>Then you need to modify the deployment configuration for each Hono service that
should use the Jaeger agent:</p>
<pre><code class="language-diff"> - kind: DeploymentConfig
apiVersion: v1
metadata:
name: hono-adapter-mqtt-vertx
labels:
app: hono-adapter
deploymentconfig: hono-adapter-mqtt-vertx
spec:
replicas: 1
selector:
app: hono-adapter
deploymentconfig: hono-adapter-mqtt-vertx
strategy:
type: Rolling
rollingParams:
timeoutSeconds: 3600
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- eclipsehono-hono-adapter-mqtt-vertx
from:
kind: ImageStreamTag
name: hono-adapter-mqtt-vertx:latest
+ - type: ImageChange
+ imageChangeParams:
+ automatic: true
+ containerNames:
+ - jaeger-agent
+ from:
+ kind: ImageStreamTag
+ name: jaeger-agent:latest
template:
metadata:
labels:
app: hono-adapter
deploymentconfig: hono-adapter-mqtt-vertx
spec:
containers:
- name: eclipsehono-hono-adapter-mqtt-vertx
image: hono-adapter-mqtt-vertx
imagePullPolicy: Always
env:
- name: SPRING_CONFIG_LOCATION
value: file:///etc/config/
- name: SPRING_PROFILES_ACTIVE
value:
- name: LOGGING_CONFIG
value: file:///etc/config/logback-spring.xml
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: HONO_MESSAGING_HOST
valueFrom:
configMapKeyRef:
name: hono-configuration
key: downstream.host
- name: HONO_MESSAGING_PORT
valueFrom:
configMapKeyRef:
name: hono-configuration
key: downstream.port
- name: HONO_COMMAND_HOST
valueFrom:
configMapKeyRef:
name: hono-configuration
key: downstream.host
- name: HONO_COMMAND_PORT
valueFrom:
configMapKeyRef:
name: hono-configuration
key: downstream.port
- name: HONO_REGISTRATION_HOST
value: hono-service-device-registry.$(KUBERNETES_NAMESPACE).svc
- name: HONO_CREDENTIALS_HOST
value: hono-service-device-registry.$(KUBERNETES_NAMESPACE).svc
- name: HONO_TENANT_HOST
value: hono-service-device-registry.$(KUBERNETES_NAMESPACE).svc
- name: MANAGEMENT_METRICS_EXPORT_GRAPHITE_HOST
value: influxdb.$(KUBERNETES_NAMESPACE).svc
- name: AB_JOLOKIA_USER
value: jolokia
- name: AB_JOLOKIA_PASSWORD_RANDOM
value: &quot;false&quot;
- name: AB_JOLOKIA_PASSWORD
valueFrom:
secretKeyRef:
name: hono-secrets
key: jolokia.password
readinessProbe:
httpGet:
path: /readiness
port: 8088
scheme: HTTPS
initialDelaySeconds: 10
livenessProbe:
httpGet:
path: /liveness
port: 8088
scheme: HTTPS
initialDelaySeconds: 180
resources:
limits:
memory: 512Mi
ports:
- containerPort: 8778
name: jolokia
- containerPort: 8088
name: radan-http
protocol: TCP
- containerPort: 8883
name: secure-mqtt
protocol: TCP
- containerPort: 1883
name: mqtt
protocol: TCP
securityContext:
privileged: false
volumeMounts:
- mountPath: /etc/config
name: conf
- mountPath: /etc/secrets
name: secrets
readOnly: true
- mountPath: /etc/tls
name: tls
readOnly: true
+ - image: jaeger-agent
+ name: jaeger-agent
+ ports:
+ - containerPort: 5775
+ protocol: UDP
+ - containerPort: 5778
+ - containerPort: 6831
+ protocol: UDP
+ - containerPort: 6832
+ protocol: UDP
+ command:
+ - &quot;/go/bin/agent-linux&quot;
+ - &quot;--collector.host-port=jaeger-collector.jaeger.svc:14267&quot;
+ env:
+ - name: JAEGER_SERVICE_NAME
+ value: hono-adapter-mqtt
volumes:
- name: conf
configMap:
name: hono-adapter-mqtt-vertx-config
- name: secrets
secret:
secretName: hono-mqtt-secrets
- name: tls
secret:
secretName: hono-adapter-mqtt-vertx-tls
</code></pre>
<p>The important parts are only the modifications, which add a new image stream
trigger, and also add the additional agent container to the deployment. This
example assumes that the Jaeger collector will be available at the hostname
<code>jaeger-collector.jaeger.svc</code>. This will be true if you follow the next
section on deploying a development-only Jaeger cluster. Should you deploy
Jaeger differently, then this hostname and/or port may be different.</p>
<h4 id="deploy-jaeger">Deploy Jaeger</h4>
<p>Setting up a full Jaeger cluster is a complicated task. However there is a good
tutorial at the Jaeger repository at: <a href="https://github.com/jaegertracing/jaeger-openshift">https://github.com/jaegertracing/jaeger-openshift</a></p>
<p>A simple deployment, for testing purposes only, can be performed by running
the development setup template of Jaeger for OpenShift:</p>
<pre><code>oc new-project jaeger
oc process -f https://raw.githubusercontent.com/jaegertracing/jaeger-openshift/master/all-in-one/jaeger-all-in-one-template.yml | oc create -f -
</code></pre>
<p>Please be aware of the official note in the <a href="https://github.com/jaegertracing/jaeger-openshift#development-setup">documentation</a>:</p>
<blockquote>
<p>This template uses an in-memory storage with a limited functionality for local testing and development. Do not use this template in production environments.</p>
</blockquote>
<h2 id="using-the-installation">Using the installation</h2>
<p>All following examples make use of the running Hono instance. They pretty much
follow the other examples. Please note that, compared to the more simple
OpenShift deployment, in this case we need to take care of different project
names when looking up route host names via <code>oc get</code>. You can use the command
line argument <code>-n &lt;project&gt;</code> to specify the project name without changing the
default selected project.</p>
<p>All examples in the following sub-sections assume that you are located in the
<code>cli</code> directory.</p>
<h3 id="extract-certificates">Extract certificates</h3>
<p>In order to connect the external consumer to Enmasse, we need to extract the
certificate which messaging endpoint of EnMasse uses. This allows to validate
the connection to the endpoint and encrypt the communication using TLS.</p>
<p>The following command extracts the certificate of the endpoint (not the key):</p>
<pre><code>oc -n hono get addressspace default -o jsonpath={.status.endpointStatuses[?(@.name==\'messaging\')].cert} | base64 -d &gt; target/config/hono-demo-certs-jar/tls.crt
</code></pre>
<p>This will retrieve the certificate, decode the base64 encoded string and
store it in the file <code>target/config/hono-demo-certs-jar/tls.crt</code>. Although
the file is a &ldquo;demo cert&rdquo; as the path might indicate, it still is stored in
the same location in order to align the with the other example commands of the
Hono documentation.</p>
<h3 id="running-consumer">Running consumer</h3>
<p>As described in the <a href="https://www.eclipse.org/hono/getting-started/
">Getting Started</a>
guide, data produced by devices is usually consumed by downstream applications
which connect directly to the router network service. You can start the client
from the <code>cli</code> folder as follows:</p>
<pre><code>mvn spring-boot:run -Dspring-boot.run.arguments=--hono.client.host=$(oc -n hono get addressspace default -o jsonpath={.status.endpointStatuses[?(@.name==\'messaging\')].externalHost}),--hono.client.port=443,--hono.client.username=consumer,--hono.client.password=verysecret,--hono.client.trustStorePath=target/config/hono-demo-certs-jar/tls.crt
</code></pre>
<h3 id="register-device">Register device</h3>
<p>In order to upload telemetry data to Hono, the device needs to be registered
with the system. You can register the device using the <em>Device Registry</em> by
running the following command (i.e. for a device with ID <code>4711</code>):</p>
<pre><code>curl -X POST -i -H 'Content-Type: application/json' -d '{&quot;device-id&quot;: &quot;4711&quot;}' https://$(oc get -n hono route hono-service-device-registry-https --template='{{.spec.host}}')/registration/DEFAULT_TENANT
</code></pre>
<h3 id="uploading-telemetry-with-http">Uploading Telemetry with HTTP</h3>
<p>After having the device registered, uploading telemetry is just a simple
HTTP POST command to the <em>HTTP Adapter</em>:</p>
<pre><code>curl -X POST -i -u sensor1@DEFAULT_TENANT:hono-secret -H 'Content-Type: application/json' --data-binary '{&quot;temp&quot;: 5}' https://$(oc -n hono get route hono-adapter-http-vertx-sec --template='{{.spec.host}}')/telemetry
</code></pre>
<footer class=" footline" >
</footer>
</div>
</div>
<div id="navigation">
</div>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>
<script src="/hono/docs/js/clipboard.min.js?1568856207"></script>
<script src="/hono/docs/js/perfect-scrollbar.min.js?1568856207"></script>
<script src="/hono/docs/js/perfect-scrollbar.jquery.min.js?1568856207"></script>
<script src="/hono/docs/js/jquery.sticky.js?1568856207"></script>
<script src="/hono/docs/js/featherlight.min.js?1568856207"></script>
<script src="/hono/docs/js/html5shiv-printshiv.min.js?1568856207"></script>
<script src="/hono/docs/js/highlight.pack.js?1568856207"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/hono/docs/js/modernizr.custom.71422.js?1568856207"></script>
<script src="/hono/docs/js/learn.js?1568856207"></script>
<script src="/hono/docs/js/hugo-learn.js?1568856207"></script>
<link href="/hono/docs/mermaid/mermaid.css?1568856207" type="text/css" rel="stylesheet" />
<script src="/hono/docs/mermaid/mermaid.js?1568856207"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5WLCZXC');
</script>
<script src="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/javascript/vendor/cookieconsent/default.min.js"></script>
</body>
</html>