How do I Troubleshooting on Container, more than Docker?
Special Edition
# whois Phil Huang 黃秉鈞
Ref: https://www.linkedin.com/in/phil-huang-09b09895/
Agenda
Prologue
Containers are Linux
Why Podman?
Why Network Namespace is Important?
Docker ? Container ?
OCI: Open Container Initiative
Container Networking Interface
3 Useful Container Network Interface for Troubleshooting
$ man podman run
Bridge Mode
# podman run -it quay.io/pichuang/debug-container
Container Mode
# podman run -it --net container:<container_name> quay.io/pichuang/debug-container
Host Mode
# podman run -it --net host quay.io/pichuang/debug-container
Kubernetes Networking Model
Enterprise Grade Kubernetes Platform
Undestanding of 5 Kubernetes �Network Traffic
Basic Concept: 1 ~ n Containers per Pod
Traffic Model: Container to Container
Traffic Model: Pod-to-Pod in the same node
Traffic Model: Pod-to-Pod across different nodes
Traffic Model: Pod-to-Service
Traffic Model: Service-to-Internet
How to do OpenShift Network Troubleshooting?
Running Container Level Debugging
# Get a Shell to a Running Container
oc rsh welcome-1-xqbm9 -- /bin/bash
Running Container Level Debugging
Namespace Level Debugging
# Running one Pod in namespace and specific node
oc run ocp-debug-container --image quay.io/pichuang/debug-container --restart=Never -it --attach --rm --overrides='{ "apiVersion": "v1", "spec": { "nodeSelector":{"kubernetes.io/hostname":"compute-1"}}}'
Debug Pod
Namespace
Namespace Level Debugging
Node Level Debugging
# Running one Pod on specific Node
oc run ocp-debug-container --image quay.io/pichuang/debug-container --restart=Never -it --attach --rm --overrides='{ "apiVersion": "v1", "spec": { "nodeSelector":{"kubernetes.io/hostname":"compute-1"}, "hostNetwork": true}}'
Debug Pod
Container OS
Node Level Debugging
Running Pods Level Debugging
# Cloning specific Pod and exec it
oc debug pod/productpage-v1-597b74b4c-xzf92
Running Pods Level Debugging
Environment
Ref: https://k9scli.io/
How to obtain or make a debug container?
Make Your Company-Wide Debug Container
References