node-js.slack.com
#cloudnative
github.com/CloudNativeJSCloudNativeJS.io
Chris Bailey
Chief Architect,
Cloud Native Runtimes @IBM
baileyc@uk.ibm.com
@Chris__Bailey
Beth Griggs
Node.js Core Collaborator,
Node.js Runtimes @IBM
Bethany.Griggs@uk.ibm.com
@BethGriggs_
Cloud Native Node.js
Create and Deploy Cloud Native Node.js Applications
Node Summit, July 27th 2018
MICROSERVICES: Key Performance Characteristics
IO Speed
• Performance
• Scale
0
300
600
900
200
0
1,150
IO Speed
• Performance
• Scale
MICROSERVICES: Key Performance Characteristics
0
300
600
900
200
0
1,150
MICROSERVICES: Key Performance Characteristics
IO Speed
• Performance
• Scale
0
300
600
900
200
897
1,150
MICROSERVICES: Key Performance Characteristics
IO Speed
• Performance
• Scale
0
300
600
900
200
897
1,150
MICROSERVICES: Key Performance Characteristics
Startup
• Availability
• Scaling
IO Speed
• Performance
• Scale
0
300
600
900
200
897
1,150
00.9
MICROSERVICES: Key Performance Characteristics
Startup
• Availability
• Scaling
IO Speed
• Performance
• Scale
0
300
600
900
200
897
1,150 13.7
0.9
MICROSERVICES: Key Performance Characteristics
Startup
• Availability
• Scaling
IO Speed
• Performance
• Scale
0
300
600
900
200
897
1,150 13.7
0.9
MICROSERVICES: Key Performance Characteristics
Startup
• Availability
• Scaling
Memory
• Efficiency
• Cost
IO Speed
• Performance
• Scale
0
300
600
900
200
897
1,150 13.7
0.9 023.6
MICROSERVICES: Key Performance Characteristics
Startup
• Availability
• Scaling
Memory
• Efficiency
• Cost
IO Speed
• Performance
• Scale
0
300
600
900
200
897
1,150 13.7
0.9
422
23.6
Startup
• Availability
• Scaling
Memory
• Efficiency
• Cost
IO Speed
• Performance
• Scale
MICROSERVICES: Key Performance Characteristics
12%
38%
100%
0% 20% 40% 60% 80% 100%
Cloud Native
Cloud Services
Cloud Hosted
Cloud Hosting vs Cloud Native
Evans Cloud Development Survey
2017
12%
38%
100%
0% 20% 40% 60% 80% 100%
Cloud Native
Cloud Services
Cloud Hosted
Cloud Hosting vs Cloud Native
Evans Cloud Development Survey
2017
Cloud Hosting vs Cloud Native
12%
38%
100%
0% 20% 40% 60% 80% 100%
Cloud Native
Cloud Services
Cloud Hosted
Evans Cloud Development Survey
2017
12%
48%
79%
0% 20% 40% 60% 80% 100%
Kubernetes
Docker
Cloud Hosted
Cloud Hosting vs Cloud Native
Node.js Foundation Survey
2018
12%
38%
100%
0% 20% 40% 60% 80% 100%
Cloud Native
Cloud Services
Cloud Hosted
Evans Cloud Development Survey
2017
12%
48%
79%
0% 20% 40% 60% 80% 100%
Kubernetes
Docker
Cloud Hosted
Cloud Hosting vs Cloud Native
Node.js Foundation Survey
2018
12%
38%
100%
0% 20% 40% 60% 80% 100%
Cloud Native
Cloud Services
Cloud Hosted
Evans Cloud Development Survey
2017
Cloud Hosting vs Cloud Native
12%
48%
79%
0% 20% 40% 60% 80% 100%
Kubernetes
Docker
Cloud Hosted
Node.js Foundation Survey
2018
12%
38%
100%
0% 20% 40% 60% 80% 100%
Cloud Native
Cloud Services
Cloud Hosted
Evans Cloud Development Survey
2017
: Key Technologies
Container
Orchestration Monitoring
Distributed TracingPackage and Deploy
Platform
Module Insights: http://modules.cloudnativejs.io/
Module LTS: https://github.com/CloudNativeJS/ModuleLTS
Module LTS: https://github.com/CloudNativeJS/ModuleLTS
Module LTS: https://github.com/strongloop/loopback
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"] Node.js 8 Docker Image
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"] Node.js 8 Docker Image
Operating System Updates
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"] Node.js 8 Docker Image
Operating System Updates
package.json
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"] Node.js 8 Docker Image
Operating System Updates
package.json
node_modules
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"] Node.js 8 Docker Image
Operating System Updates
package.json
node_modules
Application
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"] Node.js 8 Docker Image
Operating System Updates
package.json
node_modules
Application
716 MB
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
Node.js 8 Docker Image
Operating System Updates
package.json
node_modules
716 MB
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
Node.js 8 Docker Image
Operating System Updates
package.json
node_modules
716 MB
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
node_modules
716 MB
package.json
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
node_modules
716 MB
Node.js 8 SLIM Docker Image
package.json
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
node_modules
716 MB
Node.js 8 SLIM Docker Image
Operating System Updates
package.json
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
node_modules
716 MB
Node.js 8 SLIM Docker Image
Operating System Updates
package.json
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
node_modules
716 MB
Node.js 8 SLIM Docker Image
Operating System Updates
Application
package.json
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
node_modules
Node.js 8 SLIM Docker Image
Operating System Updates
Application
package.json
716 MB
229 MB
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
FROM node:8
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY package.json /app/
RUN npm install —production
# Copy the dependencies into a Slim Node docker image
FROM node:8-slim
WORKDIR "/app"
# Install OS updates
RUN apt-get update && apt-get dist-upgrade -y && apt-get clean 
&& echo 'Finished installing dependencies'
# Install app dependencies
COPY --from=0 /app/node_modules /app/node_modules
COPY . /app
ENV NODE_ENV production
ENV PORT 3000
USER node
EXPOSE 3000
CMD ["npm", "start"]
node_modules
Node.js 8 SLIM Docker Image
Operating System Updates
Application
package.json
$ docker build -t node-app -f Dockerfile-run .

$ docker build -t node-app -f Dockerfile-run .

$ docker run -d —p 3000:3000 -t node-app
$ docker build -t node-app -f Dockerfile-run .

$ docker run -d —p 3000:3000 -t node-app
HELM CHARTS
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
/chart/nodeserver/templates/basedeployment.yaml
/chart/nodeserver/templates/deployment.yaml
/chart/nodeserver/templates/service.yaml
/chart/nodeserver/templates/hpa.yaml
/chart/nodeserver/templates/istio.yaml
/chart/nodeserver/Chart.yaml
/chart/nodeserver/values.yaml
HELM CHARTS
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
/chart/nodeserver/templates/basedeployment.yaml
/chart/nodeserver/templates/deployment.yaml
/chart/nodeserver/templates/service.yaml
/chart/nodeserver/templates/hpa.yaml
/chart/nodeserver/templates/istio.yaml
/chart/nodeserver/Chart.yaml
/chart/nodeserver/values.yaml
apiVersion: v1
description: A Helm chart for Kubernetes
name: nodeserver
HELM CHARTS
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
/chart/nodeserver/templates/basedeployment.yaml
/chart/nodeserver/templates/deployment.yaml
/chart/nodeserver/templates/service.yaml
/chart/nodeserver/templates/hpa.yaml
/chart/nodeserver/templates/istio.yaml
/chart/nodeserver/Chart.yaml
/chart/nodeserver/values.yaml
replicaCount: 1
revisionHistoryLimit: 1
image:
repository: cnbailey/nodeserver
tag: 1.0.0
pullPolicy: Always
resources:
requests:
cpu: 200m
memory: 300Mi
livenessProbe:
initialDelaySeconds: 3000
periodSeconds: 1000
service:
name: Node
type: NodePort
servicePort: 3000
hpa:
enabled: false
minReplicas: 1
maxReplicas: 2
metrics:
cpu:
targetAverageUtilization: 70
memory:
targetAverageUtilization: 70
services:
base:
enabled: false
HELM CHARTS
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
/chart/nodeserver/templates/basedeployment.yaml
/chart/nodeserver/templates/deployment.yaml
/chart/nodeserver/templates/service.yaml
/chart/nodeserver/templates/hpa.yaml
/chart/nodeserver/templates/istio.yaml
/chart/nodeserver/Chart.yaml
/chart/nodeserver/values.yaml
replicaCount: 1
revisionHistoryLimit: 1
image:
repository: cnbailey/nodeserver
tag: 1.0.0
pullPolicy: Always
resources:
requests:
cpu: 200m
memory: 300Mi
livenessProbe:
initialDelaySeconds: 3000
periodSeconds: 1000
service:
name: Node
type: NodePort
servicePort: 3000
hpa:
enabled: false
minReplicas: 1
maxReplicas: 2
metrics:
cpu:
targetAverageUtilization: 70
memory:
targetAverageUtilization: 70
services:
base:
enabled: false
HELM CHARTS
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
/chart/nodeserver/templates/basedeployment.yaml
/chart/nodeserver/templates/deployment.yaml
/chart/nodeserver/templates/service.yaml
/chart/nodeserver/templates/hpa.yaml
/chart/nodeserver/templates/istio.yaml
/chart/nodeserver/Chart.yaml
/chart/nodeserver/values.yaml
replicaCount: 1
revisionHistoryLimit: 1
image:
repository: cnbailey/nodeserver
tag: 1.0.0
pullPolicy: Always
resources:
requests:
cpu: 200m
memory: 300Mi
livenessProbe:
initialDelaySeconds: 3000
periodSeconds: 1000
service:
name: Node
type: NodePort
servicePort: 3000
hpa:
enabled: false
minReplicas: 1
maxReplicas: 2
metrics:
cpu:
targetAverageUtilization: 70
memory:
targetAverageUtilization: 70
services:
base:
enabled: false
HELM CHARTS
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
/chart/nodeserver/templates/basedeployment.yaml
/chart/nodeserver/templates/deployment.yaml
/chart/nodeserver/templates/service.yaml
/chart/nodeserver/templates/hpa.yaml
/chart/nodeserver/templates/istio.yaml
/chart/nodeserver/Chart.yaml
/chart/nodeserver/values.yaml
replicaCount: 1
revisionHistoryLimit: 1
image:
repository: cnbailey/nodeserver
tag: 1.0.0
pullPolicy: Always
resources:
requests:
cpu: 200m
memory: 300Mi
livenessProbe:
initialDelaySeconds: 3000
periodSeconds: 1000
service:
name: Node
type: NodePort
servicePort: 3000
hpa:
enabled: false
minReplicas: 1
maxReplicas: 2
metrics:
cpu:
targetAverageUtilization: 70
memory:
targetAverageUtilization: 70
services:
base:
enabled: false
HELM CHARTS
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
/chart/nodeserver/templates/basedeployment.yaml
/chart/nodeserver/templates/deployment.yaml
/chart/nodeserver/templates/service.yaml
/chart/nodeserver/templates/hpa.yaml
/chart/nodeserver/templates/istio.yaml
/chart/nodeserver/Chart.yaml
/chart/nodeserver/values.yaml
replicaCount: 1
revisionHistoryLimit: 1
image:
repository: cnbailey/nodeserver
tag: 1.0.0
pullPolicy: Always
resources:
requests:
cpu: 200m
memory: 300Mi
livenessProbe:
initialDelaySeconds: 3000
periodSeconds: 1000
service:
name: Node
type: NodePort
servicePort: 3000
hpa:
enabled: false
minReplicas: 5
maxReplicas: 9
metrics:
cpu:
targetAverageUtilization: 70
memory:
targetAverageUtilization: 70
services:
base:
enabled: false
$ cd ./chart/nodeserver/
$ helm install —name nodeserver .
$ cd ./chart/nodeserver/
$ helm install —name nodeserver .
$ cd ./chart/nodeserver/
$ helm install —name nodeserver .
Health Checks
HTTP Requests
Health Checks
HTTP Requests
GET: /ready
GET: /ready
Health Checks
HTTP Requests
GET: /ready 200
GET: /ready 200
Health Checks
HTTP Requests
GET: /ready 200
GET: /health 200
GET: /ready 200
GET: /health 200
Health Checks
HTTP Requests
GET: /ready 503
GET: /health 503
GET: /ready 200
GET: /health 200
Health Checks
HTTP Requests
GET: /ready 503
GET: /health 503
GET: /ready 200
GET: /health 200
SIGTERM
Health Checks
HTTP Requests
GET: /ready 503
GET: /health 503
GET: /ready 200
GET: /health 200
SIGTERM
SIGKILL
Health Checks
HTTP Requests
GET: /ready 503
GET: /health 503
GET: /ready 200
GET: /health 200
SIGTERM
SIGKILL
Health Checks
HTTP Requests
GET: /ready 503
GET: /health 503
GET: /ready 200
GET: /health 200
Health Checks
HTTP Requests
GET: /ready 503
GET: /health 200
GET: /ready 200
GET: /health 200
GET: /ready 200
GET: /health 200
GET: /ready 200
GET: /health 200
Health Checks
HTTP Requests
GET: /ready 200
GET: /health 200
GET: /ready 200
GET: /health 200
Health Checks
HTTP Requests
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const health = require(‘@cloudnative/health-connect');
let healthcheck = new health.HealthChecker();-
Health Checks
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const health = require(‘@cloudnative/health-connect');
let healthcheck = new health.HealthChecker();
app.use('/ready', health.ReadinessEndpoint(healthcheck))
app.use('/health', health.LivenessEndpoint(healthcheck))-
Health Checks
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const health = require(‘@cloudnative/health-connect');
let healthcheck = new health.HealthChecker();
const livePromise = new Promise(function (resolve, _reject) {
resolve();
});
app.use('/ready', health.ReadinessEndpoint(healthcheck))
app.use('/health', health.LivenessEndpoint(healthcheck))
-
Health Checks
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const health = require(‘@cloudnative/health-connect');
let healthcheck = new health.HealthChecker();
const livePromise = new Promise(function (resolve, _reject) {
resolve();
});
let liveCheck = new health.LivenessCheck("live", livePromise);
app.use('/ready', health.ReadinessEndpoint(healthcheck))
app.use('/health', health.LivenessEndpoint(healthcheck))
-
Health Checks
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const health = require(‘@cloudnative/health-connect');
let healthcheck = new health.HealthChecker();
const livePromise = new Promise(function (resolve, _reject) {
resolve();
});
let liveCheck = new health.LivenessCheck("live", livePromise);
healthcheck.registerlivenessCheck(liveCheck);
app.use('/ready', health.ReadinessEndpoint(healthcheck))
app.use('/health', health.LivenessEndpoint(healthcheck))
-
Health Checks
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const health = require(‘@cloudnative/health-connect');
let healthcheck = new health.HealthChecker();
const livePromise = new Promise(function (resolve, _reject) {
resolve();
});
let liveCheck = new health.LivenessCheck("live", livePromise);
const readyPromise = new Promise(function (resolve, _reject) {
resolve();
});
let readyCheck = new health.ReadinessCheck("ready", readyPromise);
healthcheck.registerlivenessCheck(liveCheck);
healthcheck.registerReadinessCheck(readyCheck);
app.use('/ready', health.ReadinessEndpoint(healthcheck))
app.use('/health', health.LivenessEndpoint(healthcheck))
-
Health Checks
-
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const health = require(‘@cloudnative/health-connect');
let healthcheck = new health.HealthChecker();
const livePromise = new Promise(function (resolve, _reject) {
resolve();
});
let liveCheck = new health.LivenessCheck("live", livePromise);
const readyPromise = new Promise(function (resolve, _reject) {
resolve();
});
let readyCheck = new health.ReadinessCheck("ready", readyPromise);
const shutdownPromise = new Promise(function (resolve, _reject) {
resolve();
});
let shutdownCheck = new health.ShutdownCheck(“shut”, shutdownProm);
healthcheck.registerlivenessCheck(liveCheck);
healthcheck.registerReadinessCheck(readyCheck);
healthcheck.registerShutdownCheck(shutdownCheck);
app.use('/ready', health.ReadinessEndpoint(healthcheck))
app.use('/health', health.LivenessEndpoint(healthcheck))
-
Health Checks
-
GET: /ready 200
GET: /health 200
GET: /ready 200
GET: /health 200
HTTP Requests
GET: /ready 200
GET: /health 200
GET: /metrics
GET: /ready 200
GET: /health 200
GET: /metrics
HTTP Requests
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const prometheus = require(‘appmetrics-prometheus’).attach();
-
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const prometheus = require(‘appmetrics-prometheus’).attach();
-
PUBLIC NETWORK CLOUD NETWORK
CATALOG
ORDER
INVENTORY
USER
MySQL
MongoDB
SPARK
ELASTICSEARCH
BACKEND FOR

FRONTEND
MICROSERVICES SERVICES
LOAD

BALANCER
PUBLIC NETWORK CLOUD NETWORK
CATALOG
ORDER
INVENTORY
USER
MySQL
MongoDB
SPARK
ELASTICSEARCH
BACKEND FOR

FRONTEND
MICROSERVICES SERVICES
LOAD

BALANCER
PUBLIC NETWORK CLOUD NETWORK
CATALOG
ORDER
INVENTORY
USER
MySQL
MongoDB
SPARK
ELASTICSEARCH
BACKEND FOR

FRONTEND
MICROSERVICES SERVICES
LOAD

BALANCER
PUBLIC NETWORK CLOUD NETWORK
CATALOG
ORDER
INVENTORY
USER
MySQL
MongoDB
SPARK
ELASTICSEARCH
BACKEND FOR

FRONTEND
MICROSERVICES SERVICES
LOAD

BALANCER
PUBLIC NETWORK CLOUD NETWORK
CATALOG
ORDER
INVENTORY
USER
MySQL
MongoDB
SPARK
ELASTICSEARCH
BACKEND FOR

FRONTEND
MICROSERVICES SERVICES
LOAD

BALANCER
PUBLIC NETWORK CLOUD NETWORK
CATALOG
ORDER
INVENTORY
USER
MySQL
MongoDB
SPARK
ELASTICSEARCH
BACKEND FOR

FRONTEND
MICROSERVICES SERVICES
LOAD

BALANCER
PUBLIC NETWORK CLOUD NETWORK
CATALOG
ORDER
INVENTORY
USER
MySQL
MongoDB
SPARK
ELASTICSEARCH
BACKEND FOR

FRONTEND
MICROSERVICES SERVICES
LOAD

BALANCER
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const zipkin = require(‘appmetrics-zipkin’);-
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const zipkin = require(‘appmetrics-zipkin’);-
func add(_ a: Int,
to b: Int) -> Void
{
print(a + b)
}
let a = ”5”
let b = 3
const zipkin = require(‘appmetrics-zipkin’);-
node-js.slack.com
#cloudnative
github.com/CloudNativeJSCloudNativeJS.io

Node Summit 2018: Cloud Native Node.js

  • 1.
    node-js.slack.com #cloudnative github.com/CloudNativeJSCloudNativeJS.io Chris Bailey Chief Architect, CloudNative Runtimes @IBM baileyc@uk.ibm.com @Chris__Bailey Beth Griggs Node.js Core Collaborator, Node.js Runtimes @IBM Bethany.Griggs@uk.ibm.com @BethGriggs_ Cloud Native Node.js Create and Deploy Cloud Native Node.js Applications Node Summit, July 27th 2018
  • 2.
    MICROSERVICES: Key PerformanceCharacteristics IO Speed • Performance • Scale
  • 3.
    0 300 600 900 200 0 1,150 IO Speed • Performance •Scale MICROSERVICES: Key Performance Characteristics
  • 4.
    0 300 600 900 200 0 1,150 MICROSERVICES: Key PerformanceCharacteristics IO Speed • Performance • Scale
  • 5.
    0 300 600 900 200 897 1,150 MICROSERVICES: Key PerformanceCharacteristics IO Speed • Performance • Scale
  • 6.
    0 300 600 900 200 897 1,150 MICROSERVICES: Key PerformanceCharacteristics Startup • Availability • Scaling IO Speed • Performance • Scale
  • 7.
    0 300 600 900 200 897 1,150 00.9 MICROSERVICES: Key PerformanceCharacteristics Startup • Availability • Scaling IO Speed • Performance • Scale
  • 8.
    0 300 600 900 200 897 1,150 13.7 0.9 MICROSERVICES: KeyPerformance Characteristics Startup • Availability • Scaling IO Speed • Performance • Scale
  • 9.
    0 300 600 900 200 897 1,150 13.7 0.9 MICROSERVICES: KeyPerformance Characteristics Startup • Availability • Scaling Memory • Efficiency • Cost IO Speed • Performance • Scale
  • 10.
    0 300 600 900 200 897 1,150 13.7 0.9 023.6 MICROSERVICES:Key Performance Characteristics Startup • Availability • Scaling Memory • Efficiency • Cost IO Speed • Performance • Scale
  • 11.
    0 300 600 900 200 897 1,150 13.7 0.9 422 23.6 Startup • Availability •Scaling Memory • Efficiency • Cost IO Speed • Performance • Scale MICROSERVICES: Key Performance Characteristics
  • 12.
    12% 38% 100% 0% 20% 40%60% 80% 100% Cloud Native Cloud Services Cloud Hosted Cloud Hosting vs Cloud Native Evans Cloud Development Survey 2017
  • 13.
    12% 38% 100% 0% 20% 40%60% 80% 100% Cloud Native Cloud Services Cloud Hosted Cloud Hosting vs Cloud Native Evans Cloud Development Survey 2017
  • 14.
    Cloud Hosting vsCloud Native 12% 38% 100% 0% 20% 40% 60% 80% 100% Cloud Native Cloud Services Cloud Hosted Evans Cloud Development Survey 2017
  • 15.
    12% 48% 79% 0% 20% 40%60% 80% 100% Kubernetes Docker Cloud Hosted Cloud Hosting vs Cloud Native Node.js Foundation Survey 2018 12% 38% 100% 0% 20% 40% 60% 80% 100% Cloud Native Cloud Services Cloud Hosted Evans Cloud Development Survey 2017
  • 16.
    12% 48% 79% 0% 20% 40%60% 80% 100% Kubernetes Docker Cloud Hosted Cloud Hosting vs Cloud Native Node.js Foundation Survey 2018 12% 38% 100% 0% 20% 40% 60% 80% 100% Cloud Native Cloud Services Cloud Hosted Evans Cloud Development Survey 2017
  • 17.
    Cloud Hosting vsCloud Native 12% 48% 79% 0% 20% 40% 60% 80% 100% Kubernetes Docker Cloud Hosted Node.js Foundation Survey 2018 12% 38% 100% 0% 20% 40% 60% 80% 100% Cloud Native Cloud Services Cloud Hosted Evans Cloud Development Survey 2017
  • 18.
    : Key Technologies Container OrchestrationMonitoring Distributed TracingPackage and Deploy Platform
  • 22.
  • 23.
  • 24.
  • 25.
  • 28.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"]
  • 29.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] Node.js 8 Docker Image
  • 30.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] Node.js 8 Docker Image Operating System Updates
  • 31.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] Node.js 8 Docker Image Operating System Updates package.json
  • 32.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] Node.js 8 Docker Image Operating System Updates package.json node_modules
  • 33.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] Node.js 8 Docker Image Operating System Updates package.json node_modules Application
  • 34.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] Node.js 8 Docker Image Operating System Updates package.json node_modules Application 716 MB
  • 35.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production Node.js 8 Docker Image Operating System Updates package.json node_modules 716 MB
  • 36.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] Node.js 8 Docker Image Operating System Updates package.json node_modules 716 MB
  • 37.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] node_modules 716 MB package.json
  • 38.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] node_modules 716 MB Node.js 8 SLIM Docker Image package.json
  • 39.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] node_modules 716 MB Node.js 8 SLIM Docker Image Operating System Updates package.json
  • 40.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] node_modules 716 MB Node.js 8 SLIM Docker Image Operating System Updates package.json
  • 41.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] node_modules 716 MB Node.js 8 SLIM Docker Image Operating System Updates Application package.json
  • 42.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] node_modules Node.js 8 SLIM Docker Image Operating System Updates Application package.json 716 MB
  • 43.
    229 MB func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 FROM node:8 WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY package.json /app/ RUN npm install —production # Copy the dependencies into a Slim Node docker image FROM node:8-slim WORKDIR "/app" # Install OS updates RUN apt-get update && apt-get dist-upgrade -y && apt-get clean && echo 'Finished installing dependencies' # Install app dependencies COPY --from=0 /app/node_modules /app/node_modules COPY . /app ENV NODE_ENV production ENV PORT 3000 USER node EXPOSE 3000 CMD ["npm", "start"] node_modules Node.js 8 SLIM Docker Image Operating System Updates Application package.json
  • 44.
    $ docker build-t node-app -f Dockerfile-run .

  • 45.
    $ docker build-t node-app -f Dockerfile-run .
 $ docker run -d —p 3000:3000 -t node-app
  • 46.
    $ docker build-t node-app -f Dockerfile-run .
 $ docker run -d —p 3000:3000 -t node-app
  • 49.
    HELM CHARTS func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 /chart/nodeserver/templates/basedeployment.yaml /chart/nodeserver/templates/deployment.yaml /chart/nodeserver/templates/service.yaml /chart/nodeserver/templates/hpa.yaml /chart/nodeserver/templates/istio.yaml /chart/nodeserver/Chart.yaml /chart/nodeserver/values.yaml
  • 50.
    HELM CHARTS func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 /chart/nodeserver/templates/basedeployment.yaml /chart/nodeserver/templates/deployment.yaml /chart/nodeserver/templates/service.yaml /chart/nodeserver/templates/hpa.yaml /chart/nodeserver/templates/istio.yaml /chart/nodeserver/Chart.yaml /chart/nodeserver/values.yaml apiVersion: v1 description: A Helm chart for Kubernetes name: nodeserver
  • 51.
    HELM CHARTS func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 /chart/nodeserver/templates/basedeployment.yaml /chart/nodeserver/templates/deployment.yaml /chart/nodeserver/templates/service.yaml /chart/nodeserver/templates/hpa.yaml /chart/nodeserver/templates/istio.yaml /chart/nodeserver/Chart.yaml /chart/nodeserver/values.yaml replicaCount: 1 revisionHistoryLimit: 1 image: repository: cnbailey/nodeserver tag: 1.0.0 pullPolicy: Always resources: requests: cpu: 200m memory: 300Mi livenessProbe: initialDelaySeconds: 3000 periodSeconds: 1000 service: name: Node type: NodePort servicePort: 3000 hpa: enabled: false minReplicas: 1 maxReplicas: 2 metrics: cpu: targetAverageUtilization: 70 memory: targetAverageUtilization: 70 services: base: enabled: false
  • 52.
    HELM CHARTS func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 /chart/nodeserver/templates/basedeployment.yaml /chart/nodeserver/templates/deployment.yaml /chart/nodeserver/templates/service.yaml /chart/nodeserver/templates/hpa.yaml /chart/nodeserver/templates/istio.yaml /chart/nodeserver/Chart.yaml /chart/nodeserver/values.yaml replicaCount: 1 revisionHistoryLimit: 1 image: repository: cnbailey/nodeserver tag: 1.0.0 pullPolicy: Always resources: requests: cpu: 200m memory: 300Mi livenessProbe: initialDelaySeconds: 3000 periodSeconds: 1000 service: name: Node type: NodePort servicePort: 3000 hpa: enabled: false minReplicas: 1 maxReplicas: 2 metrics: cpu: targetAverageUtilization: 70 memory: targetAverageUtilization: 70 services: base: enabled: false
  • 53.
    HELM CHARTS func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 /chart/nodeserver/templates/basedeployment.yaml /chart/nodeserver/templates/deployment.yaml /chart/nodeserver/templates/service.yaml /chart/nodeserver/templates/hpa.yaml /chart/nodeserver/templates/istio.yaml /chart/nodeserver/Chart.yaml /chart/nodeserver/values.yaml replicaCount: 1 revisionHistoryLimit: 1 image: repository: cnbailey/nodeserver tag: 1.0.0 pullPolicy: Always resources: requests: cpu: 200m memory: 300Mi livenessProbe: initialDelaySeconds: 3000 periodSeconds: 1000 service: name: Node type: NodePort servicePort: 3000 hpa: enabled: false minReplicas: 1 maxReplicas: 2 metrics: cpu: targetAverageUtilization: 70 memory: targetAverageUtilization: 70 services: base: enabled: false
  • 54.
    HELM CHARTS func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 /chart/nodeserver/templates/basedeployment.yaml /chart/nodeserver/templates/deployment.yaml /chart/nodeserver/templates/service.yaml /chart/nodeserver/templates/hpa.yaml /chart/nodeserver/templates/istio.yaml /chart/nodeserver/Chart.yaml /chart/nodeserver/values.yaml replicaCount: 1 revisionHistoryLimit: 1 image: repository: cnbailey/nodeserver tag: 1.0.0 pullPolicy: Always resources: requests: cpu: 200m memory: 300Mi livenessProbe: initialDelaySeconds: 3000 periodSeconds: 1000 service: name: Node type: NodePort servicePort: 3000 hpa: enabled: false minReplicas: 1 maxReplicas: 2 metrics: cpu: targetAverageUtilization: 70 memory: targetAverageUtilization: 70 services: base: enabled: false
  • 55.
    HELM CHARTS func add(_a: Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 /chart/nodeserver/templates/basedeployment.yaml /chart/nodeserver/templates/deployment.yaml /chart/nodeserver/templates/service.yaml /chart/nodeserver/templates/hpa.yaml /chart/nodeserver/templates/istio.yaml /chart/nodeserver/Chart.yaml /chart/nodeserver/values.yaml replicaCount: 1 revisionHistoryLimit: 1 image: repository: cnbailey/nodeserver tag: 1.0.0 pullPolicy: Always resources: requests: cpu: 200m memory: 300Mi livenessProbe: initialDelaySeconds: 3000 periodSeconds: 1000 service: name: Node type: NodePort servicePort: 3000 hpa: enabled: false minReplicas: 5 maxReplicas: 9 metrics: cpu: targetAverageUtilization: 70 memory: targetAverageUtilization: 70 services: base: enabled: false
  • 56.
    $ cd ./chart/nodeserver/ $helm install —name nodeserver .
  • 57.
    $ cd ./chart/nodeserver/ $helm install —name nodeserver .
  • 58.
    $ cd ./chart/nodeserver/ $helm install —name nodeserver .
  • 61.
  • 62.
  • 63.
    Health Checks HTTP Requests GET:/ready 200 GET: /ready 200
  • 64.
    Health Checks HTTP Requests GET:/ready 200 GET: /health 200 GET: /ready 200 GET: /health 200
  • 65.
    Health Checks HTTP Requests GET:/ready 503 GET: /health 503 GET: /ready 200 GET: /health 200
  • 66.
    Health Checks HTTP Requests GET:/ready 503 GET: /health 503 GET: /ready 200 GET: /health 200 SIGTERM
  • 67.
    Health Checks HTTP Requests GET:/ready 503 GET: /health 503 GET: /ready 200 GET: /health 200 SIGTERM SIGKILL
  • 68.
    Health Checks HTTP Requests GET:/ready 503 GET: /health 503 GET: /ready 200 GET: /health 200 SIGTERM SIGKILL
  • 69.
    Health Checks HTTP Requests GET:/ready 503 GET: /health 503 GET: /ready 200 GET: /health 200
  • 70.
    Health Checks HTTP Requests GET:/ready 503 GET: /health 200 GET: /ready 200 GET: /health 200
  • 71.
    GET: /ready 200 GET:/health 200 GET: /ready 200 GET: /health 200 Health Checks HTTP Requests
  • 72.
    GET: /ready 200 GET:/health 200 GET: /ready 200 GET: /health 200 Health Checks HTTP Requests
  • 73.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const health = require(‘@cloudnative/health-connect'); let healthcheck = new health.HealthChecker();- Health Checks
  • 74.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const health = require(‘@cloudnative/health-connect'); let healthcheck = new health.HealthChecker(); app.use('/ready', health.ReadinessEndpoint(healthcheck)) app.use('/health', health.LivenessEndpoint(healthcheck))- Health Checks
  • 75.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const health = require(‘@cloudnative/health-connect'); let healthcheck = new health.HealthChecker(); const livePromise = new Promise(function (resolve, _reject) { resolve(); }); app.use('/ready', health.ReadinessEndpoint(healthcheck)) app.use('/health', health.LivenessEndpoint(healthcheck)) - Health Checks
  • 76.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const health = require(‘@cloudnative/health-connect'); let healthcheck = new health.HealthChecker(); const livePromise = new Promise(function (resolve, _reject) { resolve(); }); let liveCheck = new health.LivenessCheck("live", livePromise); app.use('/ready', health.ReadinessEndpoint(healthcheck)) app.use('/health', health.LivenessEndpoint(healthcheck)) - Health Checks
  • 77.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const health = require(‘@cloudnative/health-connect'); let healthcheck = new health.HealthChecker(); const livePromise = new Promise(function (resolve, _reject) { resolve(); }); let liveCheck = new health.LivenessCheck("live", livePromise); healthcheck.registerlivenessCheck(liveCheck); app.use('/ready', health.ReadinessEndpoint(healthcheck)) app.use('/health', health.LivenessEndpoint(healthcheck)) - Health Checks
  • 78.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const health = require(‘@cloudnative/health-connect'); let healthcheck = new health.HealthChecker(); const livePromise = new Promise(function (resolve, _reject) { resolve(); }); let liveCheck = new health.LivenessCheck("live", livePromise); const readyPromise = new Promise(function (resolve, _reject) { resolve(); }); let readyCheck = new health.ReadinessCheck("ready", readyPromise); healthcheck.registerlivenessCheck(liveCheck); healthcheck.registerReadinessCheck(readyCheck); app.use('/ready', health.ReadinessEndpoint(healthcheck)) app.use('/health', health.LivenessEndpoint(healthcheck)) - Health Checks -
  • 79.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const health = require(‘@cloudnative/health-connect'); let healthcheck = new health.HealthChecker(); const livePromise = new Promise(function (resolve, _reject) { resolve(); }); let liveCheck = new health.LivenessCheck("live", livePromise); const readyPromise = new Promise(function (resolve, _reject) { resolve(); }); let readyCheck = new health.ReadinessCheck("ready", readyPromise); const shutdownPromise = new Promise(function (resolve, _reject) { resolve(); }); let shutdownCheck = new health.ShutdownCheck(“shut”, shutdownProm); healthcheck.registerlivenessCheck(liveCheck); healthcheck.registerReadinessCheck(readyCheck); healthcheck.registerShutdownCheck(shutdownCheck); app.use('/ready', health.ReadinessEndpoint(healthcheck)) app.use('/health', health.LivenessEndpoint(healthcheck)) - Health Checks -
  • 82.
    GET: /ready 200 GET:/health 200 GET: /ready 200 GET: /health 200 HTTP Requests
  • 83.
    GET: /ready 200 GET:/health 200 GET: /metrics GET: /ready 200 GET: /health 200 GET: /metrics HTTP Requests
  • 84.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const prometheus = require(‘appmetrics-prometheus’).attach(); -
  • 85.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const prometheus = require(‘appmetrics-prometheus’).attach(); -
  • 89.
    PUBLIC NETWORK CLOUDNETWORK CATALOG ORDER INVENTORY USER MySQL MongoDB SPARK ELASTICSEARCH BACKEND FOR
 FRONTEND MICROSERVICES SERVICES LOAD
 BALANCER
  • 90.
    PUBLIC NETWORK CLOUDNETWORK CATALOG ORDER INVENTORY USER MySQL MongoDB SPARK ELASTICSEARCH BACKEND FOR
 FRONTEND MICROSERVICES SERVICES LOAD
 BALANCER
  • 91.
    PUBLIC NETWORK CLOUDNETWORK CATALOG ORDER INVENTORY USER MySQL MongoDB SPARK ELASTICSEARCH BACKEND FOR
 FRONTEND MICROSERVICES SERVICES LOAD
 BALANCER
  • 92.
    PUBLIC NETWORK CLOUDNETWORK CATALOG ORDER INVENTORY USER MySQL MongoDB SPARK ELASTICSEARCH BACKEND FOR
 FRONTEND MICROSERVICES SERVICES LOAD
 BALANCER
  • 93.
    PUBLIC NETWORK CLOUDNETWORK CATALOG ORDER INVENTORY USER MySQL MongoDB SPARK ELASTICSEARCH BACKEND FOR
 FRONTEND MICROSERVICES SERVICES LOAD
 BALANCER
  • 94.
    PUBLIC NETWORK CLOUDNETWORK CATALOG ORDER INVENTORY USER MySQL MongoDB SPARK ELASTICSEARCH BACKEND FOR
 FRONTEND MICROSERVICES SERVICES LOAD
 BALANCER
  • 95.
    PUBLIC NETWORK CLOUDNETWORK CATALOG ORDER INVENTORY USER MySQL MongoDB SPARK ELASTICSEARCH BACKEND FOR
 FRONTEND MICROSERVICES SERVICES LOAD
 BALANCER
  • 96.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const zipkin = require(‘appmetrics-zipkin’);-
  • 97.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const zipkin = require(‘appmetrics-zipkin’);-
  • 98.
    func add(_ a:Int, to b: Int) -> Void { print(a + b) } let a = ”5” let b = 3 const zipkin = require(‘appmetrics-zipkin’);-
  • 99.