Docker and Kubernetes

Feb 2024, Ulf Schneider

▦ ▦ ▦

Docker Containers

Docker allows to package software applications into images

The image has everything the application needs to run:

code, runtime, libraries, settings, ...

The image can be uploaded to a registry (public and private) for reuse, e.g. hub.docker.com

The image can easily be shared and distributed across platforms (Linux, Win, Mac)

A running instance of an image is a container

Run a web server with a Docker tutorial

  1. docker run --rm -p 4230:80 docker/getting-started
  2. Point your browser to http://localhost:4230/

Multiple containers can be started from a single image

Containers run on different platforms because of virtualization

Virtualization allows a single computer to be divided into multiple virtual computers

What is the difference of a container and a virtual machine?

Docker containers use the hosts operating system

Virtual machines bring their own operating system

Containers reuse the OS Kernel

Docker containers, compared to VM´s:

  • need much less cpu and mem
  • are smaller in size (mb vs. gb)
  • startup much faster (sec vs. min)

Kubernetes

Kubernetes is a management layer to orchestrate many containers (100s and 1000s)

▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦ ▦

You might also read and write K8s instead of Kubernetes

Kubernetes provides for containerized services:

  • high availability
  • scalability
  • disaster recovery

The name Kubernetes originates from Greek, meaning helmsman or pilot

A container inside of Kubernetes is a pod

Kubernetes cluster architecture sketch

⎈ ▦ ▦ ▦

Have fun with containers!