Internet Engineering

Cloud Native and Kubernetes

Fall 2026 ยท Amirkabir University of Technology
@1995parham

Cloud Native and Kubernetes

A series about containers, from writing a cloud native service in Go down to building a container by hand with Linux primitives, and back up to running them with Docker.

The slides are PDFs, and the shell scripts next to them are meant to be run while reading.

Sessions ๐Ÿ“œ

Hands On ๐Ÿงช

Scripts that go with Containers from Scratch:

create_container.sh

Five steps: docker run a centos stream9 container that installs ps, ip and hostname, and docker export it to a tarball; untar it into mycontainer; unshare the mount, uts, ipc, net and pid namespaces with bash as PID 1; bind mycontainer onto itself and pivot_root into it, so the host's root moves to /oldroot; mount /proc and lazily unmount /oldroot. The result: hostname mohammad, ps shows our shell as PID 1, ip a shows no eth0, and ls / shows the image's files

play_with_netns.sh

First, netns parham with head1 at 192.168.2.1/24 and netns mohammad with head2 at 192.168.2.2/24 joined by one veth pair; ping succeeds. Second, each namespace has a veth end, parham-end at 192.168.2.1/24 and mohammad-end at 192.168.2.2/24, whose other end, parham-br or mohammad-br, is a port on my-bridge in the host namespace. The bridge holds 192.168.2.254/24 as the gateway; with default routes, ip_forward and iptables MASQUERADE out and DNAT of port 80 to 192.168.2.2, parham pings mohammad through the bridge, pings 1.1.1.1 through NAT, and another host reaches a web server in mohammad on port 80

See Also

  • The Virtualization lecture covers the namespace, cgroup, and layered filesystem primitives these build on
Fork me on GitHub