Digital Developer Conference: Hybrid Cloud. On Sep 22 & 24, start your journey to OpenShift certification. Free registration

Learning Path: Develop production-ready, containerized Node-RED apps

Overview

Node-RED embodies a "low code" style of application development, where developers can quickly create meaningful applications without having to write reams of code. Node-RED allows for rapid application development with minimal learning. It should be a part of every developer's toolkit. Low code is not no code. And, after all, it is easy to incorporate code into the Node-RED nodes.

In this learning path, you'll learn how to use this low code development tool for production environments. You'll see how to integrate Node-RED into your DevOps environment, including version control, a build stage, and a deploy stage.

Objectives

Upon completion of this learning path, you will be able to:

  • Understand how Node-RED can be used for production workloads
  • Enable git integration features in the Node-RED editor
  • Package a Node-RED application into a container
  • Customize the Node-RED runtime to use in production environments
  • Create Node-RED applications that receive their configuration from the environment at runtime.

Prerequisites

  • Some experience in using Node-RED. To learn the basics of using Node-RED, watch this Node-RED Essentials series of videos.
  • A laptop or workstation that runs the latest version of Linux, MacOS, or Windows.
  • Docker, version 19.0.3 or higher.
  • An active Docker ID to be able to sign in to dockerhub.
  • A GitHub account
  • git tools, which you can download and install from Git

Skill level

The skill level of this learning path is for a beginner.

Estimated time to complete

It will take you approximately 1.5 hours to complete this entire learning path.

Modules

Before you begin the tutorials, watch this introductory video about using a low-code development tool, the open source project Node-RED, for production workloads.

Three tutorials will take you through a DevOps delivery pipeline, where you will learn how to:

  1. Use source control with Node-RED
  2. Package a Node-RED application into a multi-architecture container
  3. Manage application configuration in Node-RED

1. Enable Node-RED to work with git source control

Node-RED applications consist of flow files and optionally a credential file (.json files) and a runtime (some .js files), which is a Node.js application. A package.json file captures all the required Node.js and Node-RED nodes that the flow needs. These are the application code files that you will store in a git project repo.

You can use the written instructions for the this tutorial in the workshop in GitHub. Or, you can follow along in this video.

2. Package Node-RED apps in containers

After you complete the first tutorial, in this tutorial you'll next learn how to package your Node-RED app into a Docker container and customize the Node-RED runtime for a production environment (instead of for working in your development environment). Finally, you'll learn how to run a containerized Node-RED application.

You can use the written instructions for the this tutorial in the workshop in GitHub. Or, you can follow along in this video.

3. Manage application configuration in your Node-RED nodes

After you complete the second tutorial, in this tutorial you'll learn how to provide configuration details for external services, such as a database or messaging service, at runtime. You'll learn how to access environment variables in Node-RED, replace node configuration settings with environment variables, and set environment variables when creating a Docker container.

You can use the written instructions for the this tutorial in the workshop in GitHub.

Next steps

In the 3 tutorials in this learning path, you’ve learned how to manage a Node-RED application using git, how to package a Node-RED application into a container, and how to provide runtime configuration without having the configuration embedded in the Node-RED application. These are some of the prerequisites for using Node-RED in a cloud-based production environment.

To continue your leaning, you might want to explore continuous integration and continuous deployment — DevOps — technologies, such as Jenkins, Travis and Tekton so that you can automate the build and deploy operations for your Node-RED application. You may also want to explore Kubernetes and learn how to create the deployment artifacts that are needed to run your Node-RED application in a Kubernetes cluster.