Debugging Nodejs Apps On Kubernetes: Radu Matei @matei - Radu

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Debugging NodeJS apps on Kubernetes

Radu Matei @Matei_Radu


Software Engineer, @Micrososft @Azure radu-matei.com
Radu Matei
1. software engineer
2. Cloud Native developer tools
3. Helm, Draft, Brigade, VS Code Kubernetes
4. Golang support for Azure Functions (coming soon to a cloud
near you)
radu-matei.com
Talking Points
1. Containers 101

2. Orchestrators – Kubernetes
3. Working with Helm and Draft in Kubernetes
Containers 101
Containers
Every container gets its own:
- root directory
- eth0 network interface
- PID0

Use the following kernel features:


- cgroups: limiting what you can use
- namespaces: limiting what you can view

You usually run one application / service per container

Containers and apps share lifecycle (when the process that started the container finishes, the container
stops and the resources get deallocated)
Containers 101
Containers 101
Containers have been around for many years
chroot, FreeBSD Jails, LXC (cgroups, namespaces), LXD

Docker Inc. did not invent them


They created open source software to build and manage containers

Docker makes containers easy


I recently deployed a Ruby app – I never wrote Ruby 

Docker is a container format and unified set of tools


Docker CLI, Docker Engine, Docker Swarm, Docker Compose, Docker Machine and more…
Container useful resources
1. Jess Frazelle article – containers (not real)
2. Liz Rice – containers from scratch
Containers 101
Containers have been around for many years
chroot, FreeBSD Jails, LXC (cgroups, namespaces), LXD

Docker Inc. did not invent them


They created open source software to build and manage containers

Docker makes containers easy


I recently deployed a Ruby app – I never wrote Ruby 

Docker is a container format and unified set of tools


Docker CLI, Docker Engine, Docker Swarm, Docker Compose, Docker Machine and more…
Debugging…
Debugging monoliths
1. start IDE (IntelliJ, NetBeans, Visual Studio)
2. press F5 (or whatever shortcut your IDE has)
3. have application code, logs and breakpoints in one place
4. make requests to your app and step through code
.
.
.
n. understand the problem and fix it
Debugging monoliths
Print line debugging?
Debugging microservices
1. restart the microservice
2. add some print statements
3. re-deploy the microservice
4. read the new logs
.
.
.
n. repeat?
Debugging on Kubernetes

- Proprietary, only in Cloud


- Google Stackdriver for GKE
- Azure DevSpaces debugging for AKS

- Privileged components
- Squash debugger for Kubernetes + KubeCon talk
Debugging on Kubernetes
- build app for debugging
- create container image w/ debugger + push image
- update Kubernetes manifest / Helm chart

- wait for pod to be in running state


- forward application ports locally
Debugging on Kubernetes - Tools
- KSync
- Telepresence
- Draft, Skaffold

- they help with the iterative process, but don’t offer IDE-
like experience for debugging
VS Code Kubernetes extension
DEMO
Breakpoint debugging microservices on Kubernetes
Q&A

Radu Matei radu-matei.com

You might also like