+ All Categories
Home > Documents > Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The...

Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The...

Date post: 27-May-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
17
Sharing lessons learned from IBM Garage Cloud Native Node.js Apps Session: 4569 Carlos Santana [email protected] IBM Garage Solution Engineering
Transcript
Page 1: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Sharing lessons learned from IBM Garage—Cloud Native Node.js AppsSession: 4569

Carlos [email protected] Garage Solution Engineering

Page 2: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Contents

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 2

The IBM Garage 03

The Container 04Base Images 05Best practices Dockerfile 06

The Service 08Kubernetes 09

The Operations 12Distributed Tracing 13Metrics 14Monitoring Dashboards 15

Page 3: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

IBM Garage

3

Let the IBM Garage elevate the way you work.

Use the IBM Garage Method for Cloudto enable business, development, and operations to continuously design, deliver, and validate new function.

The Method combines best of class industry methods, plus our own deep experience and IBM methods, informed by thousands of client engagements.

Enterprise Design Thinking

ü Focus on user outcomesü Empower diverse teamsü Reinvent restlessly

LeanStartup

ü Test assumptionsü Define a hypothesisü Develop a Minimum Viable

Product (MVP)ü Measure successü Continuously collect

feedback

Cloud NativePractices

ü Adopt DevOpsü Develop collaborativelyü Apply Pair Programmingü Use Test Driven

Development (TDD)ü Continuously deploy code

Page 4: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

The Container

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 4

“Package your application in an ephemeral way, secured and light”

Page 5: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Base Images

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 5

– Pick a good base image actively maintain for security vulnerabilities (i.e.. Red Hat UBI)

– Use image that do NOT run as root

– Supports latest LTS version of runtime

Page 6: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Images best practices

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 6

– Do not compile or package artifacts outside Dockerfile

– Exclude with .dockerignore

– Use multi-stage builds to drastically reduce size

– Leverage build cache

– Use Labels to annotate Image

– Use environment variable to control PORT exposed

Page 7: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Demo Containers

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 7

Page 8: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

The Service

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 8

“Provide services in flexible, scalable, and reliable way”

Page 9: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Kubernetes

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 9

– Define Memory and CPU Requests and Limits – Define Ports with name– Define Probes for Liveness and Readiness

Page 10: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Demo Kubernetes

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 11

Page 11: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

The Operations

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 12

“Find problem before they show up in production”

Page 12: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Metrics

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 13

– Use Prometheus standard format for Metrics– Emit Metrics from application– Use Prometheus client node.js library– If Istio is available, then leverage metrics from

Istio instead of application

Page 13: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Monitoring

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 14

– Use Grafana or Sysdig dashboards to visualize metrics

– Use Alert Manager or Sysdig to alert someone or a about a problem

– Use Graphs during performance testing to visualize across the different metrics types (network, memory, cpu, storage)

Page 14: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Tracing

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 15

– Use Jaeger as the tool to collect traces– Use Jaeger client node.js library– Use traces to find latency problems across

services– Use traces within same container to find function

affecting performance – Use traces as form of distributed logging

Page 15: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Demo Operations

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 16

Page 16: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

Thank you.

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 17

Page 17: Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The Container 04 BaseImages 05 Best practices Dockerfile 06 TheService 08 Kubernetes 09

THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 18


Recommended