The modern course on deploying Node.js, Express and MongoDB with Docker and Kubernetes

The traditional way of deploying Node.js apps:

You create a VPS and install Node.js, MongoDB and Nginx. If you need a test and production environment, you should be careful to repeat the same steps without any deviation.

You upload the code with SFTP (or SCP) to the server paying attention to the node_modules folder. You shouldn't copy packages that are compiled for your mac to a Linux server (I'm looking at you node-sass).

You should run npm install before every deployment, in case a new package was installed or removed. You should probably automate that too.

When the app crashes, you should restart it. Setting up PM2 or forever is a must to keep the app always running.

If you run a collection of apps, you have no choice but having a reverse proxy such as Nginx to route the traffic. But even if you run a single application, you should consider using one for TLS and serving static assets.

When you release a new version of the app, you shouldn't stop the server, deploy the code and restart the server. That could cause downtime. How do you avoid it?

When the release has a bug, you need a plan B. You could duplicate the src folders and renaming it to `_old`. But that's a hack at best.

When you develop projects made of several Node.js apps, you need to keep track of what service uses which port. It's hard to tell if 4567 is another service or the database.

But that list is just the tip of the iceberg.

You should also consider setting up HTTPS and automated certificate renewal for your domains, centralized logging, clustering for your app, etc.

Deploying your app is not a small feat

And you could easily spend months automating it to perfection.

And once you're done, you end up managing with your unique setup.

Good luck on getting more team members on board or fixing an issue.

But what if instead of starting from scratch you could use a standard stack that includes the components that you need such as automatic deployments, scaling and a reverse proxy to handle the routes?

And what if you could create it with a single click? Ideally creating more instances could be scripted so that you won't have to repeat yourself.

What if that could work on your laptop, as well as on the cloud and in your company servers?

You could:

spend less time managing infrastructure and more time coding!

stop worrying about components silently falling apart in the middle of the night

scale your apps to millions of users with the confidence that it is built on a solid foundation

Is it just a dream?

Kubernetes and containers offer just that — the fundamental blocks for deploying apps at scale

When you switch to Kubernetes, this is what happens to your apps:

You package your app and all of its dependencies such as Node.js, the npm modules and any binary into a single archive called container.

Containers are self-sufficient, and they can run anywhere. Even if there's no Node.js installed.

You upload the container to a registry, similar to what you do with your Node.js packages. Side effect: you have a collection of past containers that you can use to roll back.

You define how many copies of the app you wish to have and any memory or CPU limit. You submit the request to Kubernetes and watch application coming to life. Kubernetes takes the necessary step to download, run and scale the app.

When the app crashes (perhaps you forgot to handle an uncaught exception?), Kubernetes restarts it automatically.

When you release a new version of the app, Kubernetes rolls out the changes incrementally with zero downtime.

If you have multiple apps, Kubernetes has a built-in reverse proxy that handles domain and path-based routing

When you're developing several apps and using databases, Kubernetes makes it easier to connect and consume those with integrated service discovery.

Too good to be true, where's the catch?

Things that are very general and powerful will always require some level of skill to use.

And Kubernetes isn't an exception.

Kubernetes is known to have a steep learning curve

It's also well known for being non-beginner-friendly.

A shame for such a useful and promising technology.

Not anymore.

Enter Zero to Kubernetes

A step-by-step course on how to design, develop and deploy applications in Kubernetes.

In this course, you will learn how to build a note-taking application that can store images and text similar to Evernote or Google Keep.

And you will learn how to:

develop an application from scratch in Node.js and MongoDB

containerize your application using Docker

deploy the app in Kubernetes and scale it locally

manage shared storage for your application

deploy and scale your application on Amazon EKS

However, if you wish to study and want to practice offline (during the morning commute), you can download the ebook too.

The course is free, and you can start your Kubernetes journey now.