This post was first published in Digital Ocean blog post.
You may have heard the buzz around Kubernetes and noticed that many companies have been rapidly adopting it. Due to its many components and vast ecosystem it can be quite confusing to find where the path starts to learn it.
In this session, you will learn the basics of containers and Kubernetes. Step by step, we will go through the entire process of packaging a Node.js application into a Docker container image and then deploying it on Kubernetes. We will demonstrate scaling to multiple replicas for better performance. The end result will be a resilient and scalable Node.js deployment.
You will leave this session with sufficient knowledge of containerization, Kubernetes basics, and the ability to deploy highly available, performant, and scalable Node.js applications on Kubernetes.
View the slides for this talk
Be sure to follow along with the recording for an explanation and replace kamaln7
with your own DockerHub username.
const express = require('express')
const os = require('os')
const app = express()
app.get('/', (req, res) => {
res.send(`Hi from ${os.hostname()}!`)
})
const port = 3000
app.listen(port, () => console.log(`listening on port ${port}`))
FROM node:13-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD node index.js
docker build -t kamaln7/node-hello-app .
index.js
and replace the word Hi
with Hello
.docker build -t kamaln7/node-hello-app .
docker run --rm -d -p 3000:3000 kamaln7/node-hello-app
docker ps
docker stop CONTAINER_ID
docker push kamaln7/node-hello-app
kubectl get nodes
kubectl create deployment --image kamaln7/node-hello-app node-app
kubectl scale deployment node-app --replicas 3
kubectl expose deployment node-app --port 3000
kubectl get services
kubectl get nodes -o wide
IP:port
to test the servicekubectl edit service node-app
port: 3000
with port: 80
type: NodePort
with type: LoadBalancer
kubectl get service
You can’t build a stable backend without solid architecture. And without proper backend, you can’t develop a good application. But what does stable backend mean? How to keep up with all the architectural trends in an ever-changing, fast-paced reality of the modern development? 📈
Is monolithic architecture already dead? Should you or your team focus on practicing the use of microservices? Is following the trends a good approach or should you rather lean on some thoroughly tested solutions? 🤔
During our upcoming webinar, Adam Polak – Head of Node.js Team at The Software House, will guide you through the current backend architecture trends and solutions, indicating the most important (but not always obvious) issues that you should pay attention to. Here’s the excerpt from the extensive agenda:
Subjects discussed during our event will be 100% based on real-life cases and experiences. Also, Adam will answer your questions during a Q&A session after the webinar. The whole event will last for approximately an hour.
Read MoreIn this volume of Need to Node, you can find the latest news on Node.js, our announcement of Node.dev and some information about our Open JS presentation ‘Behind the Scenes of NodeSource Node.js Binary Distributions'.
Need to Node is a weekly bulletin designed to keep you up-to-date with the latest news on the Node.js project, events and articles. You are always welcome to collaborate and participate. Please let us know if we missed a piece of content you think should be included!
If you find any Node.js or JavaScript related content over the next week (or beyond!), never hesitate to reach out to us on Twitter at @NodeSource to share and get it included in Need to Node - our DMs are open if you don’t want to share publicly!
Read MoreIf you are installing Node.js in Linux to use it in production, there is a big chance that you are using NodeSource Node.js Binary Distributions.
In this talk you can find the process in which NodeSource Node.js Binary Distributions is updated, how new versions are supported, the human and infrastructure process, and some limitations of maintaining the channel. Also and most importantly, how the community can get involved with this project.
Read MoreIn this volume of Need to Node, you can find the latest news on Deno, a recording of our webinar ‘New and Exciting Features to Land in Node.js version 14’ and ‘JavaScript features to forget’.
Need to Node is a weekly bulletin designed to keep you up-to-date with the latest news on the Node.js project, events and articles. You are always welcome to collaborate and participate. Please let us know if we missed a piece of content you think should be included!
Deno 1.0 Released. Some of the most important features include:
Promise.all
....args
in ES6 replaced the arguments object, we don’t use document.write()
anymore or join()
to concatenate strings and template literals are much better. Find out more here!String.prototype.matchAll
, Dynamic import()
, Promise.allSettled
, Optional Chaining
among others. Check it out! If you find any Node.js or JavaScript related content over the next week (or beyond!), never hesitate to reach out to us on Twitter at @NodeSource to share and get it included in Need to Node - our DMs are open if you don’t want to share publicly!
Read MoreNode.js 14 has just been released. It comes with full of new features and enhancements. More importantly, it will be promoted to Long-Term Support in October, so now it's the moment to start testing our applications and try the new features to ensure a smooth transition.
In this webinar we will be showing the most relevant of these new features.
Read MoreIn this volume of Need to Node, you can find the latest news on Node.js’s version 14 Release, Diagnostics in Node.js and The Cost of JavaScript Frameworks
Need to Node is a weekly bulletin designed to keep you up-to-date with the latest news on the Node.js project, events and articles. You are always welcome to collaborate and participate. Please let us know if we missed a piece of content you think should be included!
Node.js version 14 Released — Woo-hoo it’s finally here! Node.js v.14 now becomes the current release line with it becoming a LTS (Long Term Support) release in October. It’s recommended to keep using Node.js version 12 for now. Some of the most exciting features include:
The Cost of JavaScript Frameworks. With JavaScript you end up paying a performance tax no less than four times:
If you find any Node.js or JavaScript related content over the next week (or beyond!), never hesitate to reach out to us on Twitter at @NodeSource to share and get it included in Need to Node - our DMs are open if you don’t want to share publicly!
Read More