OCI/Docker | Kubernetes Orchestration | Hosting
Servers should be cattle, not pets. But it’s OK to miss “the servers of Middle Earth”.
VM Hypervisors
- VMWare
- KVM
- Hyper-V
Container History
Containers appeared after invention of cgroups and namespaces. LXC was an early try.
LXC Linux Containers
- Between OCI and fullblown VM
- Docker was originally built on top of LXC.
- LXD: extension of LXC
“LXD is designed for hosting virtual environments that “will typically be long running and based on a clean distribution image,” whereas “Docker focuses on ephemeral, stateless, minimal containers that won’t typically get upgraded or re-configured but instead just be replaced entirely.”
CRI, OCI
-
CRI (Container Runtime Interface) Compliant Runtimes
- Kubernetes API that allows you to use different container runtimes (like containerd and CRI-O).
- Defines gRPC protocol for communicating between cluster components.
-
OCI (Open Container Initiative) Specs for building images and running containers. Has 3 parts:
- Runtime Spec
- Image Spec
- Distribution Spec
-
Runtime Specs
- High Level runtimes
- containerD: daemon that interfaces between container engine and container runtimes.
- CRI compliant through cri plugin (this still true?)
- Originally from Docker
- Docker
- CRI-O
- Red Hat/IBM
- podman
- containerD: daemon that interfaces between container engine and container runtimes.
- Low Level
- runc: OCI universal OS container runtime.
- by Docker, now part of CNCF
- Docker and Containerd run on it
- gvisor
- kata
- runc: OCI universal OS container runtime.
- High Level runtimes
Docker
- Docker CLI
- Docker Desktop: Docker needs Linux, so MacOS (Unix, not Linux), needs a VM, just like Windows (except WSL2).
- DinD
- Docker Hub
- VSCode DevContainers
Podman
No daemon, each container is self-sufficient. So no SPOF (single point of failure). NOT root by default. More secure than Docker.
- Podman CLI (vs Docker CLI)
- Switching from Docker to Podman (devcontainer)
- VSCode Remote Container Support
Others
- LXC: Canonical, pre Docker. No daemon.
- rkt: formerly CoreOS Rocket. Can run Docker. No daemon. RedHat.
Container Image Repos
- Docker Hub
- GitHub Containers
- Artifactory Docker Reg: Local repo option.
- AWS Container Registry
Kubernetes Container Orchestration
-
Docker Compose: smaller apps
-
K8s (Kubernetes) for the big kahunas
-
Cluster Architecture
- 1 Control Plane (see components below)
- n Namespaces (default, plus additionals)
- n Nodes: 1 physical or virtual host: 1 kubelet, 1 k-proxy, 1 container runtime
- n Pods per node
- n Containers per pod
- services
- deployments
- n Pods per node
- n Nodes: 1 physical or virtual host: 1 kubelet, 1 k-proxy, 1 container runtime
-
Control Plane Components
- kubeadm
- HA Control Components. Options:
- Stacked control plane nodes
- External etcd cluster
- Maps to a container runtime
- Docker: default if it is installed
- containerd: (docker installs containerd as well, so version conflict)
- CRI-O
- HA Control Components. Options:
- kube-apiserver
- etcd (backing store) key-value store
- kube-scheduler: watches for new pods with no assigned nodes
- kube-controller-manager
- Node controller
- Job controller
- Endpoints
- Service Account and Token
- cloud-controller-manager: link cluster to cloud provider’s API
- kubeadm
-
Node Components: run on every node
- kubelet: manages containers on this pod via PodSpec
- kube-proxy: network proxy.
- container runtime: Options implementing Kubernetes CRI (container runtime interface)
- Docker Engine
- containerd
- CRI-O
- crictl
-
DNS: Cluster DNS server. Auto added to containers started by Kube.
- Namespaces of Services
- DNS Records
- Services
- A/AAAA records for normal services.
- SRV records for headless.
- Pods
- A/AAAA
- hostname and subdomain
- setHostnameAsFQDN(boolean): fully qualified domain name -> hostname.
- DNS Policy
- DNS Config
- Services
-
Web UI (Dashboard)
-
- Logging agent
- sidecar container
- Logging agent
-
-
Other
-
Loft Multi-tenancy, self service.
-
KubeCtl CLI commands to talk to clusters
-
Local Kubernetes Dev
- kind (K8s-in-Docker) Local kubernetes.
- minikube: Local K8s. SINGLE NODE CLUSTER. Auto installs podman (check version)
- LoadBalancer
- Multi-cluster
- NodePorts
- Persistent Volumes
- Ingress
- Dashboard
- Container runtime
- API Server
- Addons
- NVIDIA GPU support
- Filesystem mounts
-
Istio Service Mesh: Extends K8s
- traffic mgt: inter service routing, failure recovery, load balancing
- telemetry
- security: encryption, role-based access and auth
-
- Argo Workflows: k8s native workflow engine. Supports DAG, step-based.
- Argo CD: Cont. delivery, UI.
- Argo Rollouts: k8s deployment strategies. Canary, Blue-Green.
- Argo Events: event based dependency mgt.
-
Helm
-
Tekton
-
Konfigure?
-
Open Telemetry
-
-
K3s (Lightweight Kubernetes) IOT, Edge, ARM, RaspPi. <50MB>
-
Local (For Devs)
- Docker Desktop Components
- Hyperkit (OSX) OSX is actually Unix, not Linux, so needs a Hypervisor to run a Linux VM.
- [WSL 2 (Windows)]
- Datakit
- VPNkit
- Docker CE (Container Engine), CLI
- Kubernetes: ? version
- [Minikube] Drop in replacement for Docker Desktop. Runs Docker inside K8s.
- Single node cluster
- Docker CE, CLI (they are open source)
- Install in WSL 2
- Docker Desktop Components
Hosting Providers
- Cloud
- AWS
- GCP
- Azure
- Linode
- Digital Ocean
- Heroku
- On Prem
- VMSphere
- AWS Outposts Hybrid
- Azure HCI (hyperconverged infrastructure)
- Local (For Devs):
- Cloud Vendor Integrations: local simulation or remote integration with test envs
- LocalStack: AWS dev offline.
- Serverless
- AWS Amplify
- AWS SAM
- AWS Chalice
- Firebase (Google)
- Desktop Containers
- Docker Desktop Components DEPRECATED
- Hyperkit (OSX) OSX is actually Unix, not Linux, so needs a Hypervisor to run a Linux VM.
- [WSL 2 (Windows)]
- Datakit
- VPNkit
- Docker CE (Container Engine), CLI
- Kubernetes: ? version
- [Minikube] Drop in replacement for Docker Desktop. Runs Docker inside K8s.
- Single node cluster
- Docker CE, CLI (they are open source)
- Install in WSL 2
- Rancher Desktop
- Docker Desktop Components DEPRECATED
- Cloud Vendor Integrations: local simulation or remote integration with test envs
Storage:
- Longhorn (Rancher Labs)