Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The...
Transcript of Sharing lessons learned from IBM Garage · 2020-04-17 · THINK 2020 / 4569 / April 21, ... The...
![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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/2.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/3.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/4.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/5.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/6.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/7.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/8.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/9.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/10.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/11.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/12.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/13.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/14.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/15.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/16.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042305/5ed1222dc910782603754f97/html5/thumbnails/17.jpg)
THINK 2020 / 4569 / April 21, 2020 / © 2020 IBM Corporation 18