You have reached the beginning of time!

Scale Node.js with N|Solid and Kubernetes on Azure Container Services

Microsoft recently announced the availability of Kubernetes for Azure Container Services, adding to the already impressive list of orchestration options including Mesos-based DC/OS and Docker Swarm. Azure Container Services provide many advantages for managing a containerized environment, including service discovery, load balancing and abstracting away hardware are just a few from a very long list of benefits.

We are going to look at how to setup Azure to run to be able to create a Kubernetes cluster, and how to deploy N|Solid with Kubernetes to Azure Container Service.

Microsoft has been hard at work, and has recently released a new cli tool that makes working with the Azure cloud a breeze. We will walk through all the steps to get you up and running with N|Solid and Kubernetes on Azure.

Making a Microsoft Azure Account

In order to use Azure in any way, you'll need to be sure you have a Microsoft Azure account.

If you don’t already have one, Microsoft has made it pretty simple - you can sign up for an account to get started.

Installing the Azure CLI

In this tutorial, we'll be using the Azure CLI tool - to get it installed on your machine, you can simply install the tool via a cURL.

Once you run the install command, it will prompt you with a few questions about how you'd like to install the Azure CLI - unless your preferences differ, the defaults should all be acceptable.

Be sure to check out the Azure CLI GitHub repo if you want to take a dive deep into the Azure CLI tool!

curl -L https://aka.ms/InstallAzureCli | bash

Logging into Azure via the CLI

To get into Azure via the CLI, you'll simply need to run the Azure login command, az login. This command will note that you need to visit the Azure Device Login page and enter a key that's displayed in your terminal to authenticate.

Once you copy and paste the key into the Device Login Page, select the account you want to connect - after that, Azure will automatically auth with the CLI tool. You're ready to start using it!

Creating and Provisioning an Azure Group

To deploy N|Solid with Kubernetes on Azure, we'll need to spin up an Azure group - this is done pretty simply with a single command:

az group create -n nsolid -l eastus

In this command, we're telling Azure to create a group with the name "nsolid" (-n nsolid) in the US West location (-l eastus). Pretty simple.

Using Azure Container Service to Spin Up Kubernetes

Now we're going to kick things off with the Azure Container Service. We can run the following command to instruct the Container Service to create a cluster (az acs create) named "nsolid" (-n nsolid) in the group "nsolid" (-g nsolid). Additionally, we're going to pass it a command to attach our credentials to the clusters (--generate-ssh-keys), and use Kubernetes for orchestration (--orchestrator-type kubernetes)

az acs create -n nsolid -g nsolid --generate-ssh-keys --orchestrator-type kubernetes

Installing N|Solid into a Kubernetes Cluster

Now, you've got Azure entirely primed and ready to deploy N|Solid with Kuberenetes. For the next steps to deploy N|Solid with Kubernetes on Azure, you can take a look at the production installation instructions - be sure to set up persistent storage on Azure, as well.

For even more information about Node.js, Kubernetes, and the associated tools, you can check out our webinar on Getting Started with Node.js, Docker, and Kubernetes, you can learn more about Kubernetes and its place as a part of the Node.js DevOps Stack for Digital Transformation, and you can learn some easy tricks for improving your Node.js Docker images to make deploying with Kubernetes even easier.

Wrapping Up

Deploying Node.js applications to the cloud is made secure, reliable and connected using NodeSource. We're glad you're interested in deploying N|Solid with Kubernetes to Azure. In addition to N|Solid, you can take the risk out of your reliance on third-party Node.js modules when working locally, testing your applications in staging, deploying production to Azure, and more with NodeSource Certified Modules.

The NodeSource platform offers a high-definition view of the performance, security and behavior of Node.js applications and functions.

Start for Free