TIL: Docker Networking Deep Dive, Julia Evans' Systems Knowledge, and Kubernetes from the Ground Up
Today I learned about Docker graph drivers and container networking, Julia Evans' excellent systems programming explanations, and comprehensive Kubernetes architecture through Kamal Marhubi's ground-up approach.
# Default bridge network (docker0)ip addr show docker0
brctl show docker0
# Container networking internalsdocker run -d --name web nginx
docker exec web ip addr show
docker exec web ip route show
# Network namespace inspectiondocker inspect web | grep NetworkMode
sudo nsenter -t $(docker inspect -f '{{.State.Pid}}' web) -n ip addr
# Service discovery within custom networksdocker network create app-network
docker run -d --name db --network app-network postgres:13
docker run -d --name app --network app-network my-app:latest
# Containers can reach each other by name# app container can connect to: db:5432# No need for --link (deprecated)# Port publishing vs exposuredocker run -p 8080:80 nginx # Publish to hostdocker run --expose 80 nginx # Only expose to other containers
# API Server responsibilities:# 1. RESTful API for all Kubernetes resources# 2. Authentication and authorization# 3. Admission control and validation# 4. etcd storage interface# 5. Resource change notifications# Example API interactionapiVersion:v1kind:Podmetadata:name:example-podnamespace:defaultspec:containers:- name:webimage:nginx:1.20ports:- containerPort:80resources:limits:memory:"128Mi"cpu:"500m"
# Kubelet responsibilities:# 1. Watch API server for pod assignments# 2. Manage container lifecycle (start, stop, restart)# 3. Health checking and reporting# 4. Resource monitoring and management# 5. Volume mounting and networking setup# Kubelet configurationsudo systemctl status kubelet
sudo journalctl -u kubelet -f
# Pod lifecycle management# kubelet receives pod spec from API server# Downloads container images# Creates container runtime (containerd/docker)# Sets up networking (CNI plugins)# Mounts volumes# Starts containers# Monitors health and reports status
# Container processes visible in host /procdocker run -d --name test nginx
docker exectest ps aux
# Container networking through Linux primitives ip netns list
docker exectest cat /proc/net/tcp
# Container storage as filesystem layersls -la /var/lib/docker/overlay2/
mount | grep overlay
# Socket communicationstat /var/run/docker.sock # Docker daemon socketfile /var/run/docker.sock # Shows socket type
These concepts form the foundation for understanding modern containerized and orchestrated systems, from basic Docker networking to sophisticated Kubernetes cluster management.