Posts K8s Overview
Post
Cancel

K8s Overview

Some initial research on k8s.

  1. Relationship between containerd and docker
  • Low level runtime currently mainly uses runc
  • High level runtime currently mainly uses containerd
graph TD;
    A[Docker CLI]-->|docker run ...|B[Docker Engine];
    B[Docker Daemon];
    B -->C[Containerd];

    C --> D[Open Container Initiative OCI. 2015 by Docker];
    D --> |Implement|E[runc Golang];
    D --> |Implement|CR[crun C];
    D --> |Implement|FC[firecracker-containerd AWS Lambda];

    E --> CO[container]
    CR --> CO[container]
    FC --> CO[container]

    F[Kubernetes] --> G[Container Runtime Interface CRI - K8s API];
    G-->|dockershim. 1.24 k8s remove|B
    G -->|Implement| C[Containerd from Docker];
    G --->|Implement| H[CRI-O from Red Hat - OpenShift, IBM..];
    H --> D

    subgraph Docker
    A
        B
        
    end

    subgraph High Level Runtime: pull image. network. storage
        C
        H
    end

    subgraph Low Level Runtime
        E
        CR
        FC
    end

    subgraph Kubernetes
        F
        G
    end
  • k8s is dropping docker runtime from version 1.24
  • dropping doesn’t mean having to change docker-formatted containers (i.e., dockerfile standard is still kept the same)
  • both containerd and CRI-O can run docker-formatted and OCI-formatted images, the only difference is they can run without needing to use docker commands from docker daemon

  • detailed evaluation article
  1. Model of container components

Understanding containers simply: grouping processes together to isolate them

Container formation history:

  • don’t want to go through the trouble of creating an additional VM for everything to be completely independent
  • want to manage independent environments more lightly (direct interaction)

VM vs container

Distinguishing virtualization and Container:

  • virtualization works with VMs, containers work directly with processes

Docker in the overall container picture:

container

Previously docker consisted of 3 parts:

  • Managing images, networks, volumes (now it has shifted to only managing this part - equivalent function and task with K8S)
  • container manager -> moved to using containerd (CNCF)
  • container runtime -> moved to runc (CNCF)

I have this open question for you: why can’t systemd run in containers?

  1. K8s components

I’ll introduce a basic K8S model

k8s

It will include the following basic components:

  • Runtime (containerd)
  • kubelet: runs on nodes
  • Master: etcd(database - stores cluster information), scheduler, api-server, controller
  • HA for api-server: can use nginx or haproxy, combined with keepalived
  • Kube-proxy

Details about component interactions, network, volume… I’ll see you in the distant future :D

This post is licensed under CC BY 4.0 by the author.