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.
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?
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?
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.
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.
Enter your email address and receive a link to access the Learnk8s Academy.
Learnk8s trains over 300+ engineers a year in Kubernetes
The systems, techniques, and processes you'll learn in the Learnk8s Academy have been developed over 2+ years during our hands-on, instructor-led workshops.
The course is totally worth the money and time, if you have a team that is getting started with Kubernetes and want to validate the approach that you are taking as well as to level up your knowledge on K8s, this is the way to go.
— Mauricio Salatino, Activiti Cloud Team Lead
This is the course you have to do to put all the pieces in the right place and challenge yourself to really master your knowledge of Kubernetes. Wish I had done it long ago.
— Marcello Teodori, Architect
Good course with practical labs.
— Yawwani Gunawardaba, Data Scientist
A good course to get started with Kubernetes with enough confidence to deploy, debug and progress in the world of k8s.
— Sandeep Sarthavalli Ramesh, Software developer
A really enjoyable 3-day workshop on Kubernetes. I cemented my understanding of Kubernetes and can now start implementing and furthering my knowledge with real examples and workflows. Next stop, production experience.
— David Heward, Senior DevOps Engineer
We previously had a couple of people talking about Kubernetes in the pub. Now half the office are raving about it. I don't think reading documentation alone would have done that for us, it needed some people to come in and show us what is possible, validate the ideas we've already had and give us guidance on where to go next. Now everyone has a clear, shared vision and a mission. All that's left is to take the first few steps.
— Chris Cooney, Senior Software Engineer
It is an excellent course covering a wide range of Kubernetes concepts, that will give you more than enough knowledge to go back to experiment and be productive with Kubernetes.
— Luke Anderson, Senior IT Engineer
This is very intensive course, particularly if you are new to cloud computing or networking concepts.
— Mark Gardiner, Infrastructure Developer
The training is very well prepared and also very well performed.
— Przemek Anuszek, Cloud architect
Clear, good explanations with good use of diagrams.
— Eda Meadows, Polyglott Developer
Be prepared to learn a lot and enjoy the hands-on sessions.
— Sara Aspery, Software Engineer
Learnk8s know this stuff, have put a lot of thought into the course and will put a lot of thought into your questions too!
— Ryan Dawson, Software Developer
Essential knowledge. I mostly enjoyed finding out how the components were doing their thing under the hood and how traffic is/was actually being shunted around.
— Grant Hammond, Senior Linux Engineer
Great experience. Going back to the office with a much better understanding of the topic. Useful exercises, great Q&A session with clarification.
— Antonio Troina, Senior Software Developer
Yes, you can log in into the Learnk8s Academy and start learning.
This course is designed to get you up to speed with container and Kubernetes. It doesn't cover advanced topics such as networking, deployment strategies or templating resources.
You should be familiar with Bash/Powershell, git, curl and SSH. You should be familiar with web servers such as Apache or Nginx.
Sure - send an email to email@example.com.
Start learning Kubernetes now